@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,2766 @@
1
+ import { Context } from 'effect';
2
+ import { DataStore } from '@voltro/database';
3
+ import { Duration } from 'effect';
4
+ import { Effect } from 'effect';
5
+ import { HotError } from '@voltro/kv/hot/contract';
6
+ import { HotStoreShape } from '@voltro/kv/hot/contract';
7
+ import { Layer } from 'effect';
8
+ import { Option as Option_2 } from 'effect';
9
+ import { PluginBindContext } from '@voltro/protocol';
10
+ import { PluginHttpRoute } from '@voltro/protocol';
11
+ import { PluginHttpRouteRequest } from '@voltro/protocol';
12
+ import { PluginPrivacyHookContext } from '@voltro/protocol';
13
+ import { Row } from '@voltro/database';
14
+ import { Schema } from 'effect';
15
+ import { StorageObjectMetadata } from '@voltro/plugin-storage';
16
+ import { StorageServiceShape } from '@voltro/plugin-storage';
17
+ import { Subject } from '@voltro/protocol';
18
+ import { TableLike } from '@voltro/database';
19
+ import { VoltroPlugin } from '@voltro/protocol';
20
+ import { WorkflowEngine } from 'effect/workflow/WorkflowEngine';
21
+ import { WorkflowInstance } from 'effect/workflow/WorkflowEngine';
22
+ import { YieldableError } from 'effect/Cause';
23
+
24
+ /** Configuration consumers never invoke a player callback. Its player type
25
+ * stays author-owned; this inventory type does not erase it into an input. */
26
+ declare type AnyWorldDescriptor = WorldDescriptor<never>;
27
+
28
+ export declare interface AppStorageGeometry extends GeometryStorage {
29
+ /** Chunk URLs for players from the same Storage (`sqlRoomsGeometry({ reads })` with
30
+ * `roomsPlugin({ geometryReadUrls: true })`). Needs `visibility: 'public'`: a private object is readable by its
31
+ * owner only. Borrowed at the first grant, like `source`. */
32
+ readonly readGrants: (options: Omit<GeometryStorageReadGrantOptions, 'bucket' | 'metadata' | 'visibility'>) => GeometryStorageReadGrants;
33
+ }
34
+
35
+ /** Static geometry bytes in the app's own Storage plugin, on the API and on every Rooms Host (the CLI Host binds
36
+ * the app's Storage when a World declares geometry). The Storage is borrowed at first use, after binding; a
37
+ * Storage that is missing, ambiguous or unbound fails that operation. Use a provider both processes share
38
+ * (`database`, `filesystem`, S3/MinIO/Azure); memory Storage is private to one process. */
39
+ export declare const appStorageGeometry: (plugins: ReadonlyArray<VoltroPlugin>, options: Omit<GeometryStorageOptions, "bucket" | "metadata">) => AppStorageGeometry;
40
+
41
+ /** Registry and tenant HotStore are borrowed from the ordinary plugin context.
42
+ * A degraded read policy cannot grant a lease. The app owns connections/lifetime. */
43
+ export declare const bindGeometryChunkLeases: (context: Pick<PluginBindContext, "connectionRegistry" | "hotStore">, options: GeometryChunkLeaseOptions) => Promise<GeometryChunkLeases>;
44
+
45
+ /** Borrow the actual existing registry and tenant HotStore accessor. No private
46
+ * Redis/client/fallback/pool/timer is created and no connections are closed. */
47
+ export declare const bindRoomGeometryReloadSource: (context: Pick<PluginBindContext, "connectionRegistry" | "hotStore">, offered: BoundRoomGeometryReloadSourceOptions) => Context.Service.Shape<typeof RoomGeometryReloadPort>;
48
+
49
+ /** Ordinary connection registry and tenant HotStore port only. Missing registry
50
+ * refuses before acquisition. No private Redis pool/read fallback/owned connection. */
51
+ export declare const bindRoomGeometryRollbackSource: (context: Pick<PluginBindContext, "connectionRegistry" | "hotStore">, offered: BoundRoomGeometryRollbackSourceOptions) => Context.Service.Shape<typeof RoomGeometryRollbackPort>;
52
+
53
+ export declare interface BoundRoomGeometryReloadSourceOptions extends Omit<RoomGeometryReloadSourceOptions, 'leases'> {
54
+ readonly namespace: string;
55
+ readonly ttlMs: number;
56
+ }
57
+
58
+ export declare interface BoundRoomGeometryRollbackSourceOptions extends Omit<RoomGeometryRollbackSourceOptions, 'leases'> {
59
+ readonly namespace: string;
60
+ readonly ttlMs: number;
61
+ }
62
+
63
+ declare class BudgetExceeded extends BudgetExceeded_base {
64
+ get message(): string;
65
+ }
66
+
67
+ declare const BudgetExceeded_base: Schema.Class<BudgetExceeded, Schema.TaggedStruct<"BudgetExceeded", {
68
+ readonly budget: Schema.String;
69
+ readonly limit: Schema.Number;
70
+ }>, YieldableError>;
71
+
72
+ export declare const captureGeometryMigrationReceipt: (offered: unknown) => GeometryMigrationReceipt;
73
+
74
+ export declare const captureGeometryMigrationRequest: (offered: unknown) => GeometryMigrationRequest;
75
+
76
+ export declare const captureGeometryStreamManifest: (offered: unknown, maximumChunks?: number, maximumBytes?: number) => GeometryStreamManifest;
77
+
78
+ export declare const captureRoomGeometryReloadPort: (offered: Context.Service.Shape<typeof RoomGeometryReloadPort>) => Context.Service.Shape<typeof RoomGeometryReloadPort>;
79
+
80
+ export declare const captureRoomGeometryReloadRequest: (offered: RoomGeometryReloadRequest) => RoomGeometryReloadRequest;
81
+
82
+ export declare const captureRoomGeometryRollbackPort: (offered: Context.Service.Shape<typeof RoomGeometryRollbackPort>) => Context.Service.Shape<typeof RoomGeometryRollbackPort>;
83
+
84
+ export declare const captureRoomGeometryRollbackRequest: (offered: RoomGeometryRollbackRequest) => RoomGeometryRollbackRequest;
85
+
86
+ declare type CollisionBody2D = {
87
+ readonly kind: 'circle';
88
+ readonly radius: number;
89
+ } | {
90
+ readonly kind: 'aabb';
91
+ readonly halfWidth: number;
92
+ readonly halfHeight: number;
93
+ };
94
+
95
+ declare interface CollisionResult2D {
96
+ readonly transform: Transform2D;
97
+ readonly collided: ReadonlyArray<string>;
98
+ readonly iterations: number;
99
+ }
100
+
101
+ /** Borrow the original SQL/Control services; no pool, Host allocation, retry,
102
+ * Room/World selection from caller state or Tick access. Actual owner is read
103
+ * again around the authenticated Host operation; these are SQL observations. */
104
+ export declare const dataStoreGeometryAdministration: (store: DataStore, offered: GeometryAdministrationOptions) => Context.Service.Shape<typeof RoomGeometryAdministrationPort>;
105
+
106
+ /** Actual immutable geometry SQL receipt -> native private Storage -> durable
107
+ * SQL index. Unknown index reply rechecks the same row/reference and actual S2.
108
+ * This source never removes inline patches or admission receipts. */
109
+ export declare const dataStoreGeometryJournalArchiveIndex: (store: DataStore, offered: GeometryJournalArchiveIndexOptions) => Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>;
110
+
111
+ /** Actual private S2 store/index/read verification precedes one actual SQL
112
+ * receipt-index transaction. Only the large inline body changes tier; no
113
+ * receipt/scope/owner/Subject/request digest/revision/hash is deleted or changed.
114
+ * Retention eligibility and accepted-reader/writer lifetime are current policy. */
115
+ export declare const dataStoreGeometryJournalCompaction: (store: DataStore, offered: GeometryJournalCompactionOptions) => Context.Service.Shape<typeof GeometryJournalCompactionPort>;
116
+
117
+ /** Explicit bounded awaited retention page, suitable for the normal workflow
118
+ * owner. No timer, private pool, partition deletion or receipt expiry invented.
119
+ * Only current eligible full bodies invoke actual confirmed compaction. */
120
+ export declare const dataStoreGeometryJournalRetention: (store: DataStore, offered: GeometryJournalRetentionOptions) => Context.Service.Shape<typeof GeometryJournalRetentionPort>;
121
+
122
+ /** Bounded complete SQL scope inventory before mutation. Excess inventory fails
123
+ * instead of endlessly revisiting the first page. Current net deltas and all
124
+ * admission receipts remain untouched. No timer, pool or actor work is owned. */
125
+ export declare const dataStoreGeometryJournalRetentionSweep: (store: DataStore, offered: GeometryJournalRetentionSweepOptions) => Context.Service.Shape<typeof GeometryJournalRetentionSweepPort>;
126
+
127
+ /** Same borrowed SQL tables/source; no new truth, pool, mutation or Tick read.
128
+ * At most one exact indexed dirty-row query per admitted static reference. */
129
+ export declare const dataStoreGeometryManifest: (store: DataStore, offered: GeometryManifestStoreOptions) => Context.Service.Shape<typeof GeometryManifestPort>;
130
+
131
+ /** Borrowed SQL transaction owner only. Caller still owns CPU writer quiescence,
132
+ * current chunk leases, physical actor reload/client transition and complete
133
+ * Subject-content redaction across inherited versions. No Tick/Hot fallback. */
134
+ export declare const dataStoreGeometryMigrations: (store: DataStore, offeredWorlds: ReadonlyArray<AnyWorldDescriptor>, offered: GeometryMigrationStoreOptions) => Context.Service.Shape<typeof GeometryVersionMigrationPort>;
135
+
136
+ /** Real DataStore transactions, no SQL dialect branch/private pool/HotStore or Tick installation.
137
+ * External immutable blob loading and hashing precede SQL CAS. A confirmed receipt survives a later revision. */
138
+ export declare const dataStoreGeometryPersistence: (store: DataStore, offered: GeometryPersistenceStoreOptions) => Context.Service.Shape<typeof GeometryPersistencePort>;
139
+
140
+ /** Actual SQL journal and immutable baseline source. No new table, pool or
141
+ * automatic module. Retains every idempotency receipt. Output is preparation;
142
+ * original HotStore coordination and native CAS/CPU admission are separate. */
143
+ export declare const dataStoreGeometryRollbackPreparation: (store: DataStore, offered: GeometryRollbackStoreOptions) => Context.Service.Shape<typeof GeometryRollbackPreparationPort>;
144
+
145
+ /** Borrow the registered SQL/persistence services. Own only native Room CPU
146
+ * inventory. No listener, pool, worker or invented placement/version default. */
147
+ export declare const dataStoreRoomHostGeometry: (store: DataStore, offered: RoomGeometryDirectoryBindingOptions) => RoomHostGeometryBinding;
148
+
149
+ export declare const defaultGeometryJournalRetentionStrategies: Readonly<GeometryJournalRetentionStrategies>;
150
+
151
+ /** One exported default, shared by World declaration and actual preparation. */
152
+ export declare const defaultGeometryMigrateDelta: GeometryMigrateDelta;
153
+
154
+ /** Exact reduced integer ratio over admitted coordinates/differences of magnitude <= u32.
155
+ * Shared 2D/3D slab arithmetic; never round a fraction before comparing it. */
156
+ declare interface FixedSlabFraction {
157
+ readonly numerator: number;
158
+ readonly denominator: number;
159
+ }
160
+
161
+ export declare const GEO_CHUNK_DELTAS_TABLE = "_voltro_geo_chunk_deltas";
162
+
163
+ export declare const GEO_JOURNAL_ARCHIVES_TABLE = "_voltro_geo_journal_archives";
164
+
165
+ export declare const GEO_JOURNAL_TABLE = "_voltro_geo_journal";
166
+
167
+ export declare const GEO_MIGRATIONS_TABLE = "_voltro_geo_migrations";
168
+
169
+ export declare const GEO_VERSIONS_TABLE = "_voltro_geo_versions";
170
+
171
+ declare interface GeometryActivation {
172
+ readonly _tag: 'GeometryActivation';
173
+ readonly receipt: GeometryPersistenceReceipt;
174
+ }
175
+
176
+ export declare interface GeometryActivationOptions {
177
+ readonly maxPatchBytes?: number | undefined;
178
+ }
179
+
180
+ declare interface GeometryActorInventory {
181
+ at(coordinate: GeometryPreparedCoordinate): GeometryPreparedEntry;
182
+ contains(coordinate: GeometryPreparedCoordinate): boolean;
183
+ /** CPU pointer activation only; a stale before-frame refuses, exact repeat is false. */
184
+ activate(activation: GeometryActivation): boolean;
185
+ /** CPU-only whole-version swap after genuine outside-Tick SQL preparation. */
186
+ activateVersion(activation: GeometryVersionActivation): boolean;
187
+ observation(): GeometryActorInventoryObservation;
188
+ close(): void;
189
+ }
190
+
191
+ declare interface GeometryActorInventoryObservation {
192
+ readonly scope: GeometryPreparedScope;
193
+ readonly generation: number;
194
+ readonly chunks: number;
195
+ readonly accountedBytes: number;
196
+ readonly closed: boolean;
197
+ }
198
+
199
+ export declare interface GeometryAdministrationOptions {
200
+ readonly control: Context.Service.Shape<typeof RoomGeometryControlPort>;
201
+ /** Actual current app scope/room/target policy; descriptor guards are additional. `request` is
202
+ * `null` for the read-only `'chunks'` view. */
203
+ readonly authorize: (operation: 'reload' | 'rollback' | 'chunks', roomId: string, request: RoomGeometryReloadRequest | RoomGeometryRollbackRequest | null, subject: Subject) => Effect.Effect<void, GeometryPersistenceError>;
204
+ /** The app's Worlds: with them the administration also serves the chunk view (`chunks`). */
205
+ readonly worlds?: ReadonlyArray<AnyWorldDescriptor>;
206
+ /** Changed chunks the view returns per Room (default 256). */
207
+ readonly maxChunks?: number;
208
+ /** Delta rows the view reads per call (default 4096); `truncated` reports when there were more. */
209
+ readonly maxScannedChunks?: number;
210
+ }
211
+
212
+ declare interface GeometryArtifact<C extends GeometryChunk = GeometryChunk> {
213
+ readonly chunk: C;
214
+ readonly blobSha256: string;
215
+ /** Canonical declared content/layout, excluding actual address/version only. */
216
+ readonly contentSha256: string;
217
+ bytes(): Uint8Array;
218
+ }
219
+
220
+ declare type GeometryArtifactLimits<K extends GeometryKind> = K extends '2d-tiles' ? Partial<GeometryTileLimits> : K extends '2d-heightfield' ? Partial<GeometryHeightfieldLimits> : K extends '3d-shapes' ? Partial<GeometryShapesLimits> : Partial<GeometryVoxelLimits>;
221
+
222
+ export declare interface GeometryArtifactPublication {
223
+ readonly tenantId: string;
224
+ readonly version: string;
225
+ readonly artifacts: ReadonlyArray<GeometryArtifact>;
226
+ }
227
+
228
+ export declare interface GeometryArtifactPublicationOptions {
229
+ readonly maxChunks?: number | undefined;
230
+ readonly maxArtifactBytes?: number;
231
+ readonly maxManifestBytes?: number;
232
+ readonly maxConcurrent?: number | undefined;
233
+ readonly codecLimits?: {
234
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
235
+ } | undefined;
236
+ }
237
+
238
+ declare interface GeometryAssetManifest extends GeometryAssetRoot {
239
+ readonly assets: ReadonlyArray<GeometryAssetReference>;
240
+ readonly manifestSha256: string;
241
+ }
242
+
243
+ export declare const geometryAssetManifestLayer: (service: Context.Service.Shape<typeof GeometryAssetManifestPort>) => Layer.Layer<GeometryAssetManifestPort>;
244
+
245
+ /** Actual published SQL/CMS catalogue; replacing it never replaces current
246
+ * Storage authorization or attests publication from a caller's digest. */
247
+ export declare class GeometryAssetManifestPort extends GeometryAssetManifestPort_base {
248
+ }
249
+
250
+ declare const GeometryAssetManifestPort_base: Context.ServiceClass<GeometryAssetManifestPort, "@voltro/GeometryAssetManifestPort", {
251
+ observe(root: GeometryAssetRoot): Effect.Effect<GeometryAssetManifest, GeometryPersistenceError>;
252
+ }>;
253
+
254
+ export declare interface GeometryAssetReadGrant {
255
+ readonly url: string;
256
+ readonly checksum: string;
257
+ readonly size: number;
258
+ readonly contentType: string;
259
+ }
260
+
261
+ export declare class GeometryAssetReadGrantPort extends GeometryAssetReadGrantPort_base {
262
+ }
263
+
264
+ declare const GeometryAssetReadGrantPort_base: Context.ServiceClass<GeometryAssetReadGrantPort, "@voltro/GeometryAssetReadGrantPort", {
265
+ grant(request: GeometryAssetReadRequest, subject: Subject): Effect.Effect<GeometryAssetReadGrant, GeometryPersistenceError>;
266
+ }>;
267
+
268
+ declare interface GeometryAssetReadRequest extends GeometryAssetRoot {
269
+ readonly key: string;
270
+ }
271
+
272
+ declare interface GeometryAssetReference {
273
+ readonly key: string;
274
+ readonly fileId: string;
275
+ readonly bucket: string;
276
+ readonly checksum: string;
277
+ readonly size: number;
278
+ readonly contentType: string;
279
+ }
280
+
281
+ declare interface GeometryAssetRoot {
282
+ readonly tenantId: string;
283
+ readonly worldId: string;
284
+ readonly layerSetId: string;
285
+ readonly version: string;
286
+ }
287
+
288
+ export declare interface GeometryAssetStorageGrantOptions {
289
+ readonly worlds: ReadonlyArray<AnyWorldDescriptor>;
290
+ readonly manifest: Context.Service.Shape<typeof GeometryAssetManifestPort>;
291
+ readonly origin: string;
292
+ readonly authorize: (request: GeometryAssetReadRequest, subject: Subject) => Effect.Effect<void, GeometryPersistenceError>;
293
+ readonly expiresInSec?: number;
294
+ readonly maxAssets?: number;
295
+ readonly maxManifestBytes?: number;
296
+ readonly maxAssetBytes?: number;
297
+ }
298
+
299
+ export declare interface GeometryAssetStorageGrants {
300
+ grant(request: GeometryAssetReadRequest, subject: Subject): Effect.Effect<GeometryAssetReadGrant, GeometryPersistenceError>;
301
+ }
302
+
303
+ declare interface GeometryBoxOverlapOptions {
304
+ readonly maxTests?: number;
305
+ }
306
+
307
+ declare interface GeometryCellChunk {
308
+ readonly coordinate: GeometryPreparedCoordinate;
309
+ readonly ownerCellId: string;
310
+ readonly writable: boolean;
311
+ }
312
+
313
+ declare interface GeometryCellCoverage {
314
+ readonly scope: GeometryPreparedScope;
315
+ readonly cell: WorldCell;
316
+ readonly marginChunks: number;
317
+ readonly chunks: ReadonlyArray<GeometryCellChunk>;
318
+ }
319
+
320
+ declare interface GeometryCellCoverageOptions {
321
+ readonly maxChunks?: number | undefined;
322
+ /** World topology is currently 2D; 3D representations require an explicit
323
+ * server-authored half-open vertical span in exact global Q16 raw units. */
324
+ readonly vertical?: {
325
+ readonly minimumRaw: number;
326
+ readonly maximumRaw: number;
327
+ };
328
+ }
329
+
330
+ declare type GeometryChunk = GeometryTileChunk | GeometryHeightfieldChunk | GeometryShapesChunk | GeometryVoxelChunk;
331
+
332
+ /** One net codec patch against static revision zero, plus the independent durable mutation revision. */
333
+ export declare const geometryChunkDeltasTable: TableLike;
334
+
335
+ export declare const geometryChunkHttpHeaders: Readonly<{
336
+ scope: "x-voltro-geometry-scope";
337
+ revision: "x-voltro-geometry-revision";
338
+ contentSha256: "x-voltro-geometry-content-sha256";
339
+ }>;
340
+
341
+ /** Full scoped caller -> locator query only. Tenant/kind are resolved server-side;
342
+ * neither this query nor its coordinates grant read rights. */
343
+ export declare const geometryChunkHttpQuery: (offered: GeometryPersistenceScope) => string;
344
+
345
+ export declare interface GeometryChunkHttpResponse {
346
+ readonly status: 200;
347
+ readonly headers: Readonly<Record<string, string>>;
348
+ readonly body: Uint8Array;
349
+ }
350
+
351
+ /** Actual authorized SQL/source observation -> native binary HTTP response.
352
+ * Helper installs no route/authorization/cache policy or second chunk/Delta
353
+ * format. Caller must select trusted scope and read rights before invoking. */
354
+ export declare const geometryChunkHttpResponse: (offered: GeometryPersistenceObservation, options?: {
355
+ readonly maxBytes?: number | undefined;
356
+ }) => GeometryChunkHttpResponse;
357
+
358
+ export declare type GeometryChunkLease = WorldTransitionLease;
359
+
360
+ export declare type GeometryChunkLeaseOptions = WorldTransitionLeaseOptions;
361
+
362
+ export declare interface GeometryChunkLeases {
363
+ readonly tenantId: string;
364
+ acquire(scope: GeometryPersistenceScope): Effect.Effect<Option_2.Option<GeometryChunkLease>, HotError | ProtocolError>;
365
+ }
366
+
367
+ declare interface GeometryChunkSnapshot {
368
+ readonly scope: GeometryPersistenceScope;
369
+ readonly requestId: string;
370
+ readonly revision: number;
371
+ readonly staticBlobSha256: string;
372
+ readonly staticContentSha256: string;
373
+ readonly blobSha256: string;
374
+ readonly contentSha256: string;
375
+ readonly patchSha256: string;
376
+ readonly patch: Uint8Array;
377
+ }
378
+
379
+ declare type GeometryCollisionDerive = (context: GeometryDerivationContext) => GeometryChunk;
380
+
381
+ export declare interface GeometryCommitCoordinator {
382
+ commit(input: GeometryPersistenceCommit): Effect.Effect<GeometryPersistenceReceipt, GeometryCommitCoordinatorError>;
383
+ observation(): GeometryCommitCoordinatorObservation;
384
+ /** Trusted local writer fence/join only. App privacy also owns actor/session withdrawal. */
385
+ withdrawSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
386
+ /** Confirm actual persistence-port erasure before discarding even unknown local SQL work. */
387
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
388
+ /** Await owned release. An unconfirmed SQL operation remains pending and refuses close until the same request is resolved. */
389
+ close(): Effect.Effect<void, GeometryCommitCoordinatorError>;
390
+ }
391
+
392
+ export declare type GeometryCommitCoordinatorError = ProtocolError | BudgetExceeded | HotError;
393
+
394
+ export declare interface GeometryCommitCoordinatorObservation {
395
+ readonly pending: number;
396
+ readonly pendingBytes: number;
397
+ readonly active: number;
398
+ readonly retainedReceipts: number;
399
+ readonly subjectFences: number;
400
+ readonly closing: boolean;
401
+ readonly closed: boolean;
402
+ }
403
+
404
+ export declare interface GeometryCommitCoordinatorOptions {
405
+ readonly tenantId: string;
406
+ readonly maxPending?: number | undefined;
407
+ readonly maxPatchBytes?: number | undefined;
408
+ readonly maxPendingBytes?: number | undefined;
409
+ readonly maxSubjectFences?: number;
410
+ }
411
+
412
+ declare type GeometryCompaction = (context: GeometryCompactionContext) => GeometryPatch;
413
+
414
+ /** Genuine immutable native artifacts only. Compaction preserves the current
415
+ * truth; it cannot authorize a different edit, owner, revision or SQL write. */
416
+ declare interface GeometryCompactionContext {
417
+ readonly static: GeometryArtifact;
418
+ readonly current: GeometryArtifact;
419
+ readonly limits: GeometryPatchLimits;
420
+ readonly codecLimits: GeometryArtifactLimits<GeometryKind>;
421
+ }
422
+
423
+ declare interface GeometryCompactionStrategies {
424
+ readonly compaction: GeometryCompaction;
425
+ }
426
+
427
+ export declare interface GeometryDeltaMigrationFrom {
428
+ readonly static: GeometryArtifact;
429
+ readonly current: GeometryArtifact;
430
+ readonly revision: number;
431
+ }
432
+
433
+ export declare interface GeometryDeltaMigrationTo {
434
+ readonly static: GeometryArtifact;
435
+ }
436
+
437
+ /** Outside-Tick native data only. No query callback, provider, actor, Store or
438
+ * authority capability is accepted as a derivation result. */
439
+ declare interface GeometryDerivationContext {
440
+ readonly chunk: GeometryChunk;
441
+ readonly codecLimits: GeometryArtifactLimits<GeometryKind>;
442
+ }
443
+
444
+ declare interface GeometryDerivationStrategies {
445
+ readonly collisionDerive: GeometryCollisionDerive;
446
+ readonly navDerive: GeometryNavDerive;
447
+ }
448
+
449
+ export declare interface GeometryDirtyChunkReference {
450
+ readonly scope: GeometryPersistenceScope;
451
+ readonly revision: number;
452
+ readonly blobSha256: string;
453
+ readonly contentSha256: string;
454
+ }
455
+
456
+ /** Trusted server snapshot. Never derive these rights, positions, budgets or
457
+ * catalogs from the intent body. App policy must recheck authority at commit. */
458
+ declare interface GeometryEditAuthority {
459
+ readonly dynamicEnabled: boolean;
460
+ readonly ownsChunk: boolean;
461
+ readonly canBuild: boolean;
462
+ readonly cooldownReady: boolean;
463
+ readonly remainingOps: number;
464
+ readonly maxReachRaw: number;
465
+ readonly maxHeightUnits: number;
466
+ readonly position: {
467
+ readonly xRaw: number;
468
+ readonly yRaw: number;
469
+ readonly zRaw: number;
470
+ };
471
+ readonly materials: ReadonlyArray<GeometryTileMaterial>;
472
+ readonly shapes: ReadonlyArray<GeometryShapeTemplate>;
473
+ }
474
+
475
+ declare interface GeometryEditContext {
476
+ readonly chunk: GeometryChunk;
477
+ readonly intent: GeometryEditIntent;
478
+ readonly authority: GeometryEditAuthority;
479
+ readonly placementId: string;
480
+ readonly codecLimits?: GeometryArtifactLimits<GeometryKind> | undefined;
481
+ }
482
+
483
+ export declare interface GeometryEditIngress {
484
+ /** Actual native channel receiver only. Captures memory without I/O. */
485
+ stage(actualSession: unknown, message: unknown): 'queued' | 'retained';
486
+ /** Outside-Tick subject lookup, native owner queue/SQL/CPU/publication. */
487
+ pump(): Effect.Effect<ReadonlyArray<GeometryPersistenceReceipt>, GeometryCommitCoordinatorError>;
488
+ /** Trusted local discard; attempted/uncertain SQL work cannot be removed. */
489
+ discardUnsubmitted(target: GeometryPrivacyTarget): Effect.Effect<boolean, GeometryCommitCoordinatorError>;
490
+ /** Local writer fence/join only; actual actor/reader quiescence remains external. */
491
+ withdrawSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
492
+ /** Forget matching memory only after the real owner/SQL/content erase confirms. */
493
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
494
+ /** Fence new identities synchronously before a Host shutdown drain. */
495
+ fence(): void;
496
+ close(): Effect.Effect<void, GeometryCommitCoordinatorError>;
497
+ observation(): {
498
+ readonly pending: number;
499
+ readonly active: boolean;
500
+ readonly closing: boolean;
501
+ readonly closed: boolean;
502
+ readonly subjectFences: number;
503
+ };
504
+ }
505
+
506
+ export declare interface GeometryEditIngressOptions {
507
+ readonly scope: GeometryPreparedScope;
508
+ readonly owner: GeometryPersistenceOwner;
509
+ /** Actual current server identity lookup. Session evidence does not attest
510
+ * user/guest kind, so the body and Seat claims cannot supply it. */
511
+ readonly resolveSubject: (scope: GeometryEditIngressSubjectScope) => Effect.Effect<GeometryPersistenceSubject, GeometryCommitCoordinatorError>;
512
+ readonly maxPending?: number | undefined;
513
+ readonly maxPerPump?: number;
514
+ readonly maxSubjectFences?: number;
515
+ }
516
+
517
+ export declare interface GeometryEditIngressSubjectScope {
518
+ readonly tenantId: string;
519
+ readonly roomId: string;
520
+ readonly epoch: number;
521
+ readonly sessionId: string;
522
+ readonly subjectId: string;
523
+ }
524
+
525
+ /** Player requests an action and its target, never solidity, shape dimensions,
526
+ * an authoritative player position, revision, owner, full chunk or Delta bytes. */
527
+ declare type GeometryEditIntent = {
528
+ readonly op: 'setTile';
529
+ readonly x: number;
530
+ readonly y: number;
531
+ readonly material: string;
532
+ } | {
533
+ readonly op: 'raiseHeight';
534
+ readonly x: number;
535
+ readonly y: number;
536
+ readonly units: number;
537
+ } | {
538
+ readonly op: 'setVoxel';
539
+ readonly x: number;
540
+ readonly y: number;
541
+ readonly z: number;
542
+ readonly material: string;
543
+ } | {
544
+ readonly op: 'placeShape';
545
+ readonly template: string;
546
+ readonly xRaw: number;
547
+ readonly yRaw: number;
548
+ readonly zRaw: number;
549
+ } | {
550
+ readonly op: 'removeShape';
551
+ readonly id: string;
552
+ };
553
+
554
+ declare interface GeometryEditStrategies {
555
+ /** Pure policy slot. Current native Session/SQL ownership and codec integrity cannot be overridden by this slot. */
556
+ readonly opValidator: (context: GeometryEditContext) => void;
557
+ /** Pure rule slot; returned chunk is admitted under the original identity/layout/profile. */
558
+ readonly applyOp: (context: GeometryEditContext) => GeometryChunk;
559
+ }
560
+
561
+ declare type GeometryGenerator = (context: GeometryProceduralContext) => GeometryChunk;
562
+
563
+ declare interface GeometryGridRayHit {
564
+ readonly kind: '2d-tiles' | '3d-voxel';
565
+ readonly scope: GeometryPersistenceScope;
566
+ readonly revision: number;
567
+ readonly cell: {
568
+ readonly x: number;
569
+ readonly y: number;
570
+ readonly z?: number;
571
+ };
572
+ /** Exact reduced infimum entry fraction on the offered segment, not a
573
+ * rounded contact point or a floating-point distance. */
574
+ readonly fraction: {
575
+ readonly numerator: number;
576
+ readonly denominator: number;
577
+ };
578
+ readonly visitedCells: number;
579
+ }
580
+
581
+ declare interface GeometryGridRayOptions {
582
+ readonly maxVisitedCells?: number;
583
+ }
584
+
585
+ declare interface GeometryGridSweepHit {
586
+ readonly kind: '2d-tiles' | '3d-voxel';
587
+ readonly scope: GeometryPersistenceScope;
588
+ readonly revision: number;
589
+ readonly cell: {
590
+ readonly x: number;
591
+ readonly y: number;
592
+ readonly z?: number;
593
+ };
594
+ /** Infimum/supremum of positive-volume overlap, clipped to [0,1]. Contact
595
+ * alone is not an overlap; fractions are exact reduced integer ratios. */
596
+ readonly entry: FixedSlabFraction;
597
+ readonly exit: FixedSlabFraction;
598
+ readonly initialOverlap: boolean;
599
+ readonly testedCells: number;
600
+ }
601
+
602
+ /** A half-open raw box `[min, max)` on all three axes; a heightfield box needs its z extent. */
603
+ declare interface GeometryHeightfieldBoxRaw {
604
+ readonly minXRaw: number;
605
+ readonly minYRaw: number;
606
+ readonly minZRaw: number;
607
+ readonly maxXRaw: number;
608
+ readonly maxYRaw: number;
609
+ readonly maxZRaw: number;
610
+ }
611
+
612
+ declare type GeometryHeightfieldChunk = (typeof GeometryHeightfieldChunkSchema)["Type"];
613
+
614
+ declare const GeometryHeightfieldChunkSchema: Schema.Struct<{
615
+ readonly kind: Schema.Literal<"2d-heightfield">;
616
+ readonly formatVersion: Schema.Literal<1>;
617
+ readonly address: Schema.Struct<{
618
+ readonly worldId: Schema.String;
619
+ readonly layerSetId: Schema.String;
620
+ readonly cx: Schema.Int;
621
+ readonly cy: Schema.Int;
622
+ }>;
623
+ readonly version: Schema.String;
624
+ readonly width: Schema.Int;
625
+ readonly height: Schema.Int;
626
+ readonly sampleSpacingRaw: Schema.Int;
627
+ readonly baseHeightRaw: Schema.Int;
628
+ readonly heightQuantumRaw: Schema.Int;
629
+ readonly heights: Schema.$Array<Schema.Int>;
630
+ }>;
631
+
632
+ declare interface GeometryHeightfieldLimits {
633
+ readonly maxSide: number;
634
+ readonly maxSamples: number;
635
+ readonly maxBytes: number;
636
+ }
637
+
638
+ declare interface GeometryHeightfieldRayHit {
639
+ readonly kind: '2d-heightfield';
640
+ readonly scope: GeometryPersistenceScope;
641
+ readonly revision: number;
642
+ /** The first point on the segment at or below the surface, in global raw units. */
643
+ readonly point: GeometryHeightfieldRayPoint;
644
+ /** Exact reduced position on the offered segment whose raw-grid point is `point`. */
645
+ readonly fraction: {
646
+ readonly numerator: number;
647
+ readonly denominator: number;
648
+ };
649
+ readonly visitedSamples: number;
650
+ }
651
+
652
+ declare interface GeometryHeightfieldRayPoint {
653
+ readonly xRaw: number;
654
+ readonly yRaw: number;
655
+ readonly zRaw: number;
656
+ }
657
+
658
+ declare interface GeometryHeightfieldSweepHit {
659
+ readonly kind: '2d-heightfield';
660
+ /** The first box position along the path that reaches under the surface, on the raw grid. */
661
+ readonly box: GeometryHeightfieldBoxRaw;
662
+ /** Exact reduced position of `box` on the path: raw steps along the longest axis over its length. */
663
+ readonly fraction: {
664
+ readonly numerator: number;
665
+ readonly denominator: number;
666
+ };
667
+ /** The start box already reaches under the surface (fraction 0). */
668
+ readonly initialOverlap: boolean;
669
+ /** Overlap evaluations used, coarse and refining together. */
670
+ readonly evaluations: number;
671
+ }
672
+
673
+ declare interface GeometryHeightfieldView {
674
+ readonly chunk: GeometryHeightfieldChunk;
675
+ heightAtSample(x: number, y: number): number;
676
+ heightAtRaw(xRaw: number, yRaw: number): number;
677
+ }
678
+
679
+ declare interface GeometryHeightRollbackContext {
680
+ readonly key: string;
681
+ readonly before: number;
682
+ readonly after: number;
683
+ readonly selected: number;
684
+ readonly target: boolean;
685
+ }
686
+
687
+ export declare interface GeometryImportedSourceRequest {
688
+ readonly tenantId: string;
689
+ readonly version: string;
690
+ /** Actual application root; no process cwd/default path is inferred. */
691
+ readonly appRoot: string;
692
+ }
693
+
694
+ export declare interface GeometryImportPublication {
695
+ /** Offline proposal only: a digest confirms no Storage claim or SQL publication. */
696
+ readonly manifest: GeometryVersionReceipt;
697
+ readonly artifacts: ReadonlyArray<GeometryArtifact>;
698
+ }
699
+
700
+ export declare interface GeometryImportPublicationOptions {
701
+ readonly maxChunks?: number | undefined;
702
+ readonly maxArtifactBytes?: number;
703
+ readonly maxManifestBytes?: number;
704
+ readonly codecLimits?: {
705
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
706
+ } | undefined;
707
+ }
708
+
709
+ export declare interface GeometryJournalArchiveExport {
710
+ readonly reference: GeometryJournalArchiveReference;
711
+ readonly patch: Uint8Array;
712
+ }
713
+
714
+ export declare const geometryJournalArchiveIndexLayer: (service: Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>) => Layer.Layer<GeometryJournalArchiveIndexPort>;
715
+
716
+ export declare interface GeometryJournalArchiveIndexOptions {
717
+ readonly archive: Context.Service.Shape<typeof GeometryJournalArchivePort>;
718
+ readonly epochNow: () => number;
719
+ readonly authorize: (operation: 'archive' | 'load' | 'export' | 'erase', scope: GeometryPersistenceScope | GeometryPrivacyTarget) => Effect.Effect<void, GeometryPersistenceError>;
720
+ /** Real app-owned accepted archive readers/writers must join before erasure. */
721
+ readonly quiesceSubject: (target: GeometryPrivacyTarget) => Effect.Effect<void, GeometryPersistenceError>;
722
+ readonly maxPatchBytes?: number | undefined;
723
+ readonly maxPrivacyRows?: number;
724
+ readonly maxPrivacyBytes?: number;
725
+ }
726
+
727
+ export declare class GeometryJournalArchiveIndexPort extends GeometryJournalArchiveIndexPort_base {
728
+ }
729
+
730
+ declare const GeometryJournalArchiveIndexPort_base: Context.ServiceClass<GeometryJournalArchiveIndexPort, "@voltro/GeometryJournalArchiveIndexPort", {
731
+ archive(scope: GeometryPersistenceScope, requestId: string): Effect.Effect<GeometryJournalArchiveReference, GeometryPersistenceError>;
732
+ load(scope: GeometryPersistenceScope, requestId: string): Effect.Effect<Uint8Array, GeometryPersistenceError>;
733
+ exportSubject(target: GeometryPrivacyTarget): Effect.Effect<ReadonlyArray<GeometryJournalArchiveExport>, GeometryPersistenceError>;
734
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryPersistenceError>;
735
+ }>;
736
+
737
+ export declare const geometryJournalArchiveIndexPrivacyHooks: (source: Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>) => Readonly<{
738
+ tables: readonly TableLike[];
739
+ onExport: (subjectId: string, context: PluginPrivacyHookContext) => Effect.Effect<readonly GeometryJournalArchiveExport[], GeometryPersistenceError, never>;
740
+ onErase: (subjectId: string, context: PluginPrivacyHookContext) => Effect.Effect<void, GeometryPersistenceError, never>;
741
+ }>;
742
+
743
+ export declare const geometryJournalArchiveLayer: (source: Context.Service.Shape<typeof GeometryJournalArchivePort>) => Layer.Layer<GeometryJournalArchivePort>;
744
+
745
+ export declare class GeometryJournalArchivePort extends GeometryJournalArchivePort_base {
746
+ }
747
+
748
+ declare const GeometryJournalArchivePort_base: Context.ServiceClass<GeometryJournalArchivePort, "@voltro/GeometryJournalArchivePort", {
749
+ store(receipt: GeometryPersistenceReceipt, patch: Uint8Array): Effect.Effect<GeometryJournalArchiveReference, GeometryPersistenceError>;
750
+ load(reference: GeometryJournalArchiveReference): Effect.Effect<Uint8Array, GeometryPersistenceError>;
751
+ release(reference: GeometryJournalArchiveReference): Effect.Effect<void, GeometryPersistenceError>;
752
+ }>;
753
+
754
+ declare interface GeometryJournalArchiveReference {
755
+ readonly receipt: GeometryPersistenceReceipt;
756
+ readonly patchSha256: string;
757
+ readonly size: number;
758
+ }
759
+
760
+ /** Durable S3 custody index for original GPD bytes in normal private S2 Storage.
761
+ * Separate from immutable SQL admission receipts; no payload is pruned here. */
762
+ export declare const geometryJournalArchivesTable: TableLike;
763
+
764
+ export declare const geometryJournalCompactionLayer: (source: Context.Service.Shape<typeof GeometryJournalCompactionPort>) => Layer.Layer<GeometryJournalCompactionPort>;
765
+
766
+ export declare interface GeometryJournalCompactionOptions {
767
+ readonly archive: Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>;
768
+ readonly authorize: (scope: GeometryPersistenceScope, requestId: string) => Effect.Effect<void, GeometryPersistenceError>;
769
+ readonly maxPatchBytes?: number | undefined;
770
+ }
771
+
772
+ export declare class GeometryJournalCompactionPort extends GeometryJournalCompactionPort_base {
773
+ }
774
+
775
+ declare const GeometryJournalCompactionPort_base: Context.ServiceClass<GeometryJournalCompactionPort, "@voltro/GeometryJournalCompactionPort", {
776
+ /** Current SQL receipt metadata remains immutable. true means this call moved
777
+ * its inline body to the already-confirmed indexed original private GPD. */
778
+ compact(scope: GeometryPersistenceScope, requestId: string): Effect.Effect<boolean, GeometryPersistenceError>;
779
+ }>;
780
+
781
+ export declare interface GeometryJournalPatchReaderOptions {
782
+ readonly archive?: Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>;
783
+ readonly maxPatchBytes?: number | undefined;
784
+ }
785
+
786
+ export declare interface GeometryJournalRetentionContext {
787
+ readonly createdAtMs: number;
788
+ readonly cutoffMs: number;
789
+ }
790
+
791
+ export declare const geometryJournalRetentionLayer: (source: Context.Service.Shape<typeof GeometryJournalRetentionPort>) => Layer.Layer<GeometryJournalRetentionPort>;
792
+
793
+ export declare interface GeometryJournalRetentionOptions {
794
+ readonly compaction: Context.Service.Shape<typeof GeometryJournalCompactionPort>;
795
+ readonly epochNow: () => number;
796
+ readonly authorize: (scope: GeometryPersistenceScope, cutoffMs: number) => Effect.Effect<void, GeometryPersistenceError>;
797
+ readonly keepInlineMs?: number;
798
+ readonly pageSize?: number;
799
+ readonly maxMetadataBytes?: number;
800
+ readonly strategies?: Partial<GeometryJournalRetentionStrategies> | undefined;
801
+ }
802
+
803
+ export declare interface GeometryJournalRetentionPage {
804
+ readonly scope: GeometryPersistenceScope;
805
+ readonly cutoffMs: number;
806
+ readonly selected: number;
807
+ readonly compacted: number;
808
+ readonly alreadyArchived: number;
809
+ readonly skipped: number;
810
+ readonly nextAfter: string | null;
811
+ }
812
+
813
+ export declare class GeometryJournalRetentionPort extends GeometryJournalRetentionPort_base {
814
+ }
815
+
816
+ declare const GeometryJournalRetentionPort_base: Context.ServiceClass<GeometryJournalRetentionPort, "@voltro/GeometryJournalRetentionPort", {
817
+ run(request: GeometryJournalRetentionRequest): Effect.Effect<GeometryJournalRetentionPage, GeometryPersistenceError>;
818
+ }>;
819
+
820
+ export declare interface GeometryJournalRetentionRequest {
821
+ readonly scope: GeometryPersistenceScope;
822
+ readonly after?: string | null;
823
+ }
824
+
825
+ export declare interface GeometryJournalRetentionStrategies {
826
+ readonly eligible: (context: GeometryJournalRetentionContext) => boolean;
827
+ }
828
+
829
+ export declare const geometryJournalRetentionSweepLayer: (source: Context.Service.Shape<typeof GeometryJournalRetentionSweepPort>) => Layer.Layer<GeometryJournalRetentionSweepPort>;
830
+
831
+ export declare interface GeometryJournalRetentionSweepOptions {
832
+ readonly worlds: ReadonlyArray<AnyWorldDescriptor>;
833
+ readonly retention: Context.Service.Shape<typeof GeometryJournalRetentionPort>;
834
+ /** App-wide SQL maintenance authority, required before inventory and every page. */
835
+ readonly authorize: (payload: GeometryJournalRetentionWorkflowPayload) => Effect.Effect<void, GeometryPersistenceError>;
836
+ readonly maxScopes?: number;
837
+ readonly maxMetadataBytes?: number;
838
+ }
839
+
840
+ export declare class GeometryJournalRetentionSweepPort extends GeometryJournalRetentionSweepPort_base {
841
+ }
842
+
843
+ declare const GeometryJournalRetentionSweepPort_base: Context.ServiceClass<GeometryJournalRetentionSweepPort, "@voltro/GeometryJournalRetentionSweepPort", {
844
+ run(payload: GeometryJournalRetentionWorkflowPayload): Effect.Effect<GeometryJournalRetentionWorkflowResult, GeometryPersistenceError>;
845
+ }>;
846
+
847
+ /** Ordinary durable activity journals confirmed results. A failed/unknown SQL
848
+ * sweep never fabricates aggregate progress; retry rereads authoritative SQL. */
849
+ export declare const geometryJournalRetentionWorkflowExecutor: (offered: GeometryJournalRetentionWorkflowPayload) => Effect.Effect<{
850
+ readonly scopes: number;
851
+ readonly pages: number;
852
+ readonly selected: number;
853
+ readonly compacted: number;
854
+ readonly alreadyArchived: number;
855
+ readonly skipped: number;
856
+ }, ProtocolError | BudgetExceeded, WorkflowEngine | WorkflowInstance | GeometryJournalRetentionSweepPort>;
857
+
858
+ /** Browser-safe workflow control/results; no patch, Subject or credentials. */
859
+ export declare const GeometryJournalRetentionWorkflowPayload: Schema.Struct<{
860
+ readonly runKey: Schema.NonEmptyString;
861
+ readonly maxPages: Schema.Int;
862
+ }>;
863
+
864
+ export declare type GeometryJournalRetentionWorkflowPayload = typeof GeometryJournalRetentionWorkflowPayload.Type;
865
+
866
+ export declare const GeometryJournalRetentionWorkflowResult: Schema.Struct<{
867
+ readonly scopes: Schema.Int;
868
+ readonly pages: Schema.Int;
869
+ readonly selected: Schema.Int;
870
+ readonly compacted: Schema.Int;
871
+ readonly alreadyArchived: Schema.Int;
872
+ readonly skipped: Schema.Int;
873
+ }>;
874
+
875
+ export declare type GeometryJournalRetentionWorkflowResult = typeof GeometryJournalRetentionWorkflowResult.Type;
876
+
877
+ export declare interface GeometryJournalStorageOptions {
878
+ readonly bucket: string;
879
+ readonly metadata: Pick<StorageObjectMetadata, 'lookup'>;
880
+ readonly destination?: string;
881
+ readonly maxPatchBytes?: number | undefined;
882
+ readonly maxBodyParts?: number;
883
+ /** Actual current SQL journal/retirement and tenant permissions. A native
884
+ * receipt/checksum/Storage reference alone grants no archive authority. */
885
+ readonly authorize: (operation: 'store' | 'load' | 'release', reference: GeometryJournalArchiveReference) => Effect.Effect<void, GeometryPersistenceError>;
886
+ }
887
+
888
+ /** Durable idempotency receipts are not an ephemeral optional audit log. No pruning of unresolved receipts. */
889
+ export declare const geometryJournalTable: TableLike;
890
+
891
+ declare type GeometryKind = GeometryChunk['kind'];
892
+
893
+ export declare const geometryManifestLayer: (service: Context.Service.Shape<typeof GeometryManifestPort>) => Layer.Layer<GeometryManifestPort>;
894
+
895
+ /** Outside-Tick actual source metadata. Scope/hash possession grants no rights. */
896
+ export declare class GeometryManifestPort extends GeometryManifestPort_base {
897
+ }
898
+
899
+ declare const GeometryManifestPort_base: Context.ServiceClass<GeometryManifestPort, "@voltro/GeometryManifestPort", {
900
+ observe(scope: GeometryPreparedScope): Effect.Effect<GeometryStreamManifest, GeometryPersistenceError>;
901
+ }>;
902
+
903
+ export declare interface GeometryManifestPublicationOptions {
904
+ readonly scope: GeometryPreparedScope;
905
+ readonly owner: GeometryPersistenceOwner;
906
+ readonly source: Context.Service.Shape<typeof GeometryManifestPort>;
907
+ readonly currentSessions: () => ReadonlyArray<unknown>;
908
+ readonly authorizeRecipient: (recipient: GeometryPublicationRecipient, scope: GeometryPreparedScope) => Effect.Effect<void, GeometryPersistenceError>;
909
+ readonly authorizeChunk: (recipient: GeometryPublicationRecipient, scope: GeometryPersistenceScope) => Effect.Effect<void, GeometryPersistenceError>;
910
+ readonly channel?: string | undefined;
911
+ readonly maxRecipients?: number;
912
+ readonly maxManifestChunks?: number | undefined;
913
+ readonly maxManifestBytes?: number;
914
+ readonly maxFragmentDeliveries?: number;
915
+ }
916
+
917
+ export declare interface GeometryManifestStoreOptions {
918
+ /** Actual server root/chunk read capabilities; outer player routing must also
919
+ * resolve current Subject and recipient visibility, not trust offered scope. */
920
+ readonly authorizeRoot: (scope: GeometryPreparedScope) => Effect.Effect<void, GeometryPersistenceError>;
921
+ readonly authorizeChunk: (scope: GeometryPersistenceScope) => Effect.Effect<void, GeometryPersistenceError>;
922
+ readonly maxManifestChunks?: number | undefined;
923
+ readonly maxManifestBytes?: number;
924
+ }
925
+
926
+ /** Pure native data rule only; no SQL, actor, journal, permission or Subject. */
927
+ export declare type GeometryMigrateDelta = (from: GeometryDeltaMigrationFrom, to: GeometryDeltaMigrationTo) => GeometryChunk | null;
928
+
929
+ /** Explicit schema/privacy contribution for composition by the actual Rooms
930
+ * provider. It neither installs a second plugin nor invents privacy mappings. */
931
+ export declare const geometryMigrationContribution: (offered: Context.Service.Shape<typeof GeometryVersionMigrationPort>) => Pick<VoltroPlugin, "extendSchema" | "subjectPrivacy" | "onErase" | "onExport">;
932
+
933
+ export declare interface GeometryMigrationReceipt {
934
+ readonly requestKey: string;
935
+ readonly inputSha256: string;
936
+ readonly from: GeometryPersistenceScope;
937
+ readonly to: GeometryPersistenceScope;
938
+ readonly fromRevision: number;
939
+ readonly revision: number;
940
+ readonly decision: 'kept' | 'discarded' | 'custom';
941
+ readonly staticChanged: boolean;
942
+ readonly fromManifestSha256: string;
943
+ readonly toManifestSha256: string;
944
+ readonly blobSha256: string;
945
+ readonly contentSha256: string;
946
+ }
947
+
948
+ export declare interface GeometryMigrationRequest {
949
+ readonly from: GeometryPersistenceScope;
950
+ readonly to: GeometryPersistenceScope;
951
+ readonly expectedRevision: number;
952
+ readonly owner: GeometryPersistenceOwner;
953
+ readonly requestId: string;
954
+ }
955
+
956
+ /** No Subject identity, native content/patch, owner, raw request or policy source.
957
+ * Durable metadata retains source/target links for cutover/rebuild/retention. */
958
+ export declare const geometryMigrationsTable: TableLike;
959
+
960
+ export declare interface GeometryMigrationStoreOptions {
961
+ readonly strategies?: GeometryVersionPreparationStrategies | undefined;
962
+ /** Actual app-owned lineage/privacy mapping, authorization and physical work.
963
+ * Required, durable and idempotent by target.requestId; coordinated callers may
964
+ * repeat after-fence work. No none-data assumption or successful fallback. */
965
+ readonly privacy: {
966
+ exportSubject(target: GeometryPrivacyTarget): Effect.Effect<ReadonlyArray<GeometryMigrationReceipt>, GeometryPersistenceError>;
967
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryPersistenceError>;
968
+ };
969
+ readonly maxPrivacyRows?: number;
970
+ readonly maxPrivacyBytes?: number;
971
+ readonly persistence: GeometrySnapshotPreparationOptions['persistence'];
972
+ readonly staticSource: GeometrySnapshotPreparationOptions['staticSource'];
973
+ /** Current trusted administrative operation, both scopes and owner. This is
974
+ * never installed as a player route or a successful default policy. */
975
+ readonly authorize: (request: GeometryMigrationRequest) => Effect.Effect<void, GeometryPersistenceError>;
976
+ readonly epochNow: () => number;
977
+ readonly maxManifestChunks?: number | undefined;
978
+ readonly maxManifestBytes?: number;
979
+ readonly maxPatchBytes?: number | undefined;
980
+ readonly maxAccountedBytes?: number;
981
+ }
982
+
983
+ declare type GeometryNavDerive = (context: GeometryDerivationContext) => GeometryTileChunk | null;
984
+
985
+ declare interface GeometryPatch {
986
+ readonly metadata: GeometryPatchMetadata;
987
+ bytes(): Uint8Array;
988
+ }
989
+
990
+ declare interface GeometryPatchLimits {
991
+ readonly maxBytes: number;
992
+ readonly maxMetadataBytes: number;
993
+ }
994
+
995
+ declare type GeometryPatchMetadata = (typeof GeometryPatchMetadataSchema)["Type"];
996
+
997
+ declare const GeometryPatchMetadataSchema: Schema.Struct<{
998
+ readonly kind: Schema.Literals<readonly ["2d-tiles", "2d-heightfield", "3d-shapes", "3d-voxel"]>;
999
+ readonly formatVersion: Schema.Literal<1>;
1000
+ readonly worldId: Schema.String;
1001
+ readonly layerSetId: Schema.String;
1002
+ readonly cx: Schema.Int;
1003
+ readonly cy: Schema.Int;
1004
+ readonly cz: Schema.optional<Schema.Int>;
1005
+ readonly version: Schema.String;
1006
+ readonly baseRevision: Schema.Int;
1007
+ readonly revision: Schema.Int;
1008
+ readonly baseBlobSha256: Schema.String;
1009
+ readonly blobSha256: Schema.String;
1010
+ readonly baseContentSha256: Schema.String;
1011
+ readonly contentSha256: Schema.String;
1012
+ readonly changed: Schema.Boolean;
1013
+ readonly stateSchemaHash: Schema.Int;
1014
+ }>;
1015
+
1016
+ export declare interface GeometryPersistenceCommit {
1017
+ readonly scope: GeometryPersistenceScope;
1018
+ readonly owner: GeometryPersistenceOwner;
1019
+ readonly subject: GeometryPersistenceSubject;
1020
+ readonly requestId: string;
1021
+ readonly patch: Uint8Array;
1022
+ /** Server-owned genuine RoomServerSession only; never accepted from a wire payload. */
1023
+ readonly actualSession?: unknown;
1024
+ }
1025
+
1026
+ export declare type GeometryPersistenceError = ProtocolError | BudgetExceeded;
1027
+
1028
+ /** The same Tag is used for a real SQL service or an explicit application/test replacement. */
1029
+ export declare const geometryPersistenceLayer: (service: Context.Service.Shape<typeof GeometryPersistencePort>) => Layer.Layer<GeometryPersistencePort>;
1030
+
1031
+ export declare interface GeometryPersistenceObservation {
1032
+ readonly scope: GeometryPersistenceScope;
1033
+ readonly revision: number;
1034
+ readonly artifact: GeometryArtifact;
1035
+ }
1036
+
1037
+ export declare type GeometryPersistenceOperation = 'publish' | 'observe' | 'commit' | 'export' | 'erase';
1038
+
1039
+ export declare interface GeometryPersistenceOwner {
1040
+ readonly roomId: string;
1041
+ readonly hostId: string;
1042
+ readonly epoch: number;
1043
+ }
1044
+
1045
+ /** Outside-Tick trusted service. A commit receipt confirms SQL only, not delivery or actor activation. */
1046
+ export declare class GeometryPersistencePort extends GeometryPersistencePort_base {
1047
+ }
1048
+
1049
+ declare const GeometryPersistencePort_base: Context.ServiceClass<GeometryPersistencePort, "@voltro/GeometryPersistencePort", {
1050
+ publish(input: GeometryVersionPublication): Effect.Effect<GeometryVersionReceipt, GeometryPersistenceError>;
1051
+ observe(scope: GeometryPersistenceScope): Effect.Effect<GeometryPersistenceObservation, GeometryPersistenceError>;
1052
+ commit(input: GeometryPersistenceCommit): Effect.Effect<GeometryPersistenceReceipt, GeometryPersistenceError>;
1053
+ exportSubject(target: GeometryPrivacyTarget): Effect.Effect<ReadonlyArray<GeometrySubjectOperation>, GeometryPersistenceError>;
1054
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryPersistenceError>;
1055
+ }>;
1056
+
1057
+ /** Explicit hooks for the enclosing Rooms privacy lifetime. They do not install themselves or invent an erasure policy. */
1058
+ export declare const geometryPersistencePrivacyHooks: (source: Context.Service.Shape<typeof GeometryPersistencePort>) => Readonly<{
1059
+ tables: readonly TableLike[];
1060
+ onErase: (subjectId: string, context: PluginPrivacyHookContext) => Effect.Effect<void, GeometryPersistenceError>;
1061
+ onExport: (subjectId: string, context: PluginPrivacyHookContext) => Effect.Effect<ReadonlyArray<GeometrySubjectOperation>, GeometryPersistenceError>;
1062
+ }>;
1063
+
1064
+ export declare interface GeometryPersistenceReceipt {
1065
+ readonly scope: GeometryPersistenceScope;
1066
+ readonly requestId: string;
1067
+ readonly baseRevision: number;
1068
+ readonly revision: number;
1069
+ readonly changed: boolean;
1070
+ readonly blobSha256: string;
1071
+ readonly contentSha256: string;
1072
+ }
1073
+
1074
+ export declare interface GeometryPersistenceScope {
1075
+ readonly tenantId: string;
1076
+ readonly kind: GeometryKind;
1077
+ readonly worldId: string;
1078
+ readonly version: string;
1079
+ readonly layerSetId: string;
1080
+ readonly cx: number;
1081
+ readonly cy: number;
1082
+ readonly cz?: number | undefined;
1083
+ }
1084
+
1085
+ export declare interface GeometryPersistenceStoreOptions {
1086
+ /** Select World compaction rules for fresh commits. Historical reads and
1087
+ * confirmed receipt replay keep their original native data semantics. */
1088
+ readonly worlds?: ReadonlyArray<AnyWorldDescriptor> | undefined;
1089
+ readonly strategies?: Partial<GeometryCompactionStrategies> | undefined;
1090
+ readonly staticSource: Context.Service.Shape<typeof GeometryStaticSourcePort>;
1091
+ readonly epochNow: () => number;
1092
+ /** Must authorize the actual World/layer/chunk and server operation, not merely accept a claimed room ID. */
1093
+ readonly authorize: (operation: GeometryPersistenceOperation, scope: GeometryPersistenceScope | GeometryVersionReceipt | GeometryPrivacyTarget, context?: {
1094
+ readonly owner: GeometryPersistenceOwner;
1095
+ readonly subject: GeometryPersistenceCommit['subject'];
1096
+ readonly requestId: string;
1097
+ }) => Effect.Effect<void, GeometryPersistenceError>;
1098
+ /** Both must be durable/idempotent by target.requestId. Erasure first requires the ordinary Rooms subject fence. */
1099
+ readonly quiesceSubject: (target: GeometryPrivacyTarget) => Effect.Effect<void, GeometryPersistenceError>;
1100
+ readonly eraseSubjectContent: (target: GeometryPrivacyTarget) => Effect.Effect<void, GeometryPersistenceError>;
1101
+ /** Player-facing installations require a genuine current Session + locked SQL seat.
1102
+ * Omit only for explicitly trusted server authors; authorize still owns Subject.kind/rights. */
1103
+ readonly requirePlayerSession?: boolean;
1104
+ readonly journalArchiveIndex?: Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>;
1105
+ readonly codecLimits?: {
1106
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
1107
+ } | undefined;
1108
+ readonly maxManifestChunks?: number | undefined;
1109
+ readonly maxManifestBytes?: number;
1110
+ readonly maxDeltaBytes?: number;
1111
+ readonly maxReceiptsPerChunk?: number;
1112
+ readonly maxPrivacyRows?: number;
1113
+ readonly maxPrivacyBytes?: number;
1114
+ }
1115
+
1116
+ export declare interface GeometryPersistenceSubject {
1117
+ readonly id: string;
1118
+ readonly kind: 'user' | 'guest';
1119
+ }
1120
+
1121
+ export declare const geometryPersistenceTables: readonly TableLike[];
1122
+
1123
+ export declare interface GeometryPlayerEditOwner {
1124
+ /** Server channel/lifecycle staging only, outside Tick. Never accepts player authority facts. `'rejected'`: this
1125
+ * exact request was refused by the current policy or validator before any commit was prepared. */
1126
+ queue(request: GeometryPlayerEditRequest): 'queued' | 'retained' | 'rejected';
1127
+ /** Whether this request was refused before preparation (bounded memory of recent refusals). */
1128
+ rejected(requestId: string): boolean;
1129
+ /** Serial awaited policy/preparation/SQL/CPU/publication, no autonomous timer or retry loop. */
1130
+ pump(): Effect.Effect<ReadonlyArray<GeometryPersistenceReceipt>, GeometryCommitCoordinatorError>;
1131
+ /** Trusted server local discard only, before this owner prepared any commit.
1132
+ * false means local absence, never proof of global rejection/no SQL work. */
1133
+ discardUnsubmitted(target: GeometryPrivacyTarget): Effect.Effect<boolean, GeometryCommitCoordinatorError>;
1134
+ withdrawSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
1135
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
1136
+ close(): Effect.Effect<void, GeometryCommitCoordinatorError>;
1137
+ observation(): GeometryPlayerEditOwnerObservation;
1138
+ }
1139
+
1140
+ export declare interface GeometryPlayerEditOwnerObservation {
1141
+ readonly pending: number;
1142
+ readonly prepared: number;
1143
+ readonly pendingPatchBytes: number;
1144
+ readonly active: boolean;
1145
+ readonly subjectWindows: number;
1146
+ readonly subjectFences: number;
1147
+ readonly closing: boolean;
1148
+ readonly closed: boolean;
1149
+ }
1150
+
1151
+ export declare interface GeometryPlayerEditOwnerOptions {
1152
+ readonly tenantId: string;
1153
+ readonly now: () => number;
1154
+ readonly authorizeIntent: (request: GeometryPlayerEditPolicyRequest) => Effect.Effect<GeometryEditAuthority, GeometryCommitCoordinatorError>;
1155
+ /** Await an actual publication capability; void confirms this handoff only, never remote application ACK. */
1156
+ readonly publishCommitted: (publication: GeometryPlayerEditPublication) => Effect.Effect<void, GeometryCommitCoordinatorError>;
1157
+ readonly strategies?: Partial<GeometryEditStrategies> | undefined;
1158
+ readonly maxPending?: number | undefined;
1159
+ readonly maxPendingPatchBytes?: number;
1160
+ readonly maxOpsPerPump?: number;
1161
+ readonly maxSubjectWindows?: number;
1162
+ readonly maxSubjectFences?: number;
1163
+ readonly localWindowMs?: number;
1164
+ readonly localOpsPerWindow?: number;
1165
+ readonly localCooldownMs?: number;
1166
+ }
1167
+
1168
+ export declare interface GeometryPlayerEditPolicyRequest extends GeometryPlayerEditRequest {
1169
+ readonly scope: GeometryPersistenceScope;
1170
+ /** Exact request authority/reservation must remain idempotent across an unknown result. */
1171
+ readonly phase: 'prepare' | 'retry';
1172
+ /** Host Room mutations: the editing player's committed World point (its World entity through
1173
+ * `world.movement.position`), read at this authorization; null when the Room has no such point. */
1174
+ readonly editor?: {
1175
+ readonly position: GeometryEditAuthority['position'];
1176
+ } | null;
1177
+ }
1178
+
1179
+ export declare interface GeometryPlayerEditPublication {
1180
+ readonly scope: GeometryPersistenceScope;
1181
+ readonly requestId: string;
1182
+ readonly intent: GeometryEditIntent;
1183
+ readonly receipt: GeometryPersistenceReceipt;
1184
+ readonly patch: Uint8Array;
1185
+ }
1186
+
1187
+ export declare interface GeometryPlayerEditRequest {
1188
+ readonly coordinate: GeometryPreparedCoordinate;
1189
+ readonly owner: GeometryPersistenceOwner;
1190
+ readonly subject: GeometryPersistenceSubject;
1191
+ readonly requestId: string;
1192
+ readonly intent: GeometryEditIntent;
1193
+ /** Server-selected actual native Session; never a player body field. */
1194
+ readonly actualSession: unknown;
1195
+ }
1196
+
1197
+ export declare interface GeometryPngImportOptions {
1198
+ readonly worldId: string;
1199
+ readonly layerSetId: string;
1200
+ readonly version: string;
1201
+ readonly origin: {
1202
+ readonly cx: number;
1203
+ readonly cy: number;
1204
+ };
1205
+ /** A chunk owns cellsPerChunk + 1 samples, sharing the border with its neighbor. */
1206
+ readonly cellsPerChunk?: number;
1207
+ readonly sampleSpacingRaw?: number;
1208
+ readonly baseHeightRaw: number;
1209
+ readonly heightQuantumRaw: number;
1210
+ /** The unsigned image sample that represents baseHeightRaw. No implicit sea level. */
1211
+ readonly sampleZero: number;
1212
+ readonly maxInputBytes?: number;
1213
+ readonly maxSamples?: number | undefined;
1214
+ readonly maxChunks?: number | undefined;
1215
+ readonly maxPngChunks?: number;
1216
+ readonly codecLimits?: Partial<GeometryHeightfieldLimits> | undefined;
1217
+ }
1218
+
1219
+ declare interface GeometryPointRaw3D {
1220
+ readonly xRaw: number;
1221
+ readonly yRaw: number;
1222
+ readonly zRaw: number;
1223
+ }
1224
+
1225
+ export declare interface GeometryPreparedCell {
1226
+ readonly coverage: GeometryCellCoverage;
1227
+ readonly inventory: GeometryPreparedInventory;
1228
+ }
1229
+
1230
+ export declare interface GeometryPreparedCellLoadOptions extends GeometryPreparedLoadOptions {
1231
+ readonly vertical?: GeometryCellCoverageOptions['vertical'];
1232
+ }
1233
+
1234
+ declare interface GeometryPreparedCoordinate {
1235
+ readonly cx: number;
1236
+ readonly cy: number;
1237
+ readonly cz?: number | undefined;
1238
+ }
1239
+
1240
+ declare type GeometryPreparedEntry = PreparedCommon & GeometryPreparedView & {
1241
+ /** Independently prepared native collision data. Original view/artifact remains the edit/rebuild baseline. */
1242
+ readonly collision: GeometryPreparedView;
1243
+ readonly navigation: GeometryTileView | null;
1244
+ };
1245
+
1246
+ declare interface GeometryPreparedInventory {
1247
+ readonly scope: GeometryPreparedScope;
1248
+ readonly entries: ReadonlyArray<GeometryPreparedEntry>;
1249
+ readonly accountedBytes: number;
1250
+ /** CPU-only lookup; absence is explicit, never an empty collision chunk. */
1251
+ at(coordinate: GeometryPreparedCoordinate): GeometryPreparedEntry;
1252
+ contains(coordinate: GeometryPreparedCoordinate): boolean;
1253
+ }
1254
+
1255
+ export declare interface GeometryPreparedLoadOptions extends GeometryPreparedOptions {
1256
+ readonly maxConcurrent?: number | undefined;
1257
+ }
1258
+
1259
+ declare interface GeometryPreparedOptions {
1260
+ readonly strategies?: Partial<GeometryDerivationStrategies> | undefined;
1261
+ readonly navEnabled?: boolean;
1262
+ readonly maxChunks?: number | undefined;
1263
+ readonly maxAccountedBytes?: number;
1264
+ readonly codecLimits?: {
1265
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
1266
+ } | undefined;
1267
+ }
1268
+
1269
+ declare interface GeometryPreparedScope {
1270
+ readonly tenantId: string;
1271
+ readonly kind: GeometryKind;
1272
+ readonly worldId: string;
1273
+ readonly layerSetId: string;
1274
+ readonly version: string;
1275
+ }
1276
+
1277
+ /** Native prepared data only. Caller must confirm both published manifests,
1278
+ * frozen source revision/owner, real idempotent migration journal and atomic SQL
1279
+ * installation before actor/client activation. This is never that receipt. */
1280
+ export declare interface GeometryPreparedVersionMigration {
1281
+ readonly fromScope: GeometryPersistenceScope;
1282
+ readonly scope: GeometryPersistenceScope;
1283
+ readonly fromRevision: number;
1284
+ readonly staticChanged: boolean;
1285
+ readonly decision: 'kept' | 'discarded' | 'custom';
1286
+ readonly artifact: GeometryArtifact;
1287
+ readonly patch: GeometryPatch;
1288
+ }
1289
+
1290
+ declare type GeometryPreparedView = ({
1291
+ readonly kind: '2d-tiles';
1292
+ readonly view: GeometryTileView;
1293
+ } | {
1294
+ readonly kind: '2d-heightfield';
1295
+ readonly view: GeometryHeightfieldView;
1296
+ } | {
1297
+ readonly kind: '3d-shapes';
1298
+ readonly view: GeometryShapesView;
1299
+ } | {
1300
+ readonly kind: '3d-voxel';
1301
+ readonly view: GeometryVoxelView;
1302
+ });
1303
+
1304
+ export declare interface GeometryPrivacyTarget {
1305
+ readonly tenantId: string;
1306
+ readonly subject: GeometryPersistenceSubject;
1307
+ readonly requestId: string;
1308
+ }
1309
+
1310
+ declare interface GeometryProceduralContext {
1311
+ readonly seed: number;
1312
+ readonly kind: GeometryKind;
1313
+ readonly address: GeometryChunk['address'];
1314
+ readonly version: string;
1315
+ }
1316
+
1317
+ export declare interface GeometryProceduralPublicationOptions extends Omit<GeometryImportPublicationOptions, 'codecLimits'> {
1318
+ readonly maxWorkers?: number;
1319
+ }
1320
+
1321
+ export declare interface GeometryProceduralWorker {
1322
+ /** One accepted job at a time; caller owns full-version Storage/SQL publication. */
1323
+ generate(scope: GeometryPersistenceScope): Effect.Effect<GeometryArtifact, GeometryPersistenceError>;
1324
+ /** Waits admitted generation, then actual native termination/exit. */
1325
+ close(): Effect.Effect<void, GeometryPersistenceError>;
1326
+ observe(): GeometryProceduralWorkerObservation;
1327
+ }
1328
+
1329
+ export declare interface GeometryProceduralWorkerObservation {
1330
+ readonly phase: 'ready' | 'busy' | 'closing' | 'closed' | 'failed';
1331
+ readonly completedJobs: number;
1332
+ /** Only the actual native Worker exit event supplies this number. */
1333
+ readonly exitCode: number | null;
1334
+ }
1335
+
1336
+ export declare interface GeometryProceduralWorkerOptions {
1337
+ /** Explicit compiled app module exporting the same genuine World declaration. */
1338
+ readonly worldModuleUrl: string;
1339
+ /** Optional explicit installed development loader; never inherited implicitly. */
1340
+ readonly moduleLoaderUrl?: string;
1341
+ readonly exportName?: string;
1342
+ readonly timeoutMs?: number;
1343
+ readonly maxArtifactBytes?: number;
1344
+ readonly maxOldGenerationMb?: number;
1345
+ readonly codecLimits?: GeometryImportPublicationOptions['codecLimits'] | undefined;
1346
+ }
1347
+
1348
+ export declare interface GeometryPublicationRecipient {
1349
+ readonly tenantId: string;
1350
+ readonly roomId: string;
1351
+ readonly sessionId: string;
1352
+ readonly subjectId: string;
1353
+ readonly epoch: number;
1354
+ }
1355
+
1356
+ export declare interface GeometryReliablePublicationOptions {
1357
+ readonly scope: GeometryPreparedScope;
1358
+ readonly owner: GeometryPersistenceOwner;
1359
+ readonly currentSessions: () => ReadonlyArray<unknown>;
1360
+ /** Actual current World/layer/chunk read/view rights, outside Tick. Native identity is necessary, not sufficient. */
1361
+ readonly authorizeRecipient: (recipient: GeometryPublicationRecipient, scope: GeometryPersistenceScope) => Effect.Effect<void, GeometryCommitCoordinatorError>;
1362
+ readonly channel?: string | undefined;
1363
+ readonly maxRecipients?: number;
1364
+ readonly maxPatchBytes?: number | undefined;
1365
+ readonly maxFragmentDeliveries?: number;
1366
+ }
1367
+
1368
+ export declare interface GeometryRollbackCoordinator {
1369
+ rollback(request: GeometryRollbackExecution): Effect.Effect<GeometryPersistenceReceipt, GeometryCommitCoordinatorError>;
1370
+ prepareActivation(actor: GeometryActorInventory, request: GeometryRollbackExecution): Effect.Effect<GeometryActivation, GeometryCommitCoordinatorError>;
1371
+ withdrawSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryCommitCoordinatorError>;
1372
+ close(): Effect.Effect<void, GeometryCommitCoordinatorError>;
1373
+ observation(): GeometryRollbackCoordinatorObservation;
1374
+ }
1375
+
1376
+ export declare interface GeometryRollbackCoordinatorObservation {
1377
+ readonly jobs: number;
1378
+ readonly active: number;
1379
+ readonly patchBytes: number;
1380
+ readonly unconfirmed: number;
1381
+ readonly subjectFences: number;
1382
+ readonly closing: boolean;
1383
+ readonly closed: boolean;
1384
+ }
1385
+
1386
+ export declare interface GeometryRollbackCoordinatorOptions {
1387
+ readonly tenantId: string;
1388
+ readonly authorize: (request: GeometryRollbackExecution) => Effect.Effect<void, GeometryCommitCoordinatorError>;
1389
+ readonly maxJobs?: number;
1390
+ readonly maxPatchBytes?: number | undefined;
1391
+ readonly maxPendingBytes?: number | undefined;
1392
+ readonly maxSubjectFences?: number;
1393
+ }
1394
+
1395
+ export declare interface GeometryRollbackExecution extends GeometryRollbackRequest {
1396
+ readonly requestId: string;
1397
+ }
1398
+
1399
+ declare interface GeometryRollbackOptions {
1400
+ readonly maxEntries?: number;
1401
+ readonly maxJournalBytes?: number;
1402
+ readonly maxCells?: number | undefined;
1403
+ readonly maxComparedCells?: number;
1404
+ readonly codecLimits?: GeometryArtifactLimits<GeometryKind> | undefined;
1405
+ readonly strategies?: Partial<GeometryRollbackStrategies> | undefined;
1406
+ }
1407
+
1408
+ declare interface GeometryRollbackPreparation {
1409
+ readonly artifact: GeometryArtifact;
1410
+ readonly patch: GeometryPatch;
1411
+ readonly revision: number;
1412
+ readonly entries: number;
1413
+ readonly targetEntries: number;
1414
+ readonly restoredCells: number;
1415
+ }
1416
+
1417
+ export declare const geometryRollbackPreparationLayer: (source: Context.Service.Shape<typeof GeometryRollbackPreparationPort>) => Layer.Layer<GeometryRollbackPreparationPort>;
1418
+
1419
+ export declare class GeometryRollbackPreparationPort extends GeometryRollbackPreparationPort_base {
1420
+ }
1421
+
1422
+ declare const GeometryRollbackPreparationPort_base: Context.ServiceClass<GeometryRollbackPreparationPort, "@voltro/GeometryRollbackPreparationPort", {
1423
+ prepare(request: GeometryRollbackRequest): Effect.Effect<GeometryRollbackPreparation, GeometryPersistenceError>;
1424
+ }>;
1425
+
1426
+ export declare interface GeometryRollbackRequest {
1427
+ readonly scope: GeometryPersistenceScope;
1428
+ readonly owner: GeometryPersistenceOwner;
1429
+ /** `null`: every actor's changes are undone (reset to the static baseline). */
1430
+ readonly subject: GeometryPersistenceSubject;
1431
+ readonly target: GeometryPersistenceSubject | null;
1432
+ }
1433
+
1434
+ export declare interface GeometryRollbackStoreOptions {
1435
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
1436
+ readonly staticSource: Context.Service.Shape<typeof GeometryStaticSourcePort>;
1437
+ readonly authorize: (request: GeometryRollbackRequest) => Effect.Effect<void, GeometryPersistenceError>;
1438
+ readonly preparation?: GeometryRollbackOptions;
1439
+ readonly journalArchiveIndex?: Context.Service.Shape<typeof GeometryJournalArchiveIndexPort>;
1440
+ readonly maxEntries?: number;
1441
+ readonly maxJournalBytes?: number;
1442
+ readonly maxManifestChunks?: number | undefined;
1443
+ readonly maxManifestBytes?: number;
1444
+ }
1445
+
1446
+ declare interface GeometryRollbackStrategies {
1447
+ /** Pure quantized contribution rule. Native layout/codec admission and
1448
+ * current SQL/admin authority remain outside this replaceable slot. */
1449
+ readonly rebaseHeight: (context: GeometryHeightRollbackContext) => number;
1450
+ }
1451
+
1452
+ declare type GeometryShape = (typeof GeometryShapeSchema)["Type"];
1453
+
1454
+ declare interface GeometryShapeRayHit {
1455
+ readonly kind: '3d-shapes';
1456
+ readonly scope: GeometryPersistenceScope;
1457
+ readonly revision: number;
1458
+ /** Native LOCAL shape; scope identifies its owning chunk. */
1459
+ readonly shape: GeometryShape;
1460
+ /** Encloses the exact infimum entry time; width <= 2^-52. Presentation only.
1461
+ * Selection and ownership decisions never use these rounded bounds. */
1462
+ readonly fractionBounds: {
1463
+ readonly lower: number;
1464
+ readonly upper: number;
1465
+ };
1466
+ readonly visitedChunks: number;
1467
+ readonly testedShapes: number;
1468
+ }
1469
+
1470
+ declare const GeometryShapeSchema: Schema.Union<readonly [Schema.Struct<{
1471
+ readonly halfXRaw: Schema.Int;
1472
+ readonly halfYRaw: Schema.Int;
1473
+ readonly halfZRaw: Schema.Int;
1474
+ readonly id: Schema.String;
1475
+ readonly xRaw: Schema.Int;
1476
+ readonly yRaw: Schema.Int;
1477
+ readonly zRaw: Schema.Int;
1478
+ readonly kind: Schema.Literal<"aabb">;
1479
+ }>, Schema.Struct<{
1480
+ readonly radiusRaw: Schema.Int;
1481
+ readonly id: Schema.String;
1482
+ readonly xRaw: Schema.Int;
1483
+ readonly yRaw: Schema.Int;
1484
+ readonly zRaw: Schema.Int;
1485
+ readonly kind: Schema.Literal<"sphere">;
1486
+ }>]>;
1487
+
1488
+ declare type GeometryShapesChunk = (typeof GeometryShapesChunkSchema)["Type"];
1489
+
1490
+ declare const GeometryShapesChunkSchema: Schema.Struct<{
1491
+ readonly kind: Schema.Literal<"3d-shapes">;
1492
+ readonly formatVersion: Schema.Literal<1>;
1493
+ readonly address: Schema.Struct<{
1494
+ readonly worldId: Schema.String;
1495
+ readonly layerSetId: Schema.String;
1496
+ readonly cx: Schema.Int;
1497
+ readonly cy: Schema.Int;
1498
+ readonly cz: Schema.Int;
1499
+ }>;
1500
+ readonly version: Schema.String;
1501
+ readonly extentXRaw: Schema.Int;
1502
+ readonly extentYRaw: Schema.Int;
1503
+ readonly extentZRaw: Schema.Int;
1504
+ readonly shapes: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1505
+ readonly halfXRaw: Schema.Int;
1506
+ readonly halfYRaw: Schema.Int;
1507
+ readonly halfZRaw: Schema.Int;
1508
+ readonly id: Schema.String;
1509
+ readonly xRaw: Schema.Int;
1510
+ readonly yRaw: Schema.Int;
1511
+ readonly zRaw: Schema.Int;
1512
+ readonly kind: Schema.Literal<"aabb">;
1513
+ }>, Schema.Struct<{
1514
+ readonly radiusRaw: Schema.Int;
1515
+ readonly id: Schema.String;
1516
+ readonly xRaw: Schema.Int;
1517
+ readonly yRaw: Schema.Int;
1518
+ readonly zRaw: Schema.Int;
1519
+ readonly kind: Schema.Literal<"sphere">;
1520
+ }>]>>;
1521
+ }>;
1522
+
1523
+ declare interface GeometryShapesLimits {
1524
+ readonly maxShapes: number;
1525
+ readonly maxBytes: number;
1526
+ }
1527
+
1528
+ declare interface GeometryShapesView {
1529
+ readonly chunk: GeometryShapesChunk;
1530
+ containingRaw(point: GeometryPointRaw3D, maximumShapes?: number): ReadonlyArray<GeometryShape>;
1531
+ /** Closed LOCAL segment and native volumes. Canonical ID order, not distance
1532
+ * order; no first-hit fraction or cross-chunk ownership is implied. */
1533
+ intersectingSegmentRaw(from: GeometryPointRaw3D, to: GeometryPointRaw3D, maximumShapes?: number): ReadonlyArray<GeometryShape>;
1534
+ }
1535
+
1536
+ declare type GeometryShapeTemplate = {
1537
+ readonly key: string;
1538
+ readonly kind: 'aabb';
1539
+ readonly halfXRaw: number;
1540
+ readonly halfYRaw: number;
1541
+ readonly halfZRaw: number;
1542
+ } | {
1543
+ readonly key: string;
1544
+ readonly kind: 'sphere';
1545
+ readonly radiusRaw: number;
1546
+ };
1547
+
1548
+ export declare interface GeometrySnapshotPreparationOptions {
1549
+ readonly manifest: Context.Service.Shape<typeof GeometryManifestPort>;
1550
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
1551
+ readonly staticSource: Context.Service.Shape<typeof GeometryStaticSourcePort>;
1552
+ /** Actual current recipient/World/layer/chunk admission from trusted server. */
1553
+ readonly authorize: (scope: GeometryPersistenceScope) => Effect.Effect<void, GeometryPersistenceError>;
1554
+ readonly maxManifestChunks?: number | undefined;
1555
+ readonly maxManifestBytes?: number;
1556
+ readonly maxPatchBytes?: number | undefined;
1557
+ readonly codecLimits?: {
1558
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
1559
+ } | undefined;
1560
+ }
1561
+
1562
+ declare type GeometrySource = {
1563
+ readonly _tag: 'GeometrySource';
1564
+ readonly kind: 'cms';
1565
+ readonly key: string;
1566
+ readonly channel: string;
1567
+ } | {
1568
+ readonly _tag: 'GeometrySource';
1569
+ readonly kind: 'imported';
1570
+ readonly directory: string;
1571
+ } | {
1572
+ readonly _tag: 'GeometrySource';
1573
+ readonly kind: 'procedural';
1574
+ readonly seed: number;
1575
+ readonly generator: GeometryGenerator;
1576
+ };
1577
+
1578
+ /** Actual current scoped read URL; identity/digest is never a grant. */
1579
+ export declare class GeometryStaticReadGrantPort extends GeometryStaticReadGrantPort_base {
1580
+ }
1581
+
1582
+ declare const GeometryStaticReadGrantPort_base: Context.ServiceClass<GeometryStaticReadGrantPort, "@voltro/GeometryStaticReadGrantPort", {
1583
+ grant(scope: GeometryPersistenceScope, subject: Subject): Effect.Effect<string, GeometryPersistenceError>;
1584
+ }>;
1585
+
1586
+ export declare interface GeometryStaticReference extends GeometryPersistenceScope {
1587
+ readonly blobSha256: string;
1588
+ readonly contentSha256: string;
1589
+ }
1590
+
1591
+ export declare const geometryStaticSourceLayer: (service: Context.Service.Shape<typeof GeometryStaticSourcePort>) => Layer.Layer<GeometryStaticSourcePort>;
1592
+
1593
+ /** Trusted immutable blob source. Neither this Tag nor a digest authorizes publishing a manifest. */
1594
+ export declare class GeometryStaticSourcePort extends GeometryStaticSourcePort_base {
1595
+ }
1596
+
1597
+ declare const GeometryStaticSourcePort_base: Context.ServiceClass<GeometryStaticSourcePort, "@voltro/GeometryStaticSourcePort", {
1598
+ load(reference: GeometryStaticReference): Effect.Effect<Uint8Array, GeometryPersistenceError>;
1599
+ }>;
1600
+
1601
+ export declare interface GeometryStorage {
1602
+ readonly source: Context.Service.Shape<typeof GeometryStaticSourcePort>;
1603
+ /** Actual native artifact only. Durable operation and exact claim survive unknown replies. */
1604
+ store(tenantId: string, artifact: GeometryArtifact): Effect.Effect<GeometryStaticReference, GeometryPersistenceError>;
1605
+ /** Application version-retirement policy must first fence all manifest/readers.
1606
+ * Only this exact named claim is released; metadata is not physical-absence proof. */
1607
+ release(reference: GeometryStaticReference): Effect.Effect<void, GeometryPersistenceError>;
1608
+ }
1609
+
1610
+ export declare interface GeometryStorageOptions {
1611
+ /** Actual StorageService bucket and durable metadata boundary. No default store is constructed. */
1612
+ readonly bucket: string;
1613
+ readonly metadata: Pick<StorageObjectMetadata, 'lookup'>;
1614
+ readonly destination?: string;
1615
+ readonly visibility?: 'private' | 'public';
1616
+ readonly maxBytes?: number | undefined;
1617
+ readonly codecLimits?: {
1618
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
1619
+ } | undefined;
1620
+ /** Trusted server policy. Private reads are not authorized by a digest/ref ID. */
1621
+ readonly authorize: (operation: 'store' | 'load' | 'release', reference: GeometryStaticReference) => Effect.Effect<void, GeometryPersistenceError>;
1622
+ }
1623
+
1624
+ export declare interface GeometryStorageReadGrantOptions {
1625
+ readonly bucket: string;
1626
+ readonly metadata: Pick<StorageObjectMetadata, 'lookup'>;
1627
+ /** Actual mounted API origin for provider-returned relative serve URLs. */
1628
+ readonly origin: string;
1629
+ readonly visibility?: 'private' | 'public';
1630
+ readonly expiresInSec?: number;
1631
+ readonly maxBytes?: number | undefined;
1632
+ /** Current World/layer/version/chunk rights for actual authenticated Subject. */
1633
+ readonly authorize: (reference: GeometryStaticReference, subject: Subject) => Effect.Effect<void, GeometryPersistenceError>;
1634
+ }
1635
+
1636
+ export declare interface GeometryStorageReadGrants {
1637
+ grant(reference: GeometryStaticReference, subject: Subject): Effect.Effect<string, GeometryPersistenceError>;
1638
+ }
1639
+
1640
+ /** Authorized layer-set projection of an immutable version plus independently
1641
+ * observed SQL dirty revisions, not one global actor frame or a read grant. */
1642
+ export declare interface GeometryStreamManifest {
1643
+ readonly scope: GeometryPreparedScope;
1644
+ readonly manifestSha256: string;
1645
+ readonly chunks: ReadonlyArray<GeometryStaticReference>;
1646
+ readonly dirtyChunks: ReadonlyArray<GeometryDirtyChunkReference>;
1647
+ }
1648
+
1649
+ export declare interface GeometrySubjectOperation {
1650
+ readonly receipt: GeometryPersistenceReceipt;
1651
+ readonly patch: Uint8Array;
1652
+ }
1653
+
1654
+ declare interface GeometryTileCellBounds {
1655
+ readonly minXRaw: number;
1656
+ readonly minYRaw: number;
1657
+ readonly maxXRaw: number;
1658
+ readonly maxYRaw: number;
1659
+ }
1660
+
1661
+ declare type GeometryTileChunk = (typeof GeometryTileChunkSchema)["Type"];
1662
+
1663
+ declare const GeometryTileChunkSchema: Schema.Struct<{
1664
+ readonly kind: Schema.Literal<"2d-tiles">;
1665
+ readonly formatVersion: Schema.Literal<1>;
1666
+ readonly address: Schema.Struct<{
1667
+ readonly worldId: Schema.String;
1668
+ readonly layerSetId: Schema.String;
1669
+ readonly cx: Schema.Int;
1670
+ readonly cy: Schema.Int;
1671
+ }>;
1672
+ readonly version: Schema.String;
1673
+ readonly width: Schema.Int;
1674
+ readonly height: Schema.Int;
1675
+ readonly tileSizeRaw: Schema.Int;
1676
+ readonly palette: Schema.$Array<Schema.Struct<{
1677
+ readonly key: Schema.String;
1678
+ readonly solid: Schema.Boolean;
1679
+ }>>;
1680
+ readonly runs: Schema.$Array<Schema.Struct<{
1681
+ readonly paletteIndex: Schema.Int;
1682
+ readonly length: Schema.Int;
1683
+ }>>;
1684
+ }>;
1685
+
1686
+ declare interface GeometryTileCollisionOptions {
1687
+ /** Total visited cells across every solver query, including its final check.
1688
+ * May only narrow the world's maxOverlapTests. */
1689
+ readonly maxTests?: number;
1690
+ /** Existing discrete solver limit; defaults to 8, maximum 256. */
1691
+ readonly maxIterations?: number;
1692
+ }
1693
+
1694
+ declare interface GeometryTileLimits {
1695
+ readonly maxSide: number;
1696
+ readonly maxCells: number;
1697
+ readonly maxPalette: number;
1698
+ readonly maxRuns: number;
1699
+ readonly maxBytes: number;
1700
+ }
1701
+
1702
+ declare type GeometryTileMaterial = (typeof GeometryTileMaterialSchema)["Type"];
1703
+
1704
+ declare const GeometryTileMaterialSchema: Schema.Struct<{
1705
+ readonly key: Schema.String;
1706
+ readonly solid: Schema.Boolean;
1707
+ }>;
1708
+
1709
+ declare interface GeometryTileView {
1710
+ readonly chunk: GeometryTileChunk;
1711
+ /** Local integer cell queries. Outside cells refuse; no missing-neighbor air. */
1712
+ materialAt(x: number, y: number): GeometryTileMaterial;
1713
+ solidAt(x: number, y: number): boolean;
1714
+ materialAtRaw(xRaw: number, yRaw: number): GeometryTileMaterial;
1715
+ cellBounds(x: number, y: number): GeometryTileCellBounds;
1716
+ /** Detached row-major little-bit occupancy, never the retained mutable grid. */
1717
+ occupancy(): Uint8Array;
1718
+ }
1719
+
1720
+ declare interface GeometryVersionActivation {
1721
+ readonly _tag: 'GeometryVersionActivation';
1722
+ readonly receipts: ReadonlyArray<GeometryMigrationReceipt>;
1723
+ }
1724
+
1725
+ export declare interface GeometryVersionActivationOptions {
1726
+ readonly migrations: Context.Service.Shape<typeof GeometryVersionMigrationPort>;
1727
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
1728
+ /** Actual writer quiescence/lease admission; never a successful default. Must
1729
+ * settle the old graph before preparation and retain fencing until activation. */
1730
+ readonly quiesce: (actor: GeometryActorInventory) => Effect.Effect<void, GeometryPersistenceError>;
1731
+ readonly maxChunks?: number | undefined;
1732
+ readonly maxAccountedBytes?: number;
1733
+ }
1734
+
1735
+ export declare interface GeometryVersionMigrationInput {
1736
+ readonly from: {
1737
+ readonly reference: GeometryStaticReference;
1738
+ readonly static: GeometryArtifact;
1739
+ readonly current: GeometryPersistenceObservation;
1740
+ };
1741
+ readonly to: {
1742
+ readonly reference: GeometryStaticReference;
1743
+ readonly static: GeometryArtifact;
1744
+ };
1745
+ }
1746
+
1747
+ export declare const geometryVersionMigrationLayer: (service: Context.Service.Shape<typeof GeometryVersionMigrationPort>) => Layer.Layer<GeometryVersionMigrationPort>;
1748
+
1749
+ export declare interface GeometryVersionMigrationOptions {
1750
+ readonly strategies?: GeometryVersionPreparationStrategies | undefined;
1751
+ readonly maxAccountedBytes?: number;
1752
+ readonly maxPatchBytes?: number | undefined;
1753
+ readonly codecLimits?: {
1754
+ readonly [K in GeometryKind]?: GeometryArtifactLimits<K>;
1755
+ } | undefined;
1756
+ }
1757
+
1758
+ export declare class GeometryVersionMigrationPort extends GeometryVersionMigrationPort_base {
1759
+ }
1760
+
1761
+ declare const GeometryVersionMigrationPort_base: Context.ServiceClass<GeometryVersionMigrationPort, "@voltro/GeometryVersionMigrationPort", {
1762
+ migrate(input: GeometryMigrationRequest): Effect.Effect<GeometryMigrationReceipt, GeometryPersistenceError>;
1763
+ exportSubject(target: GeometryPrivacyTarget): Effect.Effect<ReadonlyArray<GeometryMigrationReceipt>, GeometryPersistenceError>;
1764
+ eraseSubject(target: GeometryPrivacyTarget): Effect.Effect<void, GeometryPersistenceError>;
1765
+ }>;
1766
+
1767
+ export declare interface GeometryVersionMigrationStrategies {
1768
+ readonly migrateDelta?: GeometryMigrateDelta;
1769
+ }
1770
+
1771
+ export declare interface GeometryVersionPreparationStrategies extends GeometryVersionMigrationStrategies, Partial<GeometryCompactionStrategies> {
1772
+ }
1773
+
1774
+ export declare interface GeometryVersionPublication {
1775
+ readonly tenantId: string;
1776
+ readonly kind: GeometryKind;
1777
+ readonly worldId: string;
1778
+ readonly version: string;
1779
+ readonly chunks: ReadonlyArray<GeometryStaticReference>;
1780
+ }
1781
+
1782
+ export declare interface GeometryVersionReceipt {
1783
+ readonly tenantId: string;
1784
+ readonly kind: GeometryKind;
1785
+ readonly worldId: string;
1786
+ readonly version: string;
1787
+ readonly manifestSha256: string;
1788
+ readonly chunks: ReadonlyArray<GeometryStaticReference>;
1789
+ }
1790
+
1791
+ /** Immutable manifests authorize the exact static bytes; the static source never selects a new version implicitly. */
1792
+ export declare const geometryVersionsTable: TableLike;
1793
+
1794
+ declare type GeometryVoxelChunk = (typeof GeometryVoxelChunkSchema)["Type"];
1795
+
1796
+ declare const GeometryVoxelChunkSchema: Schema.Struct<{
1797
+ readonly kind: Schema.Literal<"3d-voxel">;
1798
+ readonly formatVersion: Schema.Literal<1>;
1799
+ readonly address: Schema.Struct<{
1800
+ readonly worldId: Schema.String;
1801
+ readonly layerSetId: Schema.String;
1802
+ readonly cx: Schema.Int;
1803
+ readonly cy: Schema.Int;
1804
+ readonly cz: Schema.Int;
1805
+ }>;
1806
+ readonly version: Schema.String;
1807
+ readonly side: Schema.Int;
1808
+ readonly voxelSizeRaw: Schema.Int;
1809
+ readonly palette: Schema.$Array<Schema.Struct<{
1810
+ readonly key: Schema.String;
1811
+ readonly solid: Schema.Boolean;
1812
+ }>>;
1813
+ readonly sections: Schema.$Array<Schema.Struct<{
1814
+ readonly sx: Schema.Int;
1815
+ readonly sy: Schema.Int;
1816
+ readonly sz: Schema.Int;
1817
+ readonly runs: Schema.$Array<Schema.Struct<{
1818
+ readonly paletteIndex: Schema.Int;
1819
+ readonly length: Schema.Int;
1820
+ }>>;
1821
+ }>>;
1822
+ }>;
1823
+
1824
+ declare interface GeometryVoxelLimits {
1825
+ readonly maxSide: number;
1826
+ readonly maxVoxels: number;
1827
+ readonly maxPalette: number;
1828
+ readonly maxSections: number;
1829
+ readonly maxRunsPerSection: number;
1830
+ readonly maxBytes: number;
1831
+ }
1832
+
1833
+ declare interface GeometryVoxelView {
1834
+ readonly chunk: GeometryVoxelChunk;
1835
+ materialAt(x: number, y: number, z: number): GeometryTileMaterial;
1836
+ solidAt(x: number, y: number, z: number): boolean;
1837
+ materialAtRaw(xRaw: number, yRaw: number, zRaw: number): GeometryTileMaterial;
1838
+ occupancy(): Uint8Array;
1839
+ }
1840
+
1841
+ /** Nonempty half-open raw box. Three-dimensional kinds require both Z fields. */
1842
+ declare interface GeometryWorldBoxRaw {
1843
+ readonly minXRaw: number;
1844
+ readonly minYRaw: number;
1845
+ readonly maxXRaw: number;
1846
+ readonly maxYRaw: number;
1847
+ readonly minZRaw?: number;
1848
+ readonly maxZRaw?: number;
1849
+ }
1850
+
1851
+ declare interface GeometryWorldPointRaw {
1852
+ readonly xRaw: number;
1853
+ readonly yRaw: number;
1854
+ readonly zRaw?: number;
1855
+ }
1856
+
1857
+ declare type GeometryWorldRayHit = GeometryGridRayHit | GeometryShapeRayHit | GeometryHeightfieldRayHit;
1858
+
1859
+ declare interface GeometryWorldRayOptions extends GeometryGridRayOptions {
1860
+ /** Shapes only; narrows maxOverlapTests for the total shape scan. */
1861
+ readonly maxTests?: number;
1862
+ }
1863
+
1864
+ declare interface GeometryWorldShapeHit {
1865
+ readonly scope: GeometryPersistenceScope;
1866
+ readonly revision: number;
1867
+ readonly shape: GeometryShape;
1868
+ }
1869
+
1870
+ declare interface GeometryWorldView {
1871
+ readonly kind: GeometryKind;
1872
+ readonly scope: GeometryPreparedScope;
1873
+ /** Discrete AABB/circle resolution in world units against current tile data.
1874
+ * Reuses the Transform solver; no swept movement or velocity integration. */
1875
+ collide(transform: Transform2D, body: CollisionBody2D, options?: GeometryTileCollisionOptions): CollisionResult2D;
1876
+ /** Tiles/voxels only. Unloaded coordinates refuse, never implicit empty terrain. */
1877
+ materialAtRaw(point: GeometryWorldPointRaw): GeometryTileMaterial;
1878
+ /** Tiles/voxels/shapes: the stored solidity. Heightfields (points with `zRaw`): terrain is solid at and
1879
+ * below its surface, the same surface `raycastRaw` hits. Heightfield material is not invented. */
1880
+ solidAtRaw(point: GeometryWorldPointRaw): boolean;
1881
+ /** Heightfield only, with exact existing native interpolation. */
1882
+ heightAtRaw(point: GeometryWorldPointRaw): number;
1883
+ /** Shapes only; hit volumes retain native LOCAL coordinates and exact chunk scope. */
1884
+ shapesAtRaw(point: GeometryWorldPointRaw): ReadonlyArray<GeometryWorldShapeHit>;
1885
+ /** Tiles/voxels return exact rational entry; shapes select exact quadratic
1886
+ * entry and expose enclosing presentation bounds; heightfields (points with
1887
+ * `zRaw`) return the first sampled point at or below the surface, refined to
1888
+ * one raw unit (`raycastGeometryHeightfield`). Missing coverage refuses. */
1889
+ raycastRaw(from: GeometryWorldPointRaw, to: GeometryWorldPointRaw, options?: GeometryWorldRayOptions): GeometryWorldRayHit | null;
1890
+ /** Tiles/voxels/closed native shapes, clipped by half-open chunk ownership. Heightfields need the z extent:
1891
+ * the box touches terrain when the highest surface point over its footprint is at or above `minZRaw`
1892
+ * (`overlapsGeometryHeightfieldBox`). Nonempty half-open raw boxes only; missing data or work exhaustion refuses. */
1893
+ overlapsBoxRaw(box: GeometryWorldBoxRaw, options?: GeometryBoxOverlapOptions): boolean;
1894
+ /** Translation-only tile/voxel sweep. Shares maxOverlapTests; validates the
1895
+ * whole swept bounding region before publishing the earliest overlap. */
1896
+ sweepBoxRaw(from: GeometryWorldBoxRaw, to: GeometryWorldBoxRaw, options?: GeometryBoxOverlapOptions): GeometryGridSweepHit | null;
1897
+ /** Heightfields only (boxes with a z extent): the first raw-grid position that reaches under the surface
1898
+ * (`sweepGeometryHeightfieldBox`), coarse steps of a quarter sample spacing, at most
1899
+ * `geometry.budgets.maxRayCells` overlap evaluations of `maxTests` reads each. */
1900
+ sweepHeightfieldBoxRaw(from: GeometryHeightfieldBoxRaw, to: GeometryHeightfieldBoxRaw, options?: GeometryBoxOverlapOptions): GeometryHeightfieldSweepHit | null;
1901
+ }
1902
+
1903
+ /** Server-only offline author decoder. Literal greyscale 8/16-bit PNG samples,
1904
+ * exact bounded inflate/CRC/filter reconstruction, never a display conversion.
1905
+ * Run outside live Tick; no file/provider/SQL access or border extrapolation. */
1906
+ export declare const importPngGeometry: (offered: Uint8Array, options: GeometryPngImportOptions) => ReadonlyArray<GeometryHeightfieldChunk>;
1907
+
1908
+ /** Normal offline author source only. SQL stays runtime truth; this file source
1909
+ * cannot select a runtime version or bypass actual Storage/SQL publication. */
1910
+ export declare const loadImportedGeometryPublication: (offeredWorld: AnyWorldDescriptor, offeredRequest: GeometryImportedSourceRequest, offeredOptions?: GeometryImportPublicationOptions) => Effect.Effect<GeometryImportPublication, GeometryPersistenceError>;
1911
+
1912
+ /** Before actual cell open: derive the complete declared cell+margin inventory,
1913
+ * then await the same real public Tag/SQL/static rebuild and native query guards.
1914
+ * Failure returns no partial inventory. The actual Host must await this Effect
1915
+ * before admission/open; this helper does not invent an open capability. */
1916
+ export declare const loadPreparedWorldCellGeometry: (world: AnyWorldDescriptor, root: GeometryPreparedScope, position: WorldPosition, offered?: GeometryPreparedCellLoadOptions) => Effect.Effect<GeometryPreparedCell, GeometryPersistenceError, GeometryPersistencePort>;
1917
+
1918
+ /** Actual public persistence Tag -> SQL/static rebuild -> native prepared views.
1919
+ * Entire caller-selected inventory is admitted before provider reads. Workers
1920
+ * stop scheduling after a failure and join started work before reporting it.
1921
+ * No partial result, implicit missing terrain, host activation or timers. */
1922
+ export declare const loadPreparedWorldGeometry: (offeredWorld: AnyWorldDescriptor, offeredRoot: GeometryPreparedScope, offeredCoordinates: ReadonlyArray<GeometryPreparedCoordinate>, offered?: GeometryPreparedLoadOptions) => Effect.Effect<GeometryPreparedInventory, GeometryPersistenceError, GeometryPersistencePort>;
1923
+
1924
+ /** Reuse the actual compare-only lease owner; no second token/renew/release implementation. */
1925
+ export declare const makeGeometryChunkLeases: (hot: HotStoreShape, options: GeometryChunkLeaseOptions) => GeometryChunkLeases;
1926
+
1927
+ /** One bounded outside-Tick request/lease lifetime around the actual public SQL
1928
+ * port. Hot leases coordinate preparation only; SQL owner/revision/hash checks
1929
+ * remain authority across expiry and the non-atomic HotStore/SQL boundary. No
1930
+ * timers, automatic renewals/retries, actor activation or client ACK. */
1931
+ export declare const makeGeometryCommitCoordinator: (source: Context.Service.Shape<typeof GeometryPersistencePort>, offeredLeases: GeometryChunkLeases, offered: GeometryCommitCoordinatorOptions) => GeometryCommitCoordinator;
1932
+
1933
+ /** Own bounded ingress memory; borrow the real edit owner/session/identity
1934
+ * services. Retain accepted intents across unknown outcomes/reconnect. */
1935
+ export declare const makeGeometryEditIngress: (offeredOwner: GeometryPlayerEditOwner, offered: GeometryEditIngressOptions) => GeometryEditIngress;
1936
+
1937
+ /** Capture the explicit real archive backend once. No fallback or second wire
1938
+ * format: full inline native GPD, or an explicit empty S3 tier marker whose
1939
+ * actual indexed private native GPD source must confirm the same receipt. */
1940
+ export declare const makeGeometryJournalPatchReader: (offered?: GeometryJournalPatchReaderOptions) => (row: Row) => Effect.Effect<Uint8Array, GeometryPersistenceError>;
1941
+
1942
+ /** Actual SQL/source Port ->authorized current native reliable metadata writes.
1943
+ * Explicit outside-Tick call, no timer/automatic Host hook/blob transfer/ACK. */
1944
+ export declare const makeGeometryManifestPublication: (offered: GeometryManifestPublicationOptions) => (() => Effect.Effect<void, GeometryPersistenceError>);
1945
+
1946
+ /** Bounded outside-Tick intent lifetime. Borrows the actual CPU/coordinator and
1947
+ * policy/publication capabilities; does not own their shutdown or app terrain
1948
+ * redaction. Only confirmed publication or actual Subject erase forgets work. */
1949
+ export declare const makeGeometryPlayerEditOwner: (cpu: GeometryActorInventory, coordinator: GeometryCommitCoordinator, offered: GeometryPlayerEditOwnerOptions) => GeometryPlayerEditOwner;
1950
+
1951
+ /** Actual ordinary native Session writer/compiled reliable channel. Snapshot
1952
+ * current recipients, authorize each, await every tracked fragment write. No
1953
+ * datagrams, static CDN blobs, remote ACK, silent skip or private transport. */
1954
+ export declare const makeGeometryReliablePublication: (offered: GeometryReliablePublicationOptions) => ((publication: GeometryPlayerEditPublication) => Effect.Effect<void, GeometryCommitCoordinatorError>);
1955
+
1956
+ /** Outside-Tick local lifetime: authentic preparation under original physical
1957
+ * chunk lease -> joined release -> existing native commit coordinator/SQL CAS.
1958
+ * Same-request exact bytes survive a lost reply within this owner. No durable
1959
+ * prepared-job recovery, CPU activation or automatic retry is claimed. */
1960
+ export declare const makeGeometryRollbackCoordinator: (preparation: Context.Service.Shape<typeof GeometryRollbackPreparationPort>, persistence: Context.Service.Shape<typeof GeometryPersistencePort>, offeredLeases: GeometryChunkLeases, offered: GeometryRollbackCoordinatorOptions) => GeometryRollbackCoordinator;
1961
+
1962
+ /** Actual default graph, acquired before actor creation. It owns ingress/edit/
1963
+ * coordinator memory and lease release; persistence/Hot/transport remain borrowed.
1964
+ * Real current Sessions are supplied by Runtime, not by player data or SQL hints. */
1965
+ export declare const makeRoomGeometryMutations: (offeredResource: RoomGeometryResource, currentSessions: () => ReadonlyArray<unknown>, offered: RoomGeometryMutationOptions) => RoomGeometryMutationLifetime;
1966
+
1967
+ /** Real original chunk lease owner +actual migration/rebuild Ports. Owns bounded
1968
+ * per-resource coordination only; borrowed registry/Hot/SQL lifetimes remain
1969
+ * with the application. SQL remains authority across lease expiry. */
1970
+ export declare const makeRoomGeometryReloadSource: (offered: RoomGeometryReloadSourceOptions) => Context.Service.Shape<typeof RoomGeometryReloadPort>;
1971
+
1972
+ /** Actual native resource, after default cell loader or a selected real Port.
1973
+ * Owns CPU frame/navigation; release must join app-owned room-specific readers.
1974
+ * Borrowed global SQL/Registry pools are never closed by this helper. */
1975
+ export declare const makeRoomGeometryResource: (offeredWorld: AnyWorldDescriptor, offeredScope: RoomGeometryOwnerScope, offeredInventory: GeometryPreparedInventory, release: () => Promise<void>, offeredDirectory?: RoomGeometryDirectoryLifetime, mutationFactory?: RoomGeometryMutationFactory, streamFactory?: RoomGeometryStreamFactory, maxSubjectFences?: number) => RoomGeometryResource;
1976
+
1977
+ /** Same real SQL preparation/native coordinator/original physical leases. Weak
1978
+ * Resource-owned bounded jobs retain exact local unknown outcomes; no pool,
1979
+ * automatic backend fallback, process recovery or durable job table. */
1980
+ export declare const makeRoomGeometryRollbackSource: (offered: RoomGeometryRollbackSourceOptions) => Context.Service.Shape<typeof RoomGeometryRollbackPort>;
1981
+
1982
+ /** Normal optional read-only Host ingress. Callback captures native intentions
1983
+ * only; actual rights/SQL/static/hash/reply run in awaited outside-Tick pump. */
1984
+ export declare const makeRoomGeometrySnapshotServer: (offeredResource: RoomGeometryResource, currentSessions: () => ReadonlyArray<unknown>, offered: RoomGeometrySnapshotServerOptions) => RoomGeometrySnapshotServer;
1985
+
1986
+ /** Actual optional static/dynamic Host graph. SQL/source metadata happens in the
1987
+ * awaited control pump, never in actor Tick; only new roster/CPU/invalidation
1988
+ * stamp triggers publication. Rights changes must explicitly invalidate. */
1989
+ export declare const makeRoomGeometryStreams: (offeredResource: RoomGeometryResource, currentSessions: () => ReadonlyArray<unknown>, offered: RoomGeometryStreamOptions) => RoomGeometryStreamLifetime;
1990
+
1991
+ declare class NotRoomMember extends NotRoomMember_base {
1992
+ }
1993
+
1994
+ declare const NotRoomMember_base: Schema.Class<NotRoomMember, Schema.TaggedStruct<"NotRoomMember", {
1995
+ readonly sessionId: Schema.String;
1996
+ }>, YieldableError>;
1997
+
1998
+ /** Real separate native thread; package asset and World module come from the
1999
+ * explicit app's ordinary installed dependency. No guessed callback serialization,
2000
+ * implicit source transpilation/eval, fallback generator, Store/Tick or inherited secrets. */
2001
+ export declare const openGeometryProceduralWorker: (offeredWorld: AnyWorldDescriptor, offered: GeometryProceduralWorkerOptions) => Effect.Effect<GeometryProceduralWorker, GeometryPersistenceError>;
2002
+
2003
+ declare interface PreparedCommon {
2004
+ readonly scope: GeometryPersistenceScope;
2005
+ readonly revision: number;
2006
+ readonly blobSha256: string;
2007
+ readonly contentSha256: string;
2008
+ readonly accountedBytes: number;
2009
+ }
2010
+
2011
+ /** Outside-Tick genuine before-frame -> actual Delta/digests/native query views
2012
+ * under original inventory budgets -> selected trusted server commit -> sealed
2013
+ * CPU activation. No player RPC, automatic actor callback or reliable delivery. */
2014
+ export declare const prepareGeometryActivation: (actor: GeometryActorInventory, source: Pick<GeometryCommitCoordinator, "commit">, offeredInput: GeometryPersistenceCommit, offered?: GeometryActivationOptions) => Effect.Effect<GeometryActivation, GeometryCommitCoordinatorError>;
2015
+
2016
+ /** Same actual source/SQL/static Ports; no private table/read pool/current version
2017
+ * inference, full static blob socket transfer or Tick installation. */
2018
+ export declare const prepareGeometryChunkSnapshot: (offeredScope: GeometryPersistenceScope, offeredRequest: string, offered: GeometrySnapshotPreparationOptions) => Effect.Effect<GeometryChunkSnapshot, GeometryPersistenceError>;
2019
+
2020
+ /** Native canonical hashing and normal manifest capture for offline imports or
2021
+ * author producers. No provider/SQL/Tick acquisition and no fabricated receipt. */
2022
+ export declare const prepareGeometryImportPublication: (offeredTenant: string, offeredChunks: ReadonlyArray<GeometryChunk>, offeredOptions?: GeometryImportPublicationOptions) => Promise<GeometryImportPublication>;
2023
+
2024
+ /** Outside-Tick native admission + captured server facts + intent-only default
2025
+ * guard/rule slots -> actual native artifact/GPD. No Store/Hot/network work.
2026
+ * Retain this exact server commit across unknown results; do not derive a new
2027
+ * operation from changed terrain when retrying the same request. */
2028
+ export declare const prepareGeometryPlayerCommit: (actor: GeometryActorInventory, offered: GeometryPlayerEditRequest, offeredAuthority: GeometryEditAuthority, offeredStrategies?: Partial<GeometryEditStrategies>) => Effect.Effect<GeometryPersistenceCommit, ProtocolError | BudgetExceeded>;
2029
+
2030
+ /** Actual confirmed per-chunk migration/replay +normal SQL rebuild, then sealed
2031
+ * whole native inventory. Partial SQL progress retains receipts; CPU unchanged
2032
+ * until explicit activateVersion, never a transaction-wide rollback inference. */
2033
+ export declare const prepareGeometryVersionActivation: (actor: GeometryActorInventory, offeredWorld: AnyWorldDescriptor, offered: {
2034
+ readonly owner: GeometryPersistenceOwner;
2035
+ readonly version: string;
2036
+ readonly requestId: string;
2037
+ }, options: GeometryVersionActivationOptions) => Effect.Effect<GeometryVersionActivation, GeometryPersistenceError>;
2038
+
2039
+ export declare const prepareGeometryVersionMigration: (offeredWorld: AnyWorldDescriptor, offeredInput: GeometryVersionMigrationInput, offeredOptions?: GeometryVersionMigrationOptions) => Effect.Effect<GeometryPreparedVersionMigration, GeometryPersistenceError>;
2040
+
2041
+ /** Whole explicit authored inventory, outside Tick. Actual owned Workers stop
2042
+ * scheduling on failure, join accepted jobs and all native exits. SQL/Storage
2043
+ * publication stays explicit; this cannot grow an existing immutable manifest. */
2044
+ export declare const prepareProceduralGeometryPublication: (offeredWorld: AnyWorldDescriptor, offeredRoot: GeometryPreparedScope, offeredCoordinates: ReadonlyArray<GeometryPreparedCoordinate>, offeredWorker: GeometryProceduralWorkerOptions, offeredOptions?: GeometryProceduralPublicationOptions) => Effect.Effect<GeometryImportPublication, GeometryPersistenceError>;
2045
+
2046
+ declare class ProtocolError extends ProtocolError_base {
2047
+ get message(): string;
2048
+ }
2049
+
2050
+ declare const ProtocolError_base: Schema.Class<ProtocolError, Schema.TaggedStruct<"ProtocolError", {
2051
+ readonly detail: Schema.String;
2052
+ }>, YieldableError>;
2053
+
2054
+ /** Whole owned genuine author inventory -> actual deterministic Storage writes
2055
+ * -> exact atomic SQL manifest. Stop scheduling after a failure and join all
2056
+ * started writes. No partial manifest/empty chunk, automatic retry or unsafe
2057
+ * orphan deletion. Repeat the same artifacts after unknown outcomes; actual
2058
+ * claim/version-retirement lifecycle must resolve unreferenced stored objects. */
2059
+ export declare const publishGeometryArtifacts: (offeredWorld: AnyWorldDescriptor, offeredStorage: GeometryStorage, offeredSource: Pick<Context.Service.Shape<typeof GeometryPersistencePort>, "publish">, offeredInput: GeometryArtifactPublication, offered?: GeometryArtifactPublicationOptions) => Effect.Effect<GeometryVersionReceipt, GeometryPersistenceError>;
2060
+
2061
+ /** `select` for World cell Rooms: the recorded cell (the World allocation records it before the Room installs)
2062
+ * with your layer set and version. A Room without a recorded cell is not a World cell Room and fails. */
2063
+ export declare const recordedGeometryPlacement: (worlds: ReadonlyArray<AnyWorldDescriptor>, recorded: WorldCellIdentity | null, choice: {
2064
+ readonly layerSetId: string;
2065
+ readonly version: string;
2066
+ readonly load?: GeometryPreparedCellLoadOptions;
2067
+ }) => Effect.Effect<RoomGeometryPlacement, GeometryPersistenceError>;
2068
+
2069
+ declare class RoomAuthoringError extends RoomAuthoringError_base {
2070
+ get message(): string;
2071
+ }
2072
+
2073
+ declare const RoomAuthoringError_base: Schema.Class<RoomAuthoringError, Schema.TaggedStruct<"RoomAuthoringError", {
2074
+ readonly room: Schema.String;
2075
+ readonly detail: Schema.String;
2076
+ }>, YieldableError>;
2077
+
2078
+ declare type RoomControlError = ProtocolError | BudgetExceeded | NotRoomMember | RoomAuthoringError | RoomForbidden | RoomFull | RoomGone | RoomLocked | RoomPoolWaking | RoomsClosed | SeatExpired;
2079
+
2080
+ declare class RoomForbidden extends RoomForbidden_base {
2081
+ }
2082
+
2083
+ declare const RoomForbidden_base: Schema.Class<RoomForbidden, Schema.TaggedStruct<"RoomForbidden", {
2084
+ readonly roomId: Schema.String;
2085
+ }>, YieldableError>;
2086
+
2087
+ declare class RoomFull extends RoomFull_base {
2088
+ }
2089
+
2090
+ declare const RoomFull_base: Schema.Class<RoomFull, Schema.TaggedStruct<"RoomFull", {
2091
+ readonly roomId: Schema.String;
2092
+ }>, YieldableError>;
2093
+
2094
+ export declare const roomGeometryAdministrationLayer: (source: Context.Service.Shape<typeof RoomGeometryAdministrationPort>) => Layer.Layer<RoomGeometryAdministrationPort>;
2095
+
2096
+ /** API administration resolves actual current SQL Host; wire inputs never select it. */
2097
+ export declare class RoomGeometryAdministrationPort extends RoomGeometryAdministrationPort_base {
2098
+ }
2099
+
2100
+ declare const RoomGeometryAdministrationPort_base: Context.ServiceClass<RoomGeometryAdministrationPort, "@voltro/RoomGeometryAdministrationPort", {
2101
+ reload(roomId: string, request: RoomGeometryReloadRequest, subject: Subject): Effect.Effect<void, GeometryPersistenceError>;
2102
+ rollback(roomId: string, request: RoomGeometryRollbackRequest, subject: Subject): Effect.Effect<void, GeometryPersistenceError>;
2103
+ /** The chunk view: present when the administration knows the Worlds. */
2104
+ readonly chunks?: (roomId: string, subject: Subject) => Effect.Effect<RoomGeometryChunks, GeometryPersistenceError>;
2105
+ }>;
2106
+
2107
+ /** The changed chunks a World cell Room owns, newest first. `truncated` when more exist than the read returns. */
2108
+ export declare interface RoomGeometryChunks {
2109
+ readonly roomId: string;
2110
+ readonly worldId: string;
2111
+ readonly zoneId: string;
2112
+ readonly cellId: string;
2113
+ readonly chunks: ReadonlyArray<RoomGeometryChunkState>;
2114
+ readonly truncated: boolean;
2115
+ }
2116
+
2117
+ /** One chunk a World cell Room owns that players changed: its durable revision and whether it
2118
+ * still differs from its static version (`changed: false` after a reset). */
2119
+ export declare interface RoomGeometryChunkState {
2120
+ readonly cx: number;
2121
+ readonly cy: number;
2122
+ readonly cz?: number | undefined;
2123
+ readonly layerSetId: string;
2124
+ readonly version: string;
2125
+ readonly revision: number;
2126
+ readonly changed: boolean;
2127
+ readonly updatedAt: number;
2128
+ }
2129
+
2130
+ /** Existing authenticated API-to-Host carrier. Caller authority must be
2131
+ * resolved again at the actual Host; success joins native CPU admission and
2132
+ * retained cleanup, never merely receipt publication. No player state input. */
2133
+ export declare class RoomGeometryControlPort extends RoomGeometryControlPort_base {
2134
+ }
2135
+
2136
+ declare const RoomGeometryControlPort_base: Context.ServiceClass<RoomGeometryControlPort, "@voltro/RoomGeometryControlPort", {
2137
+ reload(hostId: string, roomId: string, request: RoomGeometryReloadRequest, subject: Subject): Effect.Effect<void, RoomControlError>;
2138
+ rollback(hostId: string, roomId: string, request: RoomGeometryRollbackRequest, subject: Subject): Effect.Effect<void, RoomControlError>;
2139
+ }>;
2140
+
2141
+ export declare interface RoomGeometryDirectoryBindingOptions {
2142
+ readonly reload?: Context.Service.Shape<typeof RoomGeometryReloadPort>;
2143
+ readonly rollback?: Context.Service.Shape<typeof RoomGeometryRollbackPort>;
2144
+ readonly worlds: ReadonlyArray<AnyWorldDescriptor>;
2145
+ readonly epochNow: () => number;
2146
+ readonly maxListedCells: number;
2147
+ readonly authorize: WorldCellDirectoryOptions['authorize'];
2148
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
2149
+ /** Current source/placement rights and version selection remain actual app
2150
+ * capabilities. A recorded placement fixes the cell/layer on recovery. */
2151
+ /** Actual synchronously acquired graph; all I/O dependencies are already borrowed. */
2152
+ readonly streams?: RoomGeometryStreamFactory;
2153
+ readonly maxSubjectFences?: number;
2154
+ readonly mutations?: RoomGeometryMutationFactory;
2155
+ readonly select: (scope: RoomGeometryOwnerScope, recorded: WorldCellIdentity | null) => Effect.Effect<RoomGeometryPlacement, GeometryPersistenceError>;
2156
+ }
2157
+
2158
+ export declare interface RoomGeometryDirectoryLifetime {
2159
+ readonly synchronize: () => Promise<void>;
2160
+ }
2161
+
2162
+ export declare type RoomGeometryMutationFactory = (resource: RoomGeometryResource, currentSessions: () => ReadonlyArray<unknown>) => RoomGeometryMutationLifetime;
2163
+
2164
+ export declare interface RoomGeometryMutationLifetime {
2165
+ readonly channel: string;
2166
+ readonly publicationChannel: string;
2167
+ stage(actualSession: unknown, message: unknown): void;
2168
+ discardUnsubmitted(target: GeometryPrivacyTarget): Promise<boolean>;
2169
+ withdrawSubject(target: GeometryPrivacyTarget): Promise<void>;
2170
+ eraseSubject(target: GeometryPrivacyTarget): Promise<void>;
2171
+ fence(): void;
2172
+ pump(): Promise<void>;
2173
+ close(): Promise<void>;
2174
+ }
2175
+
2176
+ export declare interface RoomGeometryMutationOptions {
2177
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
2178
+ readonly leases: GeometryChunkLeases;
2179
+ readonly now: () => number;
2180
+ readonly resolveSubject: GeometryEditIngressOptions['resolveSubject'];
2181
+ readonly authorizeIntent: GeometryPlayerEditOwnerOptions['authorizeIntent'];
2182
+ readonly authorizeRecipient: GeometryReliablePublicationOptions['authorizeRecipient'];
2183
+ readonly channel?: string | undefined;
2184
+ readonly coordinator?: Omit<GeometryCommitCoordinatorOptions, 'tenantId'>;
2185
+ readonly edits?: Omit<GeometryPlayerEditOwnerOptions, 'tenantId' | 'now' | 'authorizeIntent' | 'publishCommitted'>;
2186
+ readonly ingress?: Pick<GeometryEditIngressOptions, 'maxPending' | 'maxPerPump' | 'maxSubjectFences'>;
2187
+ readonly publication?: Pick<GeometryReliablePublicationOptions, 'channel' | 'maxRecipients' | 'maxPatchBytes' | 'maxFragmentDeliveries'> | undefined;
2188
+ }
2189
+
2190
+ export declare interface RoomGeometryOwnerScope {
2191
+ readonly roomId: string;
2192
+ readonly tenantId: string;
2193
+ readonly hostId: string;
2194
+ readonly epoch: number;
2195
+ readonly name: string;
2196
+ }
2197
+
2198
+ /** Server selection only. This is never read from player options/metadata. */
2199
+ export declare interface RoomGeometryPlacement {
2200
+ readonly worldId: string;
2201
+ readonly zoneId: string;
2202
+ readonly at: WorldPoint;
2203
+ readonly layer: number;
2204
+ readonly layerSetId: string;
2205
+ readonly version: string;
2206
+ readonly load?: GeometryPreparedCellLoadOptions;
2207
+ }
2208
+
2209
+ export declare const roomGeometryReloadLayer: (service: Context.Service.Shape<typeof RoomGeometryReloadPort>) => Layer.Layer<RoomGeometryReloadPort>;
2210
+
2211
+ /** Trusted administrative source. The real provider owns migration Ports,
2212
+ * chunk leases/renewals/unknown outcomes and idempotent cleanup for each exact
2213
+ * Room owner/request. No permissive authorization or lease substitute exists. */
2214
+ export declare class RoomGeometryReloadPort extends RoomGeometryReloadPort_base {
2215
+ }
2216
+
2217
+ declare const RoomGeometryReloadPort_base: Context.ServiceClass<RoomGeometryReloadPort, "@voltro/RoomGeometryReloadPort", {
2218
+ authorize(subject: Subject, resource: RoomGeometryResource, request: RoomGeometryReloadRequest): Effect.Effect<void, GeometryPersistenceError>;
2219
+ prepare(resource: RoomGeometryResource, request: RoomGeometryReloadRequest): Effect.Effect<GeometryVersionActivation, GeometryPersistenceError>;
2220
+ /** Reacquire/renew actual coordination and verify the retained preparation
2221
+ * against current SQL before a token retry. No automatic stale-token success. */
2222
+ resume(resource: RoomGeometryResource, request: RoomGeometryReloadRequest, token: GeometryVersionActivation): Effect.Effect<void, GeometryPersistenceError>;
2223
+ /** Compare-only coordination cleanup; never discard durable migration receipts.
2224
+ * Must work after actor/Room withdrawal with the captured owner/request scope. */
2225
+ release(resource: RoomGeometryResource, request: RoomGeometryReloadRequest): Effect.Effect<void, GeometryPersistenceError>;
2226
+ }>;
2227
+
2228
+ export declare interface RoomGeometryReloadRequest {
2229
+ readonly version: string;
2230
+ readonly requestId: string;
2231
+ }
2232
+
2233
+ /** Administrative intentions only; Host resolves World/current owner/native bytes. */
2234
+ export declare const RoomGeometryReloadRequestSchema: Schema.Struct<{
2235
+ readonly version: Schema.String;
2236
+ readonly requestId: Schema.String;
2237
+ }>;
2238
+
2239
+ export declare interface RoomGeometryReloadSourceOptions {
2240
+ readonly authorize: (subject: Subject, resource: RoomGeometryResource, request: RoomGeometryReloadRequest) => Effect.Effect<void, GeometryPersistenceError>;
2241
+ readonly migrations: Context.Service.Shape<typeof GeometryVersionMigrationPort>;
2242
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
2243
+ /** Actual app-owned tenant HotStore-backed leases, never a read fallback. */
2244
+ readonly leases: (resource: RoomGeometryResource) => Effect.Effect<GeometryChunkLeases, GeometryPersistenceError>;
2245
+ readonly maxChunks?: number | undefined;
2246
+ readonly maxAccountedBytes?: number;
2247
+ }
2248
+
2249
+ export declare interface RoomGeometryResource {
2250
+ readonly scope: RoomGeometryOwnerScope;
2251
+ readonly world: AnyWorldDescriptor;
2252
+ readonly inventory: GeometryActorInventory;
2253
+ readonly view: GeometryWorldView;
2254
+ /** Trusted local unsubmitted discard; never a global rejection/SQL receipt. */
2255
+ /** Trusted visibility/source invalidation, queued for the actual Host pump. */
2256
+ invalidateStreams(): void;
2257
+ discardUnsubmitted(target: GeometryPrivacyTarget): Promise<boolean>;
2258
+ /** Writer lifetime only; actual SQL/reader/content erasure stays on the selected source. */
2259
+ withdrawSubject(target: GeometryPrivacyTarget): Promise<void>;
2260
+ eraseSubject(target: GeometryPrivacyTarget): Promise<void>;
2261
+ /** Outside-Tick SQL publication/refresh after the actual Room boundary. */
2262
+ synchronize(): Promise<void>;
2263
+ /** Fence and join both channel graphs without closing the native CPU frame.
2264
+ * Retired graphs stay retired; this alone never installs a new version. */
2265
+ quiesce(): Promise<void>;
2266
+ close(): Promise<void>;
2267
+ }
2268
+
2269
+ export declare const roomGeometryRollbackLayer: (source: Context.Service.Shape<typeof RoomGeometryRollbackPort>) => Layer.Layer<RoomGeometryRollbackPort>;
2270
+
2271
+ export declare class RoomGeometryRollbackPort extends RoomGeometryRollbackPort_base {
2272
+ }
2273
+
2274
+ declare const RoomGeometryRollbackPort_base: Context.ServiceClass<RoomGeometryRollbackPort, "@voltro/RoomGeometryRollbackPort", {
2275
+ authorize(subject: Subject, resource: RoomGeometryResource, request: RoomGeometryRollbackRequest): Effect.Effect<void, GeometryPersistenceError>;
2276
+ prepare(subject: Subject, resource: RoomGeometryResource, request: RoomGeometryRollbackRequest): Effect.Effect<GeometryActivation, GeometryPersistenceError>;
2277
+ resume(subject: Subject, resource: RoomGeometryResource, request: RoomGeometryRollbackRequest, token: GeometryActivation): Effect.Effect<void, GeometryPersistenceError>;
2278
+ /** Real owned coordination cleanup after failure or success, including after
2279
+ * Resource close. Unknown durable outcomes must remain retained. */
2280
+ release(resource: RoomGeometryResource, request: RoomGeometryRollbackRequest): Effect.Effect<void, GeometryPersistenceError>;
2281
+ }>;
2282
+
2283
+ /** Administrative intention only. World/version/owner/authority/baseline/patch
2284
+ * are resolved by the actual Host/source, never accepted as client state. */
2285
+ export declare interface RoomGeometryRollbackRequest {
2286
+ readonly cx: number;
2287
+ readonly cy: number;
2288
+ readonly cz?: number | undefined;
2289
+ /** The actor whose changes are undone; `null` undoes every actor's changes (chunk reset to its static baseline). */
2290
+ readonly target: GeometryPersistenceSubject | null;
2291
+ readonly requestId: string;
2292
+ }
2293
+
2294
+ export declare const RoomGeometryRollbackRequestSchema: Schema.Struct<{
2295
+ readonly cx: Schema.Int;
2296
+ readonly cy: Schema.Int;
2297
+ readonly cz: Schema.optional<Schema.Int>;
2298
+ readonly target: Schema.NullOr<Schema.Struct<{
2299
+ readonly id: Schema.String;
2300
+ readonly kind: Schema.Literals<readonly ["user", "guest"]>;
2301
+ }>>;
2302
+ readonly requestId: Schema.String;
2303
+ }>;
2304
+
2305
+ export declare interface RoomGeometryRollbackSourceOptions {
2306
+ readonly authorize: (subject: Subject, resource: RoomGeometryResource, request: RoomGeometryRollbackRequest) => Effect.Effect<void, GeometryPersistenceError>;
2307
+ readonly preparation: Context.Service.Shape<typeof GeometryRollbackPreparationPort>;
2308
+ readonly persistence: Context.Service.Shape<typeof GeometryPersistencePort>;
2309
+ readonly leases: (resource: RoomGeometryResource) => Effect.Effect<GeometryChunkLeases, GeometryPersistenceError>;
2310
+ readonly maxJobsPerResource?: number;
2311
+ readonly maxPatchBytes?: number | undefined;
2312
+ readonly maxPendingBytes?: number | undefined;
2313
+ }
2314
+
2315
+ export declare interface RoomGeometrySnapshotServer {
2316
+ readonly requestChannel: string;
2317
+ readonly responseChannel: string;
2318
+ stage(actualSession: unknown, message: unknown): void;
2319
+ withdrawSubject(target: GeometryPrivacyTarget): Promise<void>;
2320
+ fence(): void;
2321
+ pump(): Promise<void>;
2322
+ close(): Promise<void>;
2323
+ }
2324
+
2325
+ export declare interface RoomGeometrySnapshotServerOptions extends Omit<GeometrySnapshotPreparationOptions, 'authorize'> {
2326
+ readonly resolveSubject: (recipient: GeometryPublicationRecipient) => Effect.Effect<GeometryPersistenceSubject, GeometryPersistenceError>;
2327
+ readonly authorize: (recipient: GeometryPublicationRecipient, scope: GeometryPersistenceScope) => Effect.Effect<void, GeometryPersistenceError>;
2328
+ readonly requestChannel?: string;
2329
+ readonly responseChannel?: string;
2330
+ readonly maxPending?: number | undefined;
2331
+ readonly maxPerPump?: number;
2332
+ readonly maxFragmentDeliveries?: number;
2333
+ readonly maxSubjectFences?: number;
2334
+ readonly maxPendingSnapshotBytes?: number;
2335
+ }
2336
+
2337
+ export declare type RoomGeometryStreamFactory = (resource: RoomGeometryResource, currentSessions: () => ReadonlyArray<unknown>) => RoomGeometryStreamLifetime;
2338
+
2339
+ export declare interface RoomGeometryStreamLifetime {
2340
+ readonly channel: string;
2341
+ readonly recovery?: RoomGeometrySnapshotServer;
2342
+ invalidate(): void;
2343
+ withdrawSubject(target: GeometryPrivacyTarget): Promise<void>;
2344
+ fence(): void;
2345
+ pump(): Promise<void>;
2346
+ close(): Promise<void>;
2347
+ }
2348
+
2349
+ export declare interface RoomGeometryStreamOptions extends Omit<GeometryManifestPublicationOptions, 'scope' | 'owner' | 'currentSessions'> {
2350
+ /** Actual current server Subject.kind lookup; native seat IDs do not infer it. */
2351
+ readonly resolveSubject: (recipient: GeometryPublicationRecipient) => Effect.Effect<GeometryPersistenceSubject, GeometryPersistenceError>;
2352
+ readonly maxSubjectFences?: number;
2353
+ readonly recovery?: RoomGeometrySnapshotServerOptions;
2354
+ }
2355
+
2356
+ declare class RoomGone extends RoomGone_base {
2357
+ }
2358
+
2359
+ declare const RoomGone_base: Schema.Class<RoomGone, Schema.TaggedStruct<"RoomGone", {
2360
+ readonly roomId: Schema.String;
2361
+ }>, YieldableError>;
2362
+
2363
+ export declare interface RoomHostGeometryBinding {
2364
+ readonly reload?: Context.Service.Shape<typeof RoomGeometryReloadPort>;
2365
+ readonly rollback?: Context.Service.Shape<typeof RoomGeometryRollbackPort>;
2366
+ readonly worlds: ReadonlyArray<AnyWorldDescriptor>;
2367
+ /** Trusted placement/source authorization + complete cell/margin loading,
2368
+ * before actor creation. No player metadata is a World ownership proof. */
2369
+ readonly prepare: (scope: RoomGeometryOwnerScope) => Effect.Effect<RoomGeometryResource, GeometryPersistenceError>;
2370
+ /** After exact creating-Room compensation, retire any actual SQL placement. */
2371
+ readonly cleanupCreation?: (scope: RoomGeometryOwnerScope) => Effect.Effect<void, GeometryPersistenceError>;
2372
+ }
2373
+
2374
+ declare class RoomLocked extends RoomLocked_base {
2375
+ }
2376
+
2377
+ declare const RoomLocked_base: Schema.Class<RoomLocked, Schema.TaggedStruct<"RoomLocked", {
2378
+ readonly roomId: Schema.String;
2379
+ }>, YieldableError>;
2380
+
2381
+ /** The pool has no host because it scaled to zero; one is starting. Reserve again after `retryAfterMs`. */
2382
+ declare class RoomPoolWaking extends RoomPoolWaking_base {
2383
+ }
2384
+
2385
+ declare const RoomPoolWaking_base: Schema.Class<RoomPoolWaking, Schema.TaggedStruct<"RoomPoolWaking", {
2386
+ readonly pool: Schema.String;
2387
+ readonly retryAfterMs: Schema.Number;
2388
+ }>, YieldableError>;
2389
+
2390
+ /** New Room reservations are closed for this caller (maintenance, a kill switch...): the app's
2391
+ * `admission` refused. `until`: epoch ms when they reopen, if known; `messageKey`: the app's text. */
2392
+ declare class RoomsClosed extends RoomsClosed_base {
2393
+ }
2394
+
2395
+ declare const RoomsClosed_base: Schema.Class<RoomsClosed, Schema.TaggedStruct<"RoomsClosed", {
2396
+ readonly until: Schema.NullOr<Schema.Number>;
2397
+ readonly messageKey: Schema.String;
2398
+ }>, YieldableError>;
2399
+
2400
+ export declare interface RoomsGeometryHttpOptions {
2401
+ /** Explicit distinct path for this installed plugin instance. */
2402
+ readonly path: string;
2403
+ /** Existing app authentication; raw plugin HTTP routes have no RPC Subject. */
2404
+ readonly resolveSubject: (request: PluginHttpRouteRequest) => Promise<Subject>;
2405
+ /** Current World/layer/version/chunk visibility, not an ID-based grant. */
2406
+ readonly authorizeRead: (scope: GeometryPersistenceScope, subject: Subject) => Effect.Effect<void, ProtocolError>;
2407
+ readonly maxResponseBytes?: number;
2408
+ }
2409
+
2410
+ /** Normal raw HTTP contribution. Authentication, permanent SQL Subject fence
2411
+ * and current explicit read policy precede the owner's actual source Port.
2412
+ * No anonymous, digest-only grant, private SQL source or fabricated CORS. */
2413
+ export declare const roomsGeometryHttpRoute: (worlds: ReadonlyArray<AnyWorldDescriptor>, service: Context.Service.Shape<typeof GeometryPersistencePort>, offered: RoomsGeometryHttpOptions) => PluginHttpRoute;
2414
+
2415
+ declare class SeatExpired extends SeatExpired_base {
2416
+ }
2417
+
2418
+ declare const SeatExpired_base: Schema.Class<SeatExpired, Schema.TaggedStruct<"SeatExpired", {
2419
+ readonly sessionId: Schema.String;
2420
+ }>, YieldableError>;
2421
+
2422
+ /** Borrow normal StorageService/SQL operation metadata, including its existing
2423
+ * Registry/provider/claim/stream lifetime. No private pool, memory fallback,
2424
+ * second object journal, CDN token, source-version switch or Tick installation. */
2425
+ export declare const storageGeometry: (offeredStorage: Pick<StorageServiceShape, "put" | "head" | "getStream" | "delete">, offered: GeometryStorageOptions) => GeometryStorage;
2426
+
2427
+ /** Actual published catalogue ->Storage head/current access mint ->catalogue+
2428
+ * head/current rights recheck. No guessed file/URL, grant cache, fallback,
2429
+ * private Storage/SQL connection, new table or graphics/asset decoder. */
2430
+ export declare const storageGeometryAssetReadGrants: (offeredStorage: Pick<StorageServiceShape, "head" | "mintUrl">, offered: GeometryAssetStorageGrantOptions) => GeometryAssetStorageGrants;
2431
+
2432
+ /** Actual normal StorageService/SQL named operation+claim, storing the original
2433
+ * canonical GPD bytes privately. This never deletes SQL receipts or compacts a
2434
+ * journal; future SQL archive selection must retain its durable index. */
2435
+ export declare const storageGeometryJournal: (storage: Pick<StorageServiceShape, "put" | "head" | "getStream" | "delete">, offered: GeometryJournalStorageOptions) => Context.Service.Shape<typeof GeometryJournalArchivePort>;
2436
+
2437
+ /** Existing durable operation+held claim ->actual Storage head/access mint URL.
2438
+ * Borrowed Registry/provider/SQL/token issuer; no guessed ref, URL or credential. */
2439
+ export declare const storageGeometryReadGrants: (offeredStorage: Pick<StorageServiceShape, "head" | "mintUrl">, offered: GeometryStorageReadGrantOptions) => GeometryStorageReadGrants;
2440
+
2441
+ declare const Transform2D: Schema.Struct<{
2442
+ readonly x: Schema.Number;
2443
+ readonly y: Schema.Number;
2444
+ readonly rot: Schema.Number;
2445
+ readonly vx: Schema.optional<Schema.Number>;
2446
+ readonly vy: Schema.optional<Schema.Number>;
2447
+ }>;
2448
+
2449
+ declare type Transform2D = (typeof Transform2D)["Type"];
2450
+
2451
+ declare type WorldBounds = readonly [minimum: WorldPoint, maximum: WorldPoint];
2452
+
2453
+ declare interface WorldCell {
2454
+ readonly id: string;
2455
+ readonly zone: string;
2456
+ readonly column: number;
2457
+ readonly row: number;
2458
+ readonly bounds: WorldBounds;
2459
+ }
2460
+
2461
+ declare interface WorldCellDirectoryOptions {
2462
+ readonly worlds: ReadonlyArray<AnyWorldDescriptor>;
2463
+ readonly epochNow: () => number;
2464
+ readonly maxListedCells: number;
2465
+ /** Real server scope authorization. No implicit client/host assertion is trusted. */
2466
+ readonly authorize: (operation: 'publish' | 'observe' | 'list' | 'remove', scope: WorldCellScope) => Effect.Effect<void, ProtocolError>;
2467
+ }
2468
+
2469
+ declare interface WorldCellIdentity extends WorldCellScope {
2470
+ readonly zoneId: string;
2471
+ readonly cellId: string;
2472
+ readonly layer: number;
2473
+ }
2474
+
2475
+ declare interface WorldCellScope {
2476
+ readonly tenantId: string;
2477
+ readonly worldId: string;
2478
+ }
2479
+
2480
+ declare interface WorldDefinition<Player> {
2481
+ readonly name: string;
2482
+ readonly map: {
2483
+ readonly bounds: WorldBounds;
2484
+ };
2485
+ readonly zones: ReadonlyArray<WorldZone>;
2486
+ readonly instances?: ReadonlyArray<WorldInstance>;
2487
+ readonly persistence: {
2488
+ readonly entities: 'world';
2489
+ readonly snapshotEveryMs: number;
2490
+ readonly journal: boolean;
2491
+ };
2492
+ readonly handoff: {
2493
+ readonly marginUnits: number;
2494
+ readonly ghostUnits: number;
2495
+ };
2496
+ readonly spawn: (context: {
2497
+ readonly player: Player;
2498
+ }) => WorldPosition;
2499
+ readonly geometry?: WorldGeometryDefinition | undefined;
2500
+ readonly hosts?: {
2501
+ readonly pool: string;
2502
+ };
2503
+ readonly characters?: 'shared' | 'per-world';
2504
+ readonly transitionCooldownMs?: number;
2505
+ /** Authoring inventory bounds, not measured runtime capacity. */
2506
+ readonly budgets?: {
2507
+ readonly maxZones?: number;
2508
+ readonly maxCells?: number | undefined;
2509
+ readonly maxInstances?: number;
2510
+ };
2511
+ readonly strategies?: {
2512
+ readonly layerPolicy?: WorldLayerPolicy | undefined;
2513
+ readonly transitionPolicy?: WorldTransitionPolicy;
2514
+ readonly onWorldChange?: WorldOnWorldChange;
2515
+ };
2516
+ }
2517
+
2518
+ declare interface WorldDescriptor<Player> extends Omit<WorldDefinition<Player>, 'instances' | 'budgets' | 'characters' | 'transitionCooldownMs' | 'strategies' | 'geometry'> {
2519
+ readonly geometry?: WorldGeometryDescriptor | undefined;
2520
+ readonly _tag: 'WorldDescriptor';
2521
+ readonly instances: ReadonlyArray<Omit<WorldInstance, 'ttl'> & {
2522
+ readonly ttlMs: number;
2523
+ }>;
2524
+ readonly budgets: {
2525
+ readonly maxZones: number;
2526
+ readonly maxCells: number;
2527
+ readonly maxInstances: number;
2528
+ };
2529
+ readonly characters: 'shared' | 'per-world';
2530
+ readonly transitionCooldownMs: number;
2531
+ readonly cellCount: number;
2532
+ readonly strategies: {
2533
+ readonly layerPolicy: WorldLayerPolicy;
2534
+ readonly transitionPolicy: WorldTransitionPolicy;
2535
+ readonly onWorldChange: WorldOnWorldChange;
2536
+ };
2537
+ }
2538
+
2539
+ /** The Subject of a player in a World cell Room, read from its World entity in that Room: the World binding
2540
+ * records the actual user or guest kind when the seat is admitted. No entity of that player in that Room fails. */
2541
+ export declare const worldEntityGeometrySubject: (store: DataStore) => (recipient: {
2542
+ readonly tenantId: string;
2543
+ readonly roomId: string;
2544
+ readonly subjectId: string;
2545
+ }) => Effect.Effect<GeometryPersistenceSubject, ProtocolError>;
2546
+
2547
+ declare interface WorldGeometryDefinition {
2548
+ readonly strategies?: WorldGeometryStrategies | undefined;
2549
+ readonly kind: GeometryKind;
2550
+ readonly static: GeometrySource;
2551
+ readonly chunkSize?: number;
2552
+ readonly dynamic?: {
2553
+ readonly enabled?: boolean | undefined;
2554
+ readonly maxDeltaBytesPerChunk?: number;
2555
+ readonly persist?: {
2556
+ readonly everyMs?: number;
2557
+ readonly onUnload?: boolean;
2558
+ };
2559
+ };
2560
+ readonly collision?: {
2561
+ readonly derive?: 'bitgrid' | 'heightfield' | 'shapes';
2562
+ readonly resolution?: number;
2563
+ };
2564
+ readonly nav?: {
2565
+ readonly derive?: 'grid' | 'none';
2566
+ readonly navBudgetMs?: number;
2567
+ readonly maxAdvanceSteps?: number;
2568
+ };
2569
+ readonly streaming?: {
2570
+ readonly client?: {
2571
+ readonly radiusChunks?: number;
2572
+ readonly prefetchChunks?: number;
2573
+ readonly maxConcurrent?: number | undefined;
2574
+ readonly maxCachedChunks?: number;
2575
+ };
2576
+ readonly cell?: {
2577
+ readonly marginChunks?: number;
2578
+ };
2579
+ };
2580
+ readonly lod?: ReadonlyArray<{
2581
+ readonly beyondChunks: number;
2582
+ readonly fields: ReadonlyArray<string>;
2583
+ }>;
2584
+ readonly budgets?: {
2585
+ readonly maxPreparedChunks?: number;
2586
+ readonly maxPreparedBytes?: number;
2587
+ readonly maxLodLevels?: number;
2588
+ readonly maxRayCells?: number | undefined;
2589
+ readonly maxOverlapTests?: number | undefined;
2590
+ };
2591
+ }
2592
+
2593
+ declare interface WorldGeometryDescriptor {
2594
+ readonly strategies: GeometryEditStrategies & GeometryDerivationStrategies & GeometryCompactionStrategies & {
2595
+ readonly migrateDelta: GeometryMigrateDelta;
2596
+ };
2597
+ readonly _tag: 'WorldGeometry';
2598
+ readonly kind: GeometryKind;
2599
+ readonly static: GeometrySource;
2600
+ readonly chunkSize: number;
2601
+ readonly chunkSizeRaw: number;
2602
+ readonly dynamic: {
2603
+ readonly enabled: boolean;
2604
+ readonly maxDeltaBytesPerChunk: number;
2605
+ readonly persist: {
2606
+ readonly everyMs: number;
2607
+ readonly onUnload: boolean;
2608
+ };
2609
+ };
2610
+ readonly collision: {
2611
+ readonly derive: 'bitgrid' | 'heightfield' | 'shapes';
2612
+ readonly resolution: number;
2613
+ readonly resolutionRaw: number;
2614
+ };
2615
+ readonly nav: {
2616
+ readonly derive: 'grid' | 'none';
2617
+ readonly navBudgetMs: number;
2618
+ readonly maxAdvanceSteps: number;
2619
+ };
2620
+ readonly streaming: {
2621
+ readonly client: {
2622
+ readonly radiusChunks: number;
2623
+ readonly prefetchChunks: number;
2624
+ readonly maxConcurrent: number;
2625
+ readonly maxCachedChunks: number;
2626
+ };
2627
+ readonly cell: {
2628
+ readonly marginChunks: number;
2629
+ };
2630
+ };
2631
+ readonly lod: ReadonlyArray<{
2632
+ readonly beyondChunks: number;
2633
+ readonly fields: ReadonlyArray<string>;
2634
+ }>;
2635
+ readonly budgets: {
2636
+ readonly maxPreparedChunks: number;
2637
+ readonly maxPreparedBytes: number;
2638
+ readonly maxLodLevels: number;
2639
+ readonly maxRayCells: number;
2640
+ readonly maxOverlapTests: number;
2641
+ };
2642
+ }
2643
+
2644
+ declare interface WorldGeometryStrategies extends GeometryVersionMigrationStrategies, Partial<GeometryEditStrategies>, Partial<GeometryDerivationStrategies>, Partial<GeometryCompactionStrategies> {
2645
+ }
2646
+
2647
+ declare interface WorldInstance {
2648
+ readonly id: string;
2649
+ readonly room: string;
2650
+ readonly maxGroups: number;
2651
+ readonly ttl: Duration.Input;
2652
+ }
2653
+
2654
+ declare type WorldLayerDecision = {
2655
+ readonly kind: 'use';
2656
+ readonly layer: number;
2657
+ readonly wake: boolean;
2658
+ } | {
2659
+ readonly kind: 'create';
2660
+ readonly layer: number;
2661
+ } | {
2662
+ readonly kind: 'blocked';
2663
+ readonly reason: 'affinity-unavailable' | 'capacity' | 'layer-budget';
2664
+ };
2665
+
2666
+ declare interface WorldLayering {
2667
+ readonly maxPlayers: number;
2668
+ readonly splitAt: number;
2669
+ readonly mergeBelow: number;
2670
+ }
2671
+
2672
+ declare interface WorldLayerInput {
2673
+ readonly policy: WorldLayering;
2674
+ readonly layers: ReadonlyArray<WorldLayerObservation>;
2675
+ readonly groupSize: number;
2676
+ /** Actual server-owned party affinity; never silently choose a different layer. */
2677
+ readonly affinity: number | null;
2678
+ readonly maxLayers: number;
2679
+ }
2680
+
2681
+ declare interface WorldLayerObservation {
2682
+ readonly layer: number;
2683
+ readonly players: number;
2684
+ readonly state: 'live' | 'hibernated' | 'splitting' | 'merging';
2685
+ }
2686
+
2687
+ declare type WorldLayerPolicy = (input: WorldLayerInput) => WorldLayerDecision;
2688
+
2689
+ declare type WorldOnWorldChange = (input: WorldOnWorldChangeInput) => unknown;
2690
+
2691
+ declare interface WorldOnWorldChangeInput {
2692
+ readonly sourceWorldId: string;
2693
+ readonly targetWorldId: string;
2694
+ /** Current server-captured character data, never a player's wire state. */
2695
+ readonly sourceData: unknown;
2696
+ /** Actual server-selected target data before this policy. */
2697
+ readonly targetData: unknown;
2698
+ }
2699
+
2700
+ declare type WorldPoint = readonly [x: number, y: number];
2701
+
2702
+ declare interface WorldPosition {
2703
+ readonly zone: string;
2704
+ readonly at: WorldPoint;
2705
+ }
2706
+
2707
+ declare type WorldTransitionKind = 'cell' | 'layer' | 'zone' | 'world' | 'instance' | 'return' | 'recover';
2708
+
2709
+ /** Opaque temporary ownership. SQL must still fence durable entity commits. */
2710
+ declare interface WorldTransitionLease {
2711
+ /** False means absent/expired/replaced; never continue a transition on false. */
2712
+ renew(): Effect.Effect<boolean, HotError | ProtocolError>;
2713
+ /** Compare-only release cannot remove a successor. Repeated release returns false. */
2714
+ release(): Effect.Effect<boolean, HotError | ProtocolError>;
2715
+ }
2716
+
2717
+ declare interface WorldTransitionLeaseOptions {
2718
+ readonly namespace: string;
2719
+ readonly tenantId: string;
2720
+ readonly ttlMs: number;
2721
+ }
2722
+
2723
+ declare interface WorldTransitionLocation extends WorldPosition {
2724
+ readonly world: string;
2725
+ readonly pool: string;
2726
+ readonly layer: number;
2727
+ readonly instance: string | null;
2728
+ }
2729
+
2730
+ declare type WorldTransitionMode = 'seamless' | 'portal' | 'recover';
2731
+
2732
+ declare interface WorldTransitionPlan {
2733
+ readonly kind: WorldTransitionKind;
2734
+ readonly mode: WorldTransitionMode;
2735
+ readonly crossPool: boolean;
2736
+ readonly persistBeforeRelease: boolean;
2737
+ readonly sourceCell: string;
2738
+ readonly targetCell: string;
2739
+ }
2740
+
2741
+ declare type WorldTransitionPolicy = (input: WorldTransitionPolicyInput) => WorldTransitionPlan;
2742
+
2743
+ declare interface WorldTransitionPolicyInput {
2744
+ readonly kind: WorldTransitionKind;
2745
+ readonly sourceWorld: AnyWorldDescriptor;
2746
+ readonly targetWorld: AnyWorldDescriptor;
2747
+ readonly source: WorldTransitionLocation;
2748
+ readonly target: WorldTransitionLocation;
2749
+ readonly mode: WorldTransitionMode | 'auto';
2750
+ readonly crossPool: boolean;
2751
+ /** Trusted server recovery classification, not a player intention field. */
2752
+ readonly recovery: boolean;
2753
+ }
2754
+
2755
+ declare interface WorldZone {
2756
+ readonly id: string;
2757
+ readonly bounds: WorldBounds;
2758
+ readonly room: string;
2759
+ readonly neighbors: ReadonlyArray<string>;
2760
+ readonly cells?: {
2761
+ readonly size: number;
2762
+ } | undefined;
2763
+ readonly layering?: WorldLayering;
2764
+ }
2765
+
2766
+ export { }