@voltro/plugin-rooms 0.0.0-stage → 0.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (495) hide show
  1. package/CHANGELOG.md +24492 -0
  2. package/LICENSE +61 -0
  3. package/README.md +9204 -2
  4. package/SECURITY.md +56 -0
  5. package/THIRD-PARTY-NOTICES.md +12496 -0
  6. package/dist/actor.js +1473 -0
  7. package/dist/apiBinding.js +677 -0
  8. package/dist/apiRegistryBinding.js +398 -0
  9. package/dist/apiReservations.js +432 -0
  10. package/dist/baselines.js +72 -0
  11. package/dist/bots.d.ts +1485 -0
  12. package/dist/bots.js +562 -0
  13. package/dist/catalog.js +79 -0
  14. package/dist/checkpointJson.js +23 -0
  15. package/dist/checkpointStore.js +385 -0
  16. package/dist/client.js +55 -0
  17. package/dist/clockSync.js +50 -0
  18. package/dist/collision.js +155 -0
  19. package/dist/commandDelivery.js +100 -0
  20. package/dist/commandRecord.js +10 -0
  21. package/dist/commandWithdrawal.js +182 -0
  22. package/dist/connection.js +496 -0
  23. package/dist/controlCarrier.js +374 -0
  24. package/dist/controlRegistry.js +78 -0
  25. package/dist/controlTarget.js +44 -0
  26. package/dist/controlTransport.js +573 -0
  27. package/dist/developmentBinding.js +112 -0
  28. package/dist/directory.js +322 -0
  29. package/dist/directoryProjection.js +116 -0
  30. package/dist/errors.d.ts +125 -0
  31. package/dist/errors.js +52 -0
  32. package/dist/fixed.d.ts +284 -0
  33. package/dist/fixed.js +10 -0
  34. package/dist/fixed32.js +133 -0
  35. package/dist/fixedCollision.js +59 -0
  36. package/dist/fixedCollision32.js +108 -0
  37. package/dist/fixedMath.js +55 -0
  38. package/dist/fixedRaw.js +10 -0
  39. package/dist/fixedSlabs.js +33 -0
  40. package/dist/fixedTrig.js +47 -0
  41. package/dist/fixedTrig32.js +37 -0
  42. package/dist/fixedVectors.js +112 -0
  43. package/dist/fixedVectors32.js +94 -0
  44. package/dist/fixedWide.js +49 -0
  45. package/dist/fixedWords.js +45 -0
  46. package/dist/gateway.js +56 -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 +81 -0
  54. package/dist/geometryActorInventory.js +107 -0
  55. package/dist/geometryAdminClient.js +86 -0
  56. package/dist/geometryAdminData.js +31 -0
  57. package/dist/geometryAdminFixtures.js +49 -0
  58. package/dist/geometryAdminPorts.js +4 -0
  59. package/dist/geometryAdminRpc.js +57 -0
  60. package/dist/geometryAdminRpcRoutes.js +48 -0
  61. package/dist/geometryAdminSchemas.js +38 -0
  62. package/dist/geometryAdministration.js +189 -0
  63. package/dist/geometryAdministrationPorts.js +4 -0
  64. package/dist/geometryApiBinding.js +164 -0
  65. package/dist/geometryAppStorage.js +57 -0
  66. package/dist/geometryArtifacts.js +197 -0
  67. package/dist/geometryAssetBundle.js +116 -0
  68. package/dist/geometryAssetClient.js +24 -0
  69. package/dist/geometryAssetData.js +105 -0
  70. package/dist/geometryAssetHttp.js +122 -0
  71. package/dist/geometryAssetPorts.js +4 -0
  72. package/dist/geometryAssetRpc.js +29 -0
  73. package/dist/geometryAssetRpcRoutes.js +39 -0
  74. package/dist/geometryAssetStorageGrant.js +102 -0
  75. package/dist/geometryBoxOverlap.js +109 -0
  76. package/dist/geometryCatalogueDigest.js +110 -0
  77. package/dist/geometryCellCoverage.js +84 -0
  78. package/dist/geometryCellLoader.js +27 -0
  79. package/dist/geometryChannel.js +133 -0
  80. package/dist/geometryChunkHttp.js +53 -0
  81. package/dist/geometryChunkLeases.js +21 -0
  82. package/dist/geometryClient.d.ts +1429 -0
  83. package/dist/geometryClient.js +148 -0
  84. package/dist/geometryClientChunks.js +329 -0
  85. package/dist/geometryClientDelta.js +24 -0
  86. package/dist/geometryClientHttp.js +36 -0
  87. package/dist/geometryClientInterest.js +108 -0
  88. package/dist/geometryClientStatic.js +33 -0
  89. package/dist/geometryCms.d.ts +763 -0
  90. package/dist/geometryCms.js +216 -0
  91. package/dist/geometryCommitCoordinator.js +240 -0
  92. package/dist/geometryCompactionFixture.js +83 -0
  93. package/dist/geometryCompactionStrategies.js +37 -0
  94. package/dist/geometryConnectionClient.js +22 -0
  95. package/dist/geometryDerivationFixtures.js +140 -0
  96. package/dist/geometryDerivationStrategies.js +26 -0
  97. package/dist/geometryDigest.js +12 -0
  98. package/dist/geometryEditChannel.js +69 -0
  99. package/dist/geometryEditIngress.js +262 -0
  100. package/dist/geometryEdits.js +365 -0
  101. package/dist/geometryEnvelope.js +40 -0
  102. package/dist/geometryGridRaycast.js +91 -0
  103. package/dist/geometryGridSweep.js +91 -0
  104. package/dist/geometryHeightfield.js +165 -0
  105. package/dist/geometryHeightfieldRaycast.js +73 -0
  106. package/dist/geometryHeightfieldSweep.js +84 -0
  107. package/dist/geometryHeightfieldVolume.js +44 -0
  108. package/dist/geometryHost.js +321 -0
  109. package/dist/geometryHostDirectory.js +206 -0
  110. package/dist/geometryHostMutations.js +136 -0
  111. package/dist/geometryHostStreams.js +123 -0
  112. package/dist/geometryHttpBody.js +75 -0
  113. package/dist/geometryHttpRoutes.js +111 -0
  114. package/dist/geometryImportGltf.js +299 -0
  115. package/dist/geometryImportLdtk.js +53 -0
  116. package/dist/geometryImportPng.js +143 -0
  117. package/dist/geometryImportPublication.js +66 -0
  118. package/dist/geometryImportTiled.js +38 -0
  119. package/dist/geometryImportTiles.js +135 -0
  120. package/dist/geometryImportVox.js +129 -0
  121. package/dist/geometryImportedSource.js +100 -0
  122. package/dist/geometryInspectEndpoint.js +247 -0
  123. package/dist/geometryInspection.js +91 -0
  124. package/dist/geometryInstall.js +120 -0
  125. package/dist/geometryJournalArchiveData.js +20 -0
  126. package/dist/geometryJournalArchiveIndex.js +329 -0
  127. package/dist/geometryJournalArchiveTable.js +20 -0
  128. package/dist/geometryJournalCompaction.js +99 -0
  129. package/dist/geometryJournalPatch.js +46 -0
  130. package/dist/geometryJournalRetention.js +111 -0
  131. package/dist/geometryJournalRetentionSchemas.js +35 -0
  132. package/dist/geometryJournalRetentionSweep.js +111 -0
  133. package/dist/geometryJournalRetentionWorkflow.js +27 -0
  134. package/dist/geometryJournalRetentionWorkflowData.js +30 -0
  135. package/dist/geometryJournalStorage.js +147 -0
  136. package/dist/geometryLoader.js +117 -0
  137. package/dist/geometryManifest.js +112 -0
  138. package/dist/geometryManifestChannel.js +92 -0
  139. package/dist/geometryManifestClient.js +121 -0
  140. package/dist/geometryManifestData.js +48 -0
  141. package/dist/geometryManifestPorts.js +4 -0
  142. package/dist/geometryManifestPublication.js +108 -0
  143. package/dist/geometryManifestSource.js +67 -0
  144. package/dist/geometryMigrationJournal.js +13 -0
  145. package/dist/geometryMigrationStrategies.js +6 -0
  146. package/dist/geometryMigrations.js +322 -0
  147. package/dist/geometryNativeMetadata.js +51 -0
  148. package/dist/geometryPatch.js +169 -0
  149. package/dist/geometryPersistence.js +448 -0
  150. package/dist/geometryPersistenceCapture.js +68 -0
  151. package/dist/geometryPersistenceData.js +139 -0
  152. package/dist/geometryPersistencePorts.js +4 -0
  153. package/dist/geometryPlayerAdmission.js +33 -0
  154. package/dist/geometryPlayerEditOwner.js +264 -0
  155. package/dist/geometryPlayerEdits.js +48 -0
  156. package/dist/geometryPrepared.js +187 -0
  157. package/dist/geometryPrivacyFence.js +23 -0
  158. package/dist/geometryProceduralPublication.js +90 -0
  159. package/dist/geometryProceduralWorker.js +163 -0
  160. package/dist/geometryPublication.js +109 -0
  161. package/dist/geometryRayAlgebra.js +115 -0
  162. package/dist/geometryReadClient.js +156 -0
  163. package/dist/geometryReadPorts.js +4 -0
  164. package/dist/geometryReadRpc.js +26 -0
  165. package/dist/geometryReadRpcRoutes.js +46 -0
  166. package/dist/geometryReliablePublication.js +81 -0
  167. package/dist/geometryReloadPorts.js +45 -0
  168. package/dist/geometryReloadSource.js +277 -0
  169. package/dist/geometryRenderCache.js +164 -0
  170. package/dist/geometryRenderLod.js +101 -0
  171. package/dist/geometryRollback.js +124 -0
  172. package/dist/geometryRollbackCoordinator.js +202 -0
  173. package/dist/geometryRollbackPorts.js +45 -0
  174. package/dist/geometryRollbackSource.js +208 -0
  175. package/dist/geometryRollbackStore.js +197 -0
  176. package/dist/geometrySchemas.js +26 -0
  177. package/dist/geometryServer.d.ts +2766 -0
  178. package/dist/geometryServer.js +62 -0
  179. package/dist/geometryShapeRaycast.js +110 -0
  180. package/dist/geometryShapeSegments.js +33 -0
  181. package/dist/geometryShapes.js +222 -0
  182. package/dist/geometrySnapshot.js +75 -0
  183. package/dist/geometrySnapshotChannel.js +159 -0
  184. package/dist/geometrySnapshotClient.js +158 -0
  185. package/dist/geometrySnapshotPreparation.js +75 -0
  186. package/dist/geometrySnapshotServer.js +190 -0
  187. package/dist/geometrySqlOwner.js +20 -0
  188. package/dist/geometryStorage.js +126 -0
  189. package/dist/geometryStorageGrant.js +68 -0
  190. package/dist/geometryStorageIdentity.js +8 -0
  191. package/dist/geometryTileArtifact.js +9 -0
  192. package/dist/geometryTileCodec.js +193 -0
  193. package/dist/geometryTileCollision.js +95 -0
  194. package/dist/geometryTileNavigation.js +127 -0
  195. package/dist/geometryTileView.js +34 -0
  196. package/dist/geometryVersionActivation.js +113 -0
  197. package/dist/geometryVersionClient.js +237 -0
  198. package/dist/geometryVersionCompare.js +39 -0
  199. package/dist/geometryVersionMigration.js +105 -0
  200. package/dist/geometryVoxel.js +252 -0
  201. package/dist/geometryWorldEntitySubject.js +31 -0
  202. package/dist/geometryWorldExtent.js +11 -0
  203. package/dist/geometryWorldMetadata.js +37 -0
  204. package/dist/geometryWorldStrategyFixtures.js +126 -0
  205. package/dist/geometryWorldView.js +306 -0
  206. package/dist/host.js +127 -0
  207. package/dist/hostBinding.js +276 -0
  208. package/dist/hostCellObservation.js +113 -0
  209. package/dist/hostClientCapacity.js +89 -0
  210. package/dist/hostCommandScope.js +63 -0
  211. package/dist/hostController.js +3093 -0
  212. package/dist/hostDeployment.js +64 -0
  213. package/dist/hostDrain.js +151 -0
  214. package/dist/hostDrainPorts.js +4 -0
  215. package/dist/hostDriver.js +178 -0
  216. package/dist/hostLane.js +287 -0
  217. package/dist/hostListener.js +78 -0
  218. package/dist/hostListenerBinding.js +18 -0
  219. package/dist/hostLoopObservation.js +89 -0
  220. package/dist/hostMetrics.js +55 -0
  221. package/dist/hostRegistryBinding.js +417 -0
  222. package/dist/hostSelection.js +15 -0
  223. package/dist/hostShutdown.js +46 -0
  224. package/dist/hostTurnObservation.js +52 -0
  225. package/dist/identities.js +3 -0
  226. package/dist/index.d.ts +8632 -0
  227. package/dist/index.js +231 -0
  228. package/dist/inputReceipts.js +62 -0
  229. package/dist/inputRedundancy.js +54 -0
  230. package/dist/inspect.js +237 -0
  231. package/dist/lockstep.d.ts +436 -0
  232. package/dist/lockstep.js +381 -0
  233. package/dist/lockstepAdmission.js +261 -0
  234. package/dist/lockstepAdmissionCodec.js +93 -0
  235. package/dist/lockstepAdmissionPorts.js +4 -0
  236. package/dist/lockstepClientSession.js +577 -0
  237. package/dist/lockstepDefinition.js +147 -0
  238. package/dist/lockstepHostLoop.js +242 -0
  239. package/dist/lockstepInitialAdmission.js +66 -0
  240. package/dist/lockstepInitialStrategyFixtures.js +44 -0
  241. package/dist/lockstepJournal.js +394 -0
  242. package/dist/lockstepJournalCodec.js +253 -0
  243. package/dist/lockstepJournalPorts.js +4 -0
  244. package/dist/lockstepJournalRebuild.js +207 -0
  245. package/dist/lockstepJournalRows.js +56 -0
  246. package/dist/lockstepMembers.js +130 -0
  247. package/dist/lockstepMessages.js +46 -0
  248. package/dist/lockstepOwnedRoom.js +763 -0
  249. package/dist/lockstepPolicies.js +83 -0
  250. package/dist/lockstepReact.js +46 -0
  251. package/dist/lockstepRecoveryTruth.js +120 -0
  252. package/dist/lockstepRosterConfig.js +31 -0
  253. package/dist/lockstepSeed.js +11 -0
  254. package/dist/lockstepSeedFixture.js +19 -0
  255. package/dist/lockstepServer.d.ts +3897 -0
  256. package/dist/lockstepServer.js +324 -0
  257. package/dist/lockstepServerConfig.js +100 -0
  258. package/dist/lockstepServerRoles.js +402 -0
  259. package/dist/lockstepServerStrategyFixtures.js +32 -0
  260. package/dist/lockstepStrategies.js +5 -0
  261. package/dist/lockstepStrategyFixtures.js +136 -0
  262. package/dist/lockstepTerminal.js +89 -0
  263. package/dist/lockstepTerminalPorts.js +4 -0
  264. package/dist/lockstepTransport.js +772 -0
  265. package/dist/lockstepTransportConfig.js +31 -0
  266. package/dist/lockstepWireRoster.js +33 -0
  267. package/dist/matchRoomProvider.js +31 -0
  268. package/dist/matchRooms.js +18 -0
  269. package/dist/membershipObserver.js +46 -0
  270. package/dist/moderation.js +97 -0
  271. package/dist/movementSpecials.js +103 -0
  272. package/dist/ownership.js +16 -0
  273. package/dist/ownershipWithdrawal.js +17 -0
  274. package/dist/pcg32.js +95 -0
  275. package/dist/ports.d.ts +1241 -0
  276. package/dist/ports.js +10 -0
  277. package/dist/quaternion.js +69 -0
  278. package/dist/react.d.ts +406 -0
  279. package/dist/react.js +108 -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 +242 -0
  283. package/dist/reaperSchemas.js +41 -0
  284. package/dist/reaperWorkflow.js +69 -0
  285. package/dist/recovery.js +188 -0
  286. package/dist/recoverySeats.js +25 -0
  287. package/dist/replay.d.ts +273 -0
  288. package/dist/replay.js +484 -0
  289. package/dist/replayPorts.js +4 -0
  290. package/dist/replayRecording.js +66 -0
  291. package/dist/replaySchema.js +156 -0
  292. package/dist/replayStorage.d.ts +149 -0
  293. package/dist/replayStorage.js +484 -0
  294. package/dist/reservationBatch.js +421 -0
  295. package/dist/reservationSchemas.js +16 -0
  296. package/dist/reservations.js +258 -0
  297. package/dist/reservePort.js +68 -0
  298. package/dist/resolvedOptions.js +3 -0
  299. package/dist/room.d.ts +1006 -0
  300. package/dist/room.js +283 -0
  301. package/dist/roomAccessSweep.js +94 -0
  302. package/dist/roomAppCommandControl.js +58 -0
  303. package/dist/roomAuthoringStrategy.js +16 -0
  304. package/dist/roomErasure.js +197 -0
  305. package/dist/roomPoolRuntimeDefaults.js +23 -0
  306. package/dist/roomPoolSelection.js +18 -0
  307. package/dist/roomPoolTopology.js +211 -0
  308. package/dist/rpc.d.ts +551 -0
  309. package/dist/rpc.js +111 -0
  310. package/dist/rpcClient.js +151 -0
  311. package/dist/rpcRoutes.js +27 -0
  312. package/dist/runtime.js +1122 -0
  313. package/dist/schemaHistory.js +97 -0
  314. package/dist/seatStore.js +150 -0
  315. package/dist/seatStrategyFixtures.js +51 -0
  316. package/dist/seatSubject.js +31 -0
  317. package/dist/seats.js +129 -0
  318. package/dist/serverSession.js +810 -0
  319. package/dist/serverSessionConfig.js +42 -0
  320. package/dist/sessionAdmission.js +52 -0
  321. package/dist/sidecarAdmission.js +102 -0
  322. package/dist/sidecarConfig.js +115 -0
  323. package/dist/sidecarConfigPublication.js +63 -0
  324. package/dist/sidecarHostListener.js +207 -0
  325. package/dist/sidecarIpc.js +204 -0
  326. package/dist/sidecarPeer.js +309 -0
  327. package/dist/sidecarProcessPort.js +27 -0
  328. package/dist/sidecarRuntime.js +167 -0
  329. package/dist/sidecarSelection.js +141 -0
  330. package/dist/sidecarWire.js +177 -0
  331. package/dist/sidecarWrites.js +162 -0
  332. package/dist/simulation.d.ts +391 -0
  333. package/dist/simulation.js +281 -0
  334. package/dist/simulationAuthoring.js +28 -0
  335. package/dist/simulationBytes.js +26 -0
  336. package/dist/simulationConformance.js +304 -0
  337. package/dist/simulationInputHistoryCapture.js +34 -0
  338. package/dist/simulationInputHistoryWire.js +192 -0
  339. package/dist/simulationOptionsWire.js +77 -0
  340. package/dist/simulationRecoveryWire.js +133 -0
  341. package/dist/simulationReplay.js +126 -0
  342. package/dist/simulationSnapshotWire.js +111 -0
  343. package/dist/simulationState.js +177 -0
  344. package/dist/snapshotBlob.js +125 -0
  345. package/dist/snapshotBlobCleanup.js +92 -0
  346. package/dist/snapshotBlobIndex.js +37 -0
  347. package/dist/snapshotBudget.js +79 -0
  348. package/dist/snapshotChain.js +184 -0
  349. package/dist/snapshotErasure.js +171 -0
  350. package/dist/snapshotInspection.js +104 -0
  351. package/dist/snapshotSegmentBlobs.js +57 -0
  352. package/dist/snapshotUploads.js +165 -0
  353. package/dist/socketTransport.js +252 -0
  354. package/dist/spatial.js +103 -0
  355. package/dist/spectatorPolicy.js +25 -0
  356. package/dist/spectatorProducer.js +88 -0
  357. package/dist/startFailureCause.js +3 -0
  358. package/dist/stateCodec.js +657 -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 +181 -0
  364. package/dist/streamFraming.js +121 -0
  365. package/dist/streamTransport.js +265 -0
  366. package/dist/subjectAdmission.js +49 -0
  367. package/dist/subjectPrivacy.js +280 -0
  368. package/dist/subjectPrivacyBinding.js +89 -0
  369. package/dist/systemManifest.js +181 -0
  370. package/dist/tables.js +158 -0
  371. package/dist/testHarness.js +88 -0
  372. package/dist/testing.d.ts +3684 -0
  373. package/dist/testing.js +220 -0
  374. package/dist/testingPorts.js +270 -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 +216 -0
  379. package/dist/transform3d.js +117 -0
  380. package/dist/transformCollection.js +23 -0
  381. package/dist/transformCollection3d.js +23 -0
  382. package/dist/transformCollectionCore.js +155 -0
  383. package/dist/transformFrames.js +120 -0
  384. package/dist/transformPrediction3d.js +126 -0
  385. package/dist/transformRules.js +122 -0
  386. package/dist/transformSchemas.js +19 -0
  387. package/dist/transport.js +31 -0
  388. package/dist/transportAuthoring.js +28 -0
  389. package/dist/transportCleanup.js +21 -0
  390. package/dist/transportConformance.js +123 -0
  391. package/dist/transportConnector.js +81 -0
  392. package/dist/transportEndpoints.js +37 -0
  393. package/dist/transportsServer.d.ts +5515 -0
  394. package/dist/transportsServer.js +6 -0
  395. package/dist/viewProjection.js +15 -0
  396. package/dist/web.d.ts +2286 -0
  397. package/dist/web.js +517 -0
  398. package/dist/webTransportClient.js +172 -0
  399. package/dist/wire.d.ts +992 -0
  400. package/dist/wire.js +491 -0
  401. package/dist/withdrawalPort.js +27 -0
  402. package/dist/world.d.ts +1894 -0
  403. package/dist/world.js +332 -0
  404. package/dist/worldActorReceipts.js +47 -0
  405. package/dist/worldActorTransferSnapshot.js +13 -0
  406. package/dist/worldAdmissionPending.js +7 -0
  407. package/dist/worldBoundaryCoordinator.js +147 -0
  408. package/dist/worldCatalog.js +80 -0
  409. package/dist/worldCellAllocation.js +202 -0
  410. package/dist/worldCellDestination.js +67 -0
  411. package/dist/worldCells.js +488 -0
  412. package/dist/worldChange.js +31 -0
  413. package/dist/worldClient.js +663 -0
  414. package/dist/worldClientControl.js +140 -0
  415. package/dist/worldClientPendingInput.js +15 -0
  416. package/dist/worldClientRpc.js +132 -0
  417. package/dist/worldClientRpcRoutes.js +42 -0
  418. package/dist/worldClientSchemas.js +27 -0
  419. package/dist/worldCommands.js +139 -0
  420. package/dist/worldData.js +41 -0
  421. package/dist/worldDefaultBinding.js +376 -0
  422. package/dist/worldDefaultGroupAdmission.js +81 -0
  423. package/dist/worldDefaultGroupAppServices.js +30 -0
  424. package/dist/worldDefaultGroupCompensation.js +108 -0
  425. package/dist/worldDefaultGroupContinuation.js +95 -0
  426. package/dist/worldDefaultGroupControl.js +71 -0
  427. package/dist/worldDefaultGroupMembers.js +84 -0
  428. package/dist/worldDefaultGroups.js +20 -0
  429. package/dist/worldDefaultPending.js +78 -0
  430. package/dist/worldDefaultService.js +244 -0
  431. package/dist/worldEntities.js +2979 -0
  432. package/dist/worldEntityCodec.js +20 -0
  433. package/dist/worldEntityHandoffView.js +153 -0
  434. package/dist/worldGeometry.js +169 -0
  435. package/dist/worldGhostAdmission.js +64 -0
  436. package/dist/worldGhostDestination.js +117 -0
  437. package/dist/worldGhostGateway.js +131 -0
  438. package/dist/worldGhostHandshake.js +107 -0
  439. package/dist/worldGhostHost.js +41 -0
  440. package/dist/worldGhostIngress.js +131 -0
  441. package/dist/worldGhostNeighborhood.js +69 -0
  442. package/dist/worldGhostNeighbors.js +85 -0
  443. package/dist/worldGhostOutbound.js +109 -0
  444. package/dist/worldGhostPublisher.js +215 -0
  445. package/dist/worldGhostReceiver.js +212 -0
  446. package/dist/worldGhostSender.js +145 -0
  447. package/dist/worldGhostSocket.js +77 -0
  448. package/dist/worldGhostWire.js +171 -0
  449. package/dist/worldGroupCommand.js +48 -0
  450. package/dist/worldGroupDeadline.js +114 -0
  451. package/dist/worldGroupPreparation.js +114 -0
  452. package/dist/worldGroupReadyControl.js +127 -0
  453. package/dist/worldGroupSupervisor.js +119 -0
  454. package/dist/worldHandoffMetrics.js +58 -0
  455. package/dist/worldHandoffView.js +99 -0
  456. package/dist/worldHostSource.js +68 -0
  457. package/dist/worldInspectEndpoint.js +249 -0
  458. package/dist/worldInspection.js +108 -0
  459. package/dist/worldInstanceAdmission.js +30 -0
  460. package/dist/worldInstanceAllocation.js +115 -0
  461. package/dist/worldInstanceDestination.js +63 -0
  462. package/dist/worldInstanceExpiry.js +281 -0
  463. package/dist/worldInstanceExpirySupervisor.js +87 -0
  464. package/dist/worldInstanceLifecycle.js +102 -0
  465. package/dist/worldInstanceState.js +51 -0
  466. package/dist/worldInstances.js +477 -0
  467. package/dist/worldJoin.js +55 -0
  468. package/dist/worldLayers.js +150 -0
  469. package/dist/worldLeases.js +77 -0
  470. package/dist/worldManifest.js +24 -0
  471. package/dist/worldMovement.js +62 -0
  472. package/dist/worldPersistence.js +133 -0
  473. package/dist/worldProjection.js +220 -0
  474. package/dist/worldReact.js +109 -0
  475. package/dist/worldRecoveryActor.js +34 -0
  476. package/dist/worldReturnAnchor.js +48 -0
  477. package/dist/worldRoomHooks.js +56 -0
  478. package/dist/worldRoomPool.js +26 -0
  479. package/dist/worldRoomSteps.js +132 -0
  480. package/dist/worldSeatBinding.js +35 -0
  481. package/dist/worldServer.d.ts +6936 -0
  482. package/dist/worldServer.js +48 -0
  483. package/dist/worldSourceSeatPending.js +8 -0
  484. package/dist/worldStrategyFixtures.js +163 -0
  485. package/dist/worldTesting.js +26 -0
  486. package/dist/worldTransitionDefaults.js +197 -0
  487. package/dist/worldTransitionExecutor.js +518 -0
  488. package/dist/worldTransitionGroup.js +112 -0
  489. package/dist/worldTransitionPhysicalSteps.js +39 -0
  490. package/dist/worldTransitionResolver.js +227 -0
  491. package/dist/worldTransitionSeatGroup.js +63 -0
  492. package/dist/worldTransitionSeats.js +259 -0
  493. package/dist/worldTransitionState.js +94 -0
  494. package/dist/worldTransitions.js +100 -0
  495. package/package.json +189 -4
@@ -0,0 +1,46 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { captureSimulationBytes as n } from "./simulationBytes.js";
3
+ import { geometryOwnData as r } from "./geometryTileCodec.js";
4
+ import { captureGeometryReceipt as i } from "./geometryPersistenceData.js";
5
+ import { decodeGeometryPatch as a } from "./geometryPatch.js";
6
+ import { assertGeometryJournalPatchReceipt as o } from "./geometryJournalArchiveData.js";
7
+ import { Effect as s } from "effect";
8
+ // src/geometryJournalPatch.ts
9
+ var c = (c = {}) => {
10
+ let l = r(c, ["archive", "maxPatchBytes"], []), u = Object.hasOwn(l, "maxPatchBytes") ? l.maxPatchBytes : 262144;
11
+ if (typeof u != "number" || !Number.isSafeInteger(u) || u < 512 || u > 16777216) throw new t({ detail: "Geometry journal patch budget refused" });
12
+ let d = Object.hasOwn(l, "archive") ? r(l.archive, [
13
+ "archive",
14
+ "load",
15
+ "exportSubject",
16
+ "eraseSubject"
17
+ ]) : void 0;
18
+ if (d && Object.values(d).some((e) => typeof e != "function")) throw new t({ detail: "Geometry journal reader requires the actual complete archive index" });
19
+ let f = d ? d.load.bind(l.archive) : null, p = {
20
+ maxBytes: u,
21
+ maxMetadataBytes: Math.min(4096, u - 16)
22
+ };
23
+ return (r) => {
24
+ let c, l;
25
+ try {
26
+ c = i(r.receipt), l = n(r.patch, u, "geometryJournalPatchBytes");
27
+ } catch (n) {
28
+ return s.fail(n instanceof e ? n : new t({ detail: "Geometry journal patch could not be captured" }));
29
+ }
30
+ let d = (e) => {
31
+ let t = n(e, u, "geometryJournalPatchBytes");
32
+ return o(c, a(t, p).metadata), t;
33
+ };
34
+ return l.length ? s.try({
35
+ try: () => d(l),
36
+ catch: (n) => n instanceof e ? n : new t({ detail: "Inline geometry journal patch refused" })
37
+ }) : f ? s.uninterruptible(s.suspend(() => {
38
+ let n = f(c.scope, c.requestId);
39
+ return s.isEffect(n) ? n.pipe(s.flatMap((n) => s.try({
40
+ try: () => d(n),
41
+ catch: (n) => n instanceof e ? n : new t({ detail: "Archived geometry journal patch refused" })
42
+ }))) : s.fail(new t({ detail: "Archive patch reader requires its actual Effect" }));
43
+ })).pipe(s.catchCause(() => s.fail(new t({ detail: "Indexed native geometry journal bytes remain unavailable" })))) : s.fail(new t({ detail: "Indexed geometry journal bytes require their explicit archive source" }));
44
+ };
45
+ };
46
+ export { c as makeGeometryJournalPatchReader };
@@ -0,0 +1,111 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { geometryOwnData as n } from "./geometryTileCodec.js";
3
+ import { captureGeometryPersistenceScope as r, captureGeometryReceipt as i, geometryPersistenceId as a, geometryPersistenceInteger as o } from "./geometryPersistenceData.js";
4
+ import { captureRoomSnapshotEffectRunner as s } from "./snapshotBlobIndex.js";
5
+ import { geometryPersistenceDigest as c, geometryPersistenceScopeKey as l } from "./geometryPersistenceCapture.js";
6
+ import { GEO_JOURNAL_TABLE as u } from "./geometryPersistence.js";
7
+ import { and as d, eq as f, gt as p, lt as m, neq as h } from "@voltro/database";
8
+ import { Context as g, Effect as _, Layer as v } from "effect";
9
+ // src/geometryJournalRetention.ts
10
+ var y = Object.freeze({ eligible: (e) => e.createdAtMs < e.cutoffMs }), b = class extends g.Service()("@voltro/GeometryJournalRetentionPort") {}, x = () => new t({ detail: "Geometry journal retention page remains unconfirmed" }), S = (e) => v.succeed(b, e), C = (t, g) => {
11
+ let v = n(g, [
12
+ "compaction",
13
+ "epochNow",
14
+ "authorize",
15
+ "keepInlineMs",
16
+ "pageSize",
17
+ "maxMetadataBytes",
18
+ "strategies"
19
+ ], [
20
+ "compaction",
21
+ "epochNow",
22
+ "authorize"
23
+ ]), b = n(v.compaction, ["compact"]), S = v.epochNow, C = v.authorize, w = Object.hasOwn(v, "keepInlineMs") ? o(v.keepInlineMs, 0, 31536e7) : 2592e6, T = Object.hasOwn(v, "pageSize") ? o(v.pageSize, 1, 256) : 32, E = Object.hasOwn(v, "maxMetadataBytes") ? o(v.maxMetadataBytes, 512, 16777216) : 262144, D = n(Object.hasOwn(v, "strategies") ? v.strategies : {}, ["eligible"], []), O = Object.hasOwn(D, "eligible") ? D.eligible : y.eligible;
24
+ if (typeof b.compact != "function" || typeof S != "function" || typeof C != "function" || typeof O != "function") throw x();
25
+ let k = b.compact.bind(v.compaction), A = S, j = C, M = O;
26
+ return Object.freeze({ run: (g) => {
27
+ let v, y;
28
+ try {
29
+ let e = n(g, ["scope", "after"], ["scope"]);
30
+ v = r(e.scope), y = Object.hasOwn(e, "after") && e.after !== null ? a(e.after) : null;
31
+ } catch {
32
+ return _.fail(x());
33
+ }
34
+ return _.flatMap(_.context(), (n) => _.uninterruptible(_.tryPromise({
35
+ try: async () => {
36
+ let r = s(n), g = async (e) => {
37
+ if (!_.isEffect(e)) throw x();
38
+ return r(e);
39
+ }, b = Math.max(0, o(A(), 0, 864e13) - w);
40
+ if (await g(j(v, b)) !== void 0) throw x();
41
+ let S = await t.query({
42
+ table: u,
43
+ predicate: d(f("tenantId", v.tenantId), f("scopeKey", l(v)), m("createdAt", new Date(b)), h("patch", /* @__PURE__ */ new Uint8Array()), ...y === null ? [] : [p("id", y)]),
44
+ order: [{
45
+ column: "id",
46
+ direction: "asc"
47
+ }],
48
+ take: T + 1,
49
+ skip: void 0,
50
+ projection: [
51
+ "id",
52
+ "tenantId",
53
+ "scopeKey",
54
+ "requestKey",
55
+ "receipt",
56
+ "createdAt"
57
+ ]
58
+ });
59
+ if (S.length > T + 1) throw x();
60
+ for (let e = 0; e < S.length; e++) {
61
+ let t = S[e], n = i(t.receipt), r = a(t.id);
62
+ if (t.tenantId !== v.tenantId || t.scopeKey !== l(v) || JSON.stringify(n.scope) !== JSON.stringify(v) || t.requestKey !== c(JSON.stringify([v.tenantId, n.requestId])) || y !== null && r <= y || e > 0 && r <= a(S[e - 1].id)) throw x();
63
+ }
64
+ let C = 0, D = S.slice(0, T).map((t, n) => {
65
+ let r = i(t.receipt), o = a(t.id), s = t.createdAt instanceof Date ? t.createdAt.getTime() : typeof t.createdAt == "string" ? Date.parse(t.createdAt) : NaN;
66
+ if (!Number.isSafeInteger(s) || s < 0 || s >= b || t.tenantId !== v.tenantId || t.scopeKey !== l(v) || JSON.stringify(r.scope) !== JSON.stringify(v) || t.requestKey !== c(JSON.stringify([v.tenantId, r.requestId])) || y !== null && o <= y || n > 0 && o <= a(S[n - 1].id)) throw x();
67
+ if (C += new TextEncoder().encode(JSON.stringify({
68
+ rowId: o,
69
+ receipt: r,
70
+ createdAtMs: s
71
+ })).length, C > E) throw new e({
72
+ budget: "geometryJournalRetentionMetadataBytes",
73
+ limit: E
74
+ });
75
+ let u = M(Object.freeze({
76
+ createdAtMs: s,
77
+ cutoffMs: b
78
+ }));
79
+ if (typeof u != "boolean") throw x();
80
+ return {
81
+ id: o,
82
+ receipt: r,
83
+ eligible: u
84
+ };
85
+ }), O = 0, N = 0, P = 0;
86
+ for (let e of D) {
87
+ if (!e.eligible) {
88
+ P++;
89
+ continue;
90
+ }
91
+ if (await g(j(v, b)) !== void 0) throw x();
92
+ let t = await g(k(v, e.receipt.requestId));
93
+ if (typeof t != "boolean") throw x();
94
+ t ? O++ : N++;
95
+ }
96
+ if (await g(j(v, b)) !== void 0) throw x();
97
+ return Object.freeze({
98
+ scope: v,
99
+ cutoffMs: b,
100
+ selected: D.length,
101
+ compacted: O,
102
+ alreadyArchived: N,
103
+ skipped: P,
104
+ nextAfter: S.length > T ? D.at(-1)?.id ?? null : null
105
+ });
106
+ },
107
+ catch: (t) => t instanceof e ? t : x()
108
+ })));
109
+ } });
110
+ };
111
+ export { b as GeometryJournalRetentionPort, C as dataStoreGeometryJournalRetention, y as defaultGeometryJournalRetentionStrategies, S as geometryJournalRetentionLayer };
@@ -0,0 +1,35 @@
1
+ import { Schema as e } from "effect";
2
+ // src/geometryJournalRetentionSchemas.ts
3
+ var t = e.Struct({
4
+ runKey: e.NonEmptyString.pipe(e.check(e.isMaxLength(191))),
5
+ maxPages: e.Int.pipe(e.check(e.isBetween({
6
+ minimum: 1,
7
+ maximum: 4096
8
+ })))
9
+ }), n = e.Struct({
10
+ scopes: e.Int.pipe(e.check(e.isBetween({
11
+ minimum: 0,
12
+ maximum: 4096
13
+ }))),
14
+ pages: e.Int.pipe(e.check(e.isBetween({
15
+ minimum: 0,
16
+ maximum: 4096
17
+ }))),
18
+ selected: e.Int.pipe(e.check(e.isBetween({
19
+ minimum: 0,
20
+ maximum: 1048576
21
+ }))),
22
+ compacted: e.Int.pipe(e.check(e.isBetween({
23
+ minimum: 0,
24
+ maximum: 1048576
25
+ }))),
26
+ alreadyArchived: e.Int.pipe(e.check(e.isBetween({
27
+ minimum: 0,
28
+ maximum: 1048576
29
+ }))),
30
+ skipped: e.Int.pipe(e.check(e.isBetween({
31
+ minimum: 0,
32
+ maximum: 1048576
33
+ })))
34
+ });
35
+ export { t as GeometryJournalRetentionWorkflowPayload, n as GeometryJournalRetentionWorkflowResult };
@@ -0,0 +1,111 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { geometryOwnData as n } from "./geometryTileCodec.js";
3
+ import { captureGeometryPersistenceScope as r, geometryPersistenceId as i, geometryPersistenceInteger as a } from "./geometryPersistenceData.js";
4
+ import { captureWorldCatalog as o } from "./world.js";
5
+ import { captureRoomSnapshotEffectRunner as s } from "./snapshotBlobIndex.js";
6
+ import { geometryPersistenceScopeKey as c } from "./geometryPersistenceCapture.js";
7
+ import { GEO_CHUNK_DELTAS_TABLE as l } from "./geometryPersistence.js";
8
+ import { captureGeometryJournalRetentionPayload as u, captureGeometryJournalRetentionResult as d } from "./geometryJournalRetentionWorkflowData.js";
9
+ import { Context as f, Effect as p, Layer as m } from "effect";
10
+ // src/geometryJournalRetentionSweep.ts
11
+ var h = class extends f.Service()("@voltro/GeometryJournalRetentionSweepPort") {}, g = () => new t({ detail: "Geometry journal retention sweep remains unconfirmed" }), _ = (e) => m.succeed(h, e), v = (t, f) => {
12
+ let m = n(f, [
13
+ "worlds",
14
+ "retention",
15
+ "authorize",
16
+ "maxScopes",
17
+ "maxMetadataBytes"
18
+ ], [
19
+ "worlds",
20
+ "retention",
21
+ "authorize"
22
+ ]), h = o(m.worlds), _ = n(m.retention, ["run"]), v = Object.hasOwn(m, "maxScopes") ? a(m.maxScopes, 1, 4096) : 256, y = Object.hasOwn(m, "maxMetadataBytes") ? a(m.maxMetadataBytes, 512, 16777216) : 262144;
23
+ if (typeof _.run != "function" || typeof m.authorize != "function" || !h.some((e) => e.geometry)) throw g();
24
+ let b = _.run.bind(m.retention), x = m.authorize;
25
+ return Object.freeze({ run: (o) => {
26
+ let f;
27
+ try {
28
+ f = u(o);
29
+ } catch {
30
+ return p.fail(g());
31
+ }
32
+ return p.flatMap(p.context(), (o) => p.uninterruptible(p.tryPromise({
33
+ try: async () => {
34
+ let u = s(o), m = async (e) => {
35
+ if (!p.isEffect(e)) throw g();
36
+ return u(e);
37
+ }, _ = async () => {
38
+ if (await m(x(f)) !== void 0) throw g();
39
+ };
40
+ await _();
41
+ let S = await t.query({
42
+ table: l,
43
+ predicate: void 0,
44
+ order: [{
45
+ column: "id",
46
+ direction: "asc"
47
+ }],
48
+ take: v + 1,
49
+ skip: void 0,
50
+ projection: [
51
+ "id",
52
+ "tenantId",
53
+ "scopeKey",
54
+ "scope"
55
+ ]
56
+ });
57
+ if (S.length > v) throw new e({
58
+ budget: "geometryJournalRetentionScopes",
59
+ limit: v
60
+ });
61
+ let C = 0, w = "", T = /* @__PURE__ */ new Set(), E = S.map((t) => {
62
+ let n = r(t.scope), a = i(t.id), o = c(n), s = h.find((e) => e.name === n.worldId);
63
+ if (a <= w || t.tenantId !== n.tenantId || t.scopeKey !== o || T.has(o) || !s?.geometry) throw g();
64
+ if (w = a, T.add(o), C += new TextEncoder().encode(JSON.stringify({
65
+ rowId: a,
66
+ key: o,
67
+ scope: n
68
+ })).length, C > y) throw new e({
69
+ budget: "geometryJournalRetentionScopeBytes",
70
+ limit: y
71
+ });
72
+ return n;
73
+ }), D = 0, O = 0, k = 0, A = 0, j = 0;
74
+ for (let t of E) {
75
+ let o = null;
76
+ do {
77
+ if (D >= f.maxPages) throw new e({
78
+ budget: "geometryJournalRetentionWorkflowPages",
79
+ limit: f.maxPages
80
+ });
81
+ await _();
82
+ let s = await m(b(Object.freeze({
83
+ scope: t,
84
+ ...o === null ? {} : { after: o }
85
+ }))), c = n(s, [
86
+ "scope",
87
+ "cutoffMs",
88
+ "selected",
89
+ "compacted",
90
+ "alreadyArchived",
91
+ "skipped",
92
+ "nextAfter"
93
+ ]), l = r(c.scope), u = a(c.selected, 0, 256), d = a(c.compacted, 0, 256), p = a(c.alreadyArchived, 0, 256), h = a(c.skipped, 0, 256), v = c.nextAfter === null ? null : i(c.nextAfter);
94
+ if (a(c.cutoffMs, 0, 864e13), JSON.stringify(l) !== JSON.stringify(t) || d + p + h !== u || v !== null && (u === 0 || o !== null && v <= o)) throw g();
95
+ D++, O += u, k += d, A += p, j += h, o = v;
96
+ } while (o !== null);
97
+ }
98
+ return await _(), d({
99
+ scopes: E.length,
100
+ pages: D,
101
+ selected: O,
102
+ compacted: k,
103
+ alreadyArchived: A,
104
+ skipped: j
105
+ });
106
+ },
107
+ catch: (t) => t instanceof e ? t : g()
108
+ })));
109
+ } });
110
+ };
111
+ export { h as GeometryJournalRetentionSweepPort, v as dataStoreGeometryJournalRetentionSweep, _ as geometryJournalRetentionSweepLayer };
@@ -0,0 +1,27 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { GeometryJournalRetentionWorkflowResult as n } from "./geometryJournalRetentionSchemas.js";
3
+ import { captureGeometryJournalRetentionPayload as r, captureGeometryJournalRetentionResult as i } from "./geometryJournalRetentionWorkflowData.js";
4
+ import { GeometryJournalRetentionSweepPort as a } from "./geometryJournalRetentionSweep.js";
5
+ import { Effect as o, Schema as s } from "effect";
6
+ import { step as c } from "@voltro/workflow";
7
+ // src/geometryJournalRetentionWorkflow.ts
8
+ var l = (l) => o.gen(function* () {
9
+ let u = yield* o.try({
10
+ try: () => r(l),
11
+ catch: () => new t({ detail: "Geometry retention workflow payload refused" })
12
+ }), d = yield* a;
13
+ return yield* c({
14
+ name: "compact-geometry-journal-bodies",
15
+ input: u,
16
+ success: n,
17
+ error: s.Union([t, e]),
18
+ execute: o.uninterruptible(o.suspend(() => {
19
+ let e = d.run(u);
20
+ return o.isEffect(e) ? e : o.fail(new t({ detail: "Geometry retention needs its actual sweep Effect" }));
21
+ })).pipe(o.flatMap((e) => o.try({
22
+ try: () => i(e),
23
+ catch: () => new t({ detail: "Geometry retention workflow result refused" })
24
+ })))
25
+ });
26
+ });
27
+ export { l as geometryJournalRetentionWorkflowExecutor };
@@ -0,0 +1,30 @@
1
+ import { ProtocolError as e } from "./errors.js";
2
+ import { geometryOwnData as t } from "./geometryTileCodec.js";
3
+ import { geometryPersistenceId as n, geometryPersistenceInteger as r } from "./geometryPersistenceData.js";
4
+ // src/geometryJournalRetentionWorkflowData.ts
5
+ var i = (e) => {
6
+ let i = t(e, ["runKey", "maxPages"]);
7
+ return Object.freeze({
8
+ runKey: n(i.runKey),
9
+ maxPages: r(i.maxPages, 1, 4096)
10
+ });
11
+ }, a = (n) => {
12
+ let i = t(n, [
13
+ "scopes",
14
+ "pages",
15
+ "selected",
16
+ "compacted",
17
+ "alreadyArchived",
18
+ "skipped"
19
+ ]), a = r(i.scopes, 0, 4096), o = r(i.pages, 0, 4096), s = r(i.selected, 0, 1048576), c = r(i.compacted, 0, 1048576), l = r(i.alreadyArchived, 0, 1048576), u = r(i.skipped, 0, 1048576);
20
+ if (c + l + u !== s || o < a || o === 0 && s !== 0) throw new e({ detail: "Geometry retention result cannot confirm its counts" });
21
+ return Object.freeze({
22
+ scopes: a,
23
+ pages: o,
24
+ selected: s,
25
+ compacted: c,
26
+ alreadyArchived: l,
27
+ skipped: u
28
+ });
29
+ };
30
+ export { i as captureGeometryJournalRetentionPayload, a as captureGeometryJournalRetentionResult };
@@ -0,0 +1,147 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { captureSimulationBytes as n } from "./simulationBytes.js";
3
+ import { geometryOwnData as r } from "./geometryTileCodec.js";
4
+ import { geometrySha256 as i } from "./geometryDigest.js";
5
+ import { captureGeometryReceipt as a, geometryPersistenceId as o, geometryPersistenceInteger as s } from "./geometryPersistenceData.js";
6
+ import { decodeGeometryPatch as c } from "./geometryPatch.js";
7
+ import { assertGeometryJournalPatchReceipt as l, captureGeometryJournalArchiveReference as u } from "./geometryJournalArchiveData.js";
8
+ import { captureRoomSnapshotEffectRunner as d } from "./snapshotBlobIndex.js";
9
+ import { geometryPersistenceDigest as f, geometryPersistenceScopeKey as p } from "./geometryPersistenceCapture.js";
10
+ import { Context as m, Effect as h, Layer as g, Stream as _ } from "effect";
11
+ // src/geometryJournalStorage.ts
12
+ var v = class extends m.Service()("@voltro/GeometryJournalArchivePort") {}, y = (e) => g.succeed(v, e), b = () => new t({ detail: "Geometry journal Storage archive remains unconfirmed" }), x = (e, t) => {
13
+ if (!e || typeof e != "object") throw b();
14
+ let n = Object.getOwnPropertyDescriptor(e, t);
15
+ if (!n?.enumerable || !("value" in n) || typeof n.value != "function") throw b();
16
+ return n.value.bind(e);
17
+ }, S = (t, m) => {
18
+ let g = r(m, [
19
+ "bucket",
20
+ "metadata",
21
+ "destination",
22
+ "maxPatchBytes",
23
+ "maxBodyParts",
24
+ "authorize"
25
+ ], [
26
+ "bucket",
27
+ "metadata",
28
+ "authorize"
29
+ ]), v = o(g.bucket), y = Object.hasOwn(g, "destination") ? o(g.destination) : void 0, S = Object.hasOwn(g, "maxPatchBytes") ? s(g.maxPatchBytes, 512, 16777216) : 262144, C = Object.hasOwn(g, "maxBodyParts") ? s(g.maxBodyParts, 1, 1048576) : 4096, w = x(t, "put"), T = x(t, "head"), E = x(t, "getStream"), D = x(t, "delete"), O = x(g.metadata, "lookup"), k = g.authorize;
30
+ if (typeof k != "function") throw b();
31
+ let A = k, j = {
32
+ maxBytes: S,
33
+ maxMetadataBytes: Math.min(4096, S - 16)
34
+ }, M = (e) => "geometry:journal:" + f(JSON.stringify(e)), N = (e) => "geometry:journal:" + f(JSON.stringify([p(e.receipt.scope), e.receipt.requestId])), P = (e) => ({
35
+ tenantId: e.receipt.scope.tenantId,
36
+ bucket: v,
37
+ operationId: M(e)
38
+ }), F = (e, t, n) => {
39
+ if (!e || n !== void 0 && e.id !== n || e.tenantId !== t.receipt.scope.tenantId || e.bucket !== v || e.checksum !== t.patchSha256 || e.size !== t.size || e.visibility !== "private" || e.contentType !== "application/octet-stream") throw b();
40
+ return o(e.id), e;
41
+ }, I = async (e, t) => {
42
+ if (!h.isEffect(t)) throw b();
43
+ return e(t);
44
+ }, L = (t) => h.flatMap(h.context(), (n) => h.uninterruptible(h.tryPromise({
45
+ try: () => t(d(n)),
46
+ catch: (t) => t instanceof e ? t : b()
47
+ }))), R = async (e, t, n) => {
48
+ if (await I(e, A(t, n)) !== void 0) throw b();
49
+ }, z = (t) => {
50
+ let n = u(t);
51
+ if (n.size > S) throw new e({
52
+ budget: "geometryJournalArchivePatchBytes",
53
+ limit: S
54
+ });
55
+ return n;
56
+ };
57
+ return Object.freeze({
58
+ store: (t, r) => {
59
+ let o, s;
60
+ try {
61
+ o = a(t), s = n(r, S, "geometryJournalArchivePatchBytes"), l(o, c(s, j).metadata);
62
+ } catch (t) {
63
+ return h.fail(t instanceof e ? t : b());
64
+ }
65
+ return L(async (e) => {
66
+ let t = z({
67
+ receipt: o,
68
+ patchSha256: await i(s),
69
+ size: s.length
70
+ });
71
+ await R(e, "store", t);
72
+ let n = F(await I(e, w({
73
+ tenantId: o.scope.tenantId,
74
+ bytes: new Uint8Array(s),
75
+ contentType: "application/octet-stream",
76
+ visibility: "private",
77
+ operationId: M(t),
78
+ claim: N(t),
79
+ key: "geometry/journal/" + f(JSON.stringify(t)),
80
+ ...y === void 0 ? {} : { destination: y }
81
+ })), t), r = await O(P(t), N(t));
82
+ if (!r || r.state !== "ready" || !r.held || F(r.ref, t, n.id).size !== s.length) throw b();
83
+ return await R(e, "store", t), t;
84
+ });
85
+ },
86
+ load: (t) => {
87
+ let n;
88
+ try {
89
+ n = z(t);
90
+ } catch (t) {
91
+ return h.fail(t instanceof e ? t : b());
92
+ }
93
+ return L(async (t) => {
94
+ await R(t, "load", n);
95
+ let r = await O(P(n), N(n));
96
+ if (!r || r.state !== "ready" || !r.held) throw b();
97
+ let a = F(r.ref, n);
98
+ F(await I(t, T(a.id, { tenantId: n.receipt.scope.tenantId })), n, a.id);
99
+ let o = await I(t, E(a.id, { tenantId: n.receipt.scope.tenantId }));
100
+ F(o.ref, n, a.id);
101
+ let s = new Uint8Array(n.size), u = 0, d = 0;
102
+ if (await I(t, _.runForEach(o.stream, (t) => h.sync(() => {
103
+ if (++d > C) throw new e({
104
+ budget: "geometryJournalArchiveBodyParts",
105
+ limit: C
106
+ });
107
+ if (!(t instanceof Uint8Array) || t.buffer instanceof SharedArrayBuffer || t.length > s.length - u) throw b();
108
+ s.set(t, u), u += t.length;
109
+ }))), u !== s.length || await i(s) !== n.patchSha256) throw b();
110
+ l(n.receipt, c(s, j).metadata);
111
+ let f = await O(P(n), N(n));
112
+ if (!f || f.state !== "ready" || !f.held) throw b();
113
+ return F(f.ref, n, a.id), await R(t, "load", n), s;
114
+ });
115
+ },
116
+ release: (t) => {
117
+ let n;
118
+ try {
119
+ n = z(t);
120
+ } catch (t) {
121
+ return h.fail(t instanceof e ? t : b());
122
+ }
123
+ return L(async (e) => {
124
+ await R(e, "release", n);
125
+ let t = await O(P(n), N(n));
126
+ if (!t) {
127
+ await R(e, "release", n);
128
+ return;
129
+ }
130
+ if (t.state === "reserved") throw b();
131
+ let r = F(t.ref, n);
132
+ if (t.state === "deleted" || t.state === "ready" && !t.held) {
133
+ await R(e, "release", n);
134
+ return;
135
+ }
136
+ if (await I(e, D(r.id, {
137
+ tenantId: n.receipt.scope.tenantId,
138
+ claim: N(n)
139
+ })) !== void 0) throw b();
140
+ let i = await O(P(n), N(n));
141
+ if (!i || i.state !== "deleted" && i.state !== "ready" || i.held) throw b();
142
+ F(i.ref, n, r.id), await R(e, "release", n);
143
+ });
144
+ }
145
+ });
146
+ };
147
+ export { v as GeometryJournalArchivePort, y as geometryJournalArchiveLayer, S as storageGeometryJournal };
@@ -0,0 +1,117 @@
1
+ import { BudgetExceeded as e, ProtocolError as t } from "./errors.js";
2
+ import { geometryOwnData as n } from "./geometryTileCodec.js";
3
+ import { captureGeometryArtifact as r } from "./geometryArtifacts.js";
4
+ import { assertGeometryArtifactScope as i, captureGeometryCodecProfiles as a, captureGeometryDense as o, geometryPersistenceInteger as s, geometryPersistenceRefusal as c } from "./geometryPersistenceData.js";
5
+ import { captureGeometryDerivationStrategies as l } from "./geometryDerivationStrategies.js";
6
+ import { captureGeometryPreparedCoordinate as u, captureGeometryPreparedScope as d, prepareGeometryInventory as f } from "./geometryPrepared.js";
7
+ import { geometryChunkHasWorldExtent as p } from "./geometryWorldExtent.js";
8
+ import { captureWorldCatalog as m } from "./world.js";
9
+ import { captureRoomSnapshotEffectRunner as h } from "./snapshotBlobIndex.js";
10
+ import { GeometryPersistencePort as g } from "./geometryPersistencePorts.js";
11
+ import { Effect as _ } from "effect";
12
+ // src/geometryLoader.ts
13
+ var v = (v, y, b, x = {}) => {
14
+ try {
15
+ let S = m([v])[0], C = S.geometry, w = d(y);
16
+ if (!C || w.worldId !== S.name || w.kind !== C.kind) return _.fail(new t({ detail: "Geometry load needs the exact declared World kind" }));
17
+ let T = n(x, [
18
+ "maxChunks",
19
+ "maxAccountedBytes",
20
+ "codecLimits",
21
+ "maxConcurrent",
22
+ "strategies",
23
+ "navEnabled"
24
+ ], []), E = Object.hasOwn(T, "maxChunks") ? s(T.maxChunks, 1, C.budgets.maxPreparedChunks) : C.budgets.maxPreparedChunks, D = Object.hasOwn(T, "maxAccountedBytes") ? s(T.maxAccountedBytes, 512, C.budgets.maxPreparedBytes) : C.budgets.maxPreparedBytes, O = Object.hasOwn(T, "maxConcurrent") ? s(T.maxConcurrent, 1, Math.min(64, E)) : Math.min(4, E), k = Object.hasOwn(T, "codecLimits") ? a(T.codecLimits) : null, A = Object.hasOwn(T, "strategies") ? n(T.strategies, ["collisionDerive", "navDerive"], []) : {}, j = l({
25
+ collisionDerive: C.strategies.collisionDerive,
26
+ navDerive: C.strategies.navDerive,
27
+ ...A
28
+ }), M = C.nav.derive === "grid", N = Object.freeze({
29
+ strategies: j,
30
+ navEnabled: M,
31
+ maxChunks: E,
32
+ maxAccountedBytes: D,
33
+ ...k === null ? {} : { codecLimits: Object.freeze(Object.fromEntries(k)) }
34
+ }), P = o(b, E, (e) => u(w, e)), F = /* @__PURE__ */ new Set();
35
+ if (!P.length || Object.hasOwn(T, "navEnabled") && T.navEnabled !== M) return c();
36
+ for (let e of P) {
37
+ let t = JSON.stringify([
38
+ e.cx,
39
+ e.cy,
40
+ e.cz ?? null
41
+ ]);
42
+ if (F.has(t)) return c();
43
+ F.add(t);
44
+ }
45
+ return _.flatMap(g, (a) => _.flatMap(_.context(), (o) => _.uninterruptible(_.tryPromise({
46
+ try: async () => {
47
+ let e = n(a, [
48
+ "publish",
49
+ "observe",
50
+ "commit",
51
+ "exportSubject",
52
+ "eraseSubject"
53
+ ], ["observe"]).observe;
54
+ if (typeof e != "function") return c();
55
+ let t = e, l = h(o), m = Array(P.length), g = 0, v = !1, y, b = async () => {
56
+ for (; !v && g < P.length;) {
57
+ let e = g++, a = P[e];
58
+ try {
59
+ let o = t(a);
60
+ if (!_.isEffect(o)) return c();
61
+ let f = await l(o), h = n(f, [
62
+ "scope",
63
+ "revision",
64
+ "artifact"
65
+ ]), g = u(w, {
66
+ cx: a.cx,
67
+ cy: a.cy,
68
+ ...a.cz === void 0 ? {} : { cz: a.cz }
69
+ }), v = n(h.scope, [
70
+ "tenantId",
71
+ "kind",
72
+ "worldId",
73
+ "version",
74
+ "layerSetId",
75
+ "cx",
76
+ "cy",
77
+ "cz"
78
+ ], [
79
+ "tenantId",
80
+ "kind",
81
+ "worldId",
82
+ "version",
83
+ "layerSetId",
84
+ "cx",
85
+ "cy"
86
+ ]), y = r(h.artifact), b = d({
87
+ tenantId: v.tenantId,
88
+ kind: v.kind,
89
+ worldId: v.worldId,
90
+ layerSetId: v.layerSetId,
91
+ version: v.version
92
+ }), x = u(b, {
93
+ cx: v.cx,
94
+ cy: v.cy,
95
+ ...Object.hasOwn(v, "cz") ? { cz: v.cz } : {}
96
+ });
97
+ if (JSON.stringify(x) !== JSON.stringify(g) || !p(y, C.chunkSizeRaw)) return c();
98
+ i(y, g), m[e] = Object.freeze({
99
+ scope: g,
100
+ revision: s(h.revision),
101
+ artifact: y
102
+ });
103
+ } catch (e) {
104
+ v || (v = !0, y = e);
105
+ }
106
+ }
107
+ };
108
+ if (await Promise.all(Array.from({ length: Math.min(O, P.length) }, () => b())), v) throw y;
109
+ return f(w, m, N);
110
+ },
111
+ catch: (n) => n instanceof e ? n : new t({ detail: "Complete World geometry preparation remains unconfirmed" })
112
+ }))));
113
+ } catch {
114
+ return _.fail(new t({ detail: "World geometry load configuration could not be captured" }));
115
+ }
116
+ };
117
+ export { v as loadPreparedWorldGeometry };