@air-jam/sdk 0.9.3 → 1.0.0-beta.1

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 (594) hide show
  1. package/README.md +168 -205
  2. package/dist/actions-D4eh6Xaa.d.cts +72 -0
  3. package/dist/actions-D4eh6Xaa.d.ts +72 -0
  4. package/dist/{agent-contract-CD2QnbBJ.d.cts → agent-contract-DfLm4Mf-.d.ts} +3 -19
  5. package/dist/{agent-contract-CD2QnbBJ.d.ts → agent-contract-TINzp-5Y.d.cts} +3 -19
  6. package/dist/agent-tooling.cjs +135 -46
  7. package/dist/agent-tooling.cjs.map +1 -1
  8. package/dist/agent-tooling.d.cts +96 -5
  9. package/dist/agent-tooling.d.ts +96 -5
  10. package/dist/agent-tooling.js +15 -14
  11. package/dist/agent-tooling.js.map +1 -1
  12. package/dist/{use-air-jam-host-COLy8t4s.d.ts → air-jam-context-BCVCWiaT.d.ts} +121 -114
  13. package/dist/{use-air-jam-host-DM-ybB3C.d.cts → air-jam-context-DavligpM.d.cts} +121 -114
  14. package/dist/arcade/bridge/controller.cjs +873 -603
  15. package/dist/arcade/bridge/controller.cjs.map +1 -1
  16. package/dist/arcade/bridge/controller.d.cts +28 -76
  17. package/dist/arcade/bridge/controller.d.ts +28 -76
  18. package/dist/arcade/bridge/controller.js +27 -28
  19. package/dist/arcade/bridge/controller.js.map +1 -1
  20. package/dist/arcade/bridge/host.cjs +1017 -252
  21. package/dist/arcade/bridge/host.cjs.map +1 -1
  22. package/dist/arcade/bridge/host.d.cts +6 -72
  23. package/dist/arcade/bridge/host.d.ts +6 -72
  24. package/dist/arcade/bridge/host.js +19 -22
  25. package/dist/arcade/bridge/host.js.map +1 -1
  26. package/dist/arcade/bridge/iframe.cjs +3 -31
  27. package/dist/arcade/bridge/iframe.cjs.map +1 -1
  28. package/dist/arcade/bridge/iframe.d.cts +4 -46
  29. package/dist/arcade/bridge/iframe.d.ts +4 -46
  30. package/dist/arcade/bridge/iframe.js +6 -18
  31. package/dist/arcade/bridge/iframe.js.map +1 -1
  32. package/dist/arcade/host.cjs +0 -502
  33. package/dist/arcade/host.cjs.map +1 -1
  34. package/dist/arcade/host.d.cts +1 -19
  35. package/dist/arcade/host.d.ts +1 -19
  36. package/dist/arcade/host.js +0 -14
  37. package/dist/arcade/host.js.map +1 -1
  38. package/dist/arcade/runtime.cjs +10354 -4690
  39. package/dist/arcade/runtime.cjs.map +1 -1
  40. package/dist/arcade/runtime.d.cts +45 -13
  41. package/dist/arcade/runtime.d.ts +45 -13
  42. package/dist/arcade/runtime.js +37 -24
  43. package/dist/arcade/runtime.js.map +1 -1
  44. package/dist/arcade/surface.cjs +3 -35
  45. package/dist/arcade/surface.cjs.map +1 -1
  46. package/dist/arcade/surface.d.cts +14 -2
  47. package/dist/arcade/surface.d.ts +14 -2
  48. package/dist/arcade/surface.js +7 -13
  49. package/dist/arcade/surface.js.map +1 -1
  50. package/dist/arcade/url.cjs +45 -283
  51. package/dist/arcade/url.cjs.map +1 -1
  52. package/dist/arcade/url.d.cts +3 -56
  53. package/dist/arcade/url.d.ts +3 -56
  54. package/dist/arcade/url.js +33 -16
  55. package/dist/arcade/url.js.map +1 -1
  56. package/dist/chunk-24NZZOIO.js +700 -0
  57. package/dist/chunk-24NZZOIO.js.map +1 -0
  58. package/dist/chunk-27QLKLZL.js +469 -0
  59. package/dist/chunk-27QLKLZL.js.map +1 -0
  60. package/dist/{chunk-UWJOIVON.js → chunk-2H2FGF3H.js} +3 -6
  61. package/dist/chunk-2H2FGF3H.js.map +1 -0
  62. package/dist/chunk-2QZADUGA.js +188 -0
  63. package/dist/chunk-2QZADUGA.js.map +1 -0
  64. package/dist/chunk-3LDQCQL2.js +307 -0
  65. package/dist/chunk-3LDQCQL2.js.map +1 -0
  66. package/dist/chunk-3M7656SU.js +389 -0
  67. package/dist/chunk-3M7656SU.js.map +1 -0
  68. package/dist/{chunk-K4OZ54UD.js → chunk-5CRZFIN6.js} +2 -55
  69. package/dist/chunk-5CRZFIN6.js.map +1 -0
  70. package/dist/chunk-5TVVPBQI.js +7 -0
  71. package/dist/chunk-5TVVPBQI.js.map +1 -0
  72. package/dist/chunk-6Y3F6Y2K.js +343 -0
  73. package/dist/chunk-6Y3F6Y2K.js.map +1 -0
  74. package/dist/{chunk-EVZJA6RN.js → chunk-6ZJUA63D.js} +183 -2
  75. package/dist/chunk-6ZJUA63D.js.map +1 -0
  76. package/dist/chunk-A6EOGRRG.js +49 -0
  77. package/dist/chunk-A6EOGRRG.js.map +1 -0
  78. package/dist/chunk-BEM77SVQ.js +57 -0
  79. package/dist/chunk-BEM77SVQ.js.map +1 -0
  80. package/dist/chunk-C5722GTG.js +176 -0
  81. package/dist/chunk-C5722GTG.js.map +1 -0
  82. package/dist/{chunk-CV3PBXPT.js → chunk-C5GS2GMK.js} +99 -105
  83. package/dist/chunk-C5GS2GMK.js.map +1 -0
  84. package/dist/chunk-CDL7LYZH.js +19 -0
  85. package/dist/chunk-CDL7LYZH.js.map +1 -0
  86. package/dist/{chunk-PSUYTD2L.js → chunk-DA3TE4OP.js} +1 -1
  87. package/dist/chunk-DA3TE4OP.js.map +1 -0
  88. package/dist/chunk-DBF7NJ3S.js +72 -0
  89. package/dist/chunk-DBF7NJ3S.js.map +1 -0
  90. package/dist/chunk-DHFKL3DI.js +2477 -0
  91. package/dist/chunk-DHFKL3DI.js.map +1 -0
  92. package/dist/chunk-DRBPVG47.js +89 -0
  93. package/dist/chunk-DRBPVG47.js.map +1 -0
  94. package/dist/{chunk-MIMPMB7O.js → chunk-EG25EXSA.js} +24 -3
  95. package/dist/chunk-EG25EXSA.js.map +1 -0
  96. package/dist/chunk-FCG42U7D.js +131 -0
  97. package/dist/chunk-FCG42U7D.js.map +1 -0
  98. package/dist/chunk-FJ4J2BEC.js +26 -0
  99. package/dist/chunk-FJ4J2BEC.js.map +1 -0
  100. package/dist/chunk-H4DEVMTO.js +221 -0
  101. package/dist/chunk-H4DEVMTO.js.map +1 -0
  102. package/dist/{chunk-X35LLCWV.js → chunk-I6TSHJF7.js} +6 -8
  103. package/dist/chunk-I6TSHJF7.js.map +1 -0
  104. package/dist/{chunk-IG6GZZSS.js → chunk-JCGTL77W.js} +1 -1
  105. package/dist/chunk-JCGTL77W.js.map +1 -0
  106. package/dist/chunk-JJVCBUYM.js +98 -0
  107. package/dist/chunk-JJVCBUYM.js.map +1 -0
  108. package/dist/chunk-K6BJJJJM.js +138 -0
  109. package/dist/chunk-K6BJJJJM.js.map +1 -0
  110. package/dist/chunk-KSYN4I5Y.js +50 -0
  111. package/dist/chunk-KSYN4I5Y.js.map +1 -0
  112. package/dist/chunk-KUGROY5S.js +265 -0
  113. package/dist/chunk-KUGROY5S.js.map +1 -0
  114. package/dist/chunk-LX6CTPDW.js +16 -0
  115. package/dist/chunk-LX6CTPDW.js.map +1 -0
  116. package/dist/{chunk-BE6Z4SIT.js → chunk-M5553I2G.js} +2 -11
  117. package/dist/chunk-M5553I2G.js.map +1 -0
  118. package/dist/{chunk-X24K52DG.js → chunk-MD25536W.js} +1 -1
  119. package/dist/chunk-MD25536W.js.map +1 -0
  120. package/dist/{chunk-3USU7GY2.js → chunk-MJAWAHLT.js} +1 -1
  121. package/dist/chunk-MJAWAHLT.js.map +1 -0
  122. package/dist/chunk-OAXCFPZ7.js +14 -0
  123. package/dist/chunk-OAXCFPZ7.js.map +1 -0
  124. package/dist/{chunk-D4VDEVTZ.js → chunk-QHBRHYMV.js} +18 -17
  125. package/dist/chunk-QHBRHYMV.js.map +1 -0
  126. package/dist/chunk-QTNYGAZ7.js +45 -0
  127. package/dist/chunk-QTNYGAZ7.js.map +1 -0
  128. package/dist/chunk-S3TN7Y7L.js +921 -0
  129. package/dist/chunk-S3TN7Y7L.js.map +1 -0
  130. package/dist/chunk-SMKD4JY3.js +129 -0
  131. package/dist/chunk-SMKD4JY3.js.map +1 -0
  132. package/dist/{chunk-O6X7FJ6N.js → chunk-TFW4NJW2.js} +619 -643
  133. package/dist/chunk-TFW4NJW2.js.map +1 -0
  134. package/dist/chunk-UBBP2UY3.js +83 -0
  135. package/dist/chunk-UBBP2UY3.js.map +1 -0
  136. package/dist/chunk-URVBMQCK.js +802 -0
  137. package/dist/chunk-URVBMQCK.js.map +1 -0
  138. package/dist/chunk-VGX2274F.js +1995 -0
  139. package/dist/chunk-VGX2274F.js.map +1 -0
  140. package/dist/chunk-WAFGYJZN.js +1513 -0
  141. package/dist/chunk-WAFGYJZN.js.map +1 -0
  142. package/dist/chunk-WGHNGQUS.js +78 -0
  143. package/dist/chunk-WGHNGQUS.js.map +1 -0
  144. package/dist/chunk-XLY44PXZ.js +46 -0
  145. package/dist/chunk-XLY44PXZ.js.map +1 -0
  146. package/dist/connection-store-BYpQ50W2.d.ts +41 -0
  147. package/dist/connection-store-D6QqzXU1.d.cts +41 -0
  148. package/dist/control-Bv8dWjyp.d.ts +1400 -0
  149. package/dist/control-CNzybWMd.d.cts +1400 -0
  150. package/dist/controller-0CVO1t_3.d.cts +26 -0
  151. package/dist/controller-agent-vOiuK7T6.d.cts +130 -0
  152. package/dist/controller-agent-vOiuK7T6.d.ts +130 -0
  153. package/dist/controller-bridge.cjs +992 -0
  154. package/dist/controller-bridge.cjs.map +1 -0
  155. package/dist/controller-bridge.d.cts +52 -0
  156. package/dist/controller-bridge.d.ts +52 -0
  157. package/dist/controller-bridge.js +23 -0
  158. package/dist/controller-bridge.js.map +1 -0
  159. package/dist/controller-capture-2GKKGHJ2.js +8 -0
  160. package/dist/controller-capture-2GKKGHJ2.js.map +1 -0
  161. package/dist/controller-h9M2Nngd.d.ts +26 -0
  162. package/dist/controller-press-EWWIMVXP.js +231 -0
  163. package/dist/controller-press-EWWIMVXP.js.map +1 -0
  164. package/dist/core-BAO0pHrJ.d.cts +15 -0
  165. package/dist/core-BAO0pHrJ.d.ts +15 -0
  166. package/dist/core.cjs +5931 -0
  167. package/dist/core.cjs.map +1 -0
  168. package/dist/core.d.cts +232 -0
  169. package/dist/core.d.ts +232 -0
  170. package/dist/core.js +906 -0
  171. package/dist/core.js.map +1 -0
  172. package/dist/dev-events-BffobOfb.d.ts +31 -0
  173. package/dist/dev-events-Ct7QEgKb.d.cts +31 -0
  174. package/dist/dev-log-events-B1_B3guZ.d.cts +47 -0
  175. package/dist/dev-log-events-B1_B3guZ.d.ts +47 -0
  176. package/dist/frames-D-xKuODS.d.cts +686 -0
  177. package/dist/frames-D-xKuODS.d.ts +686 -0
  178. package/dist/game-Db58JNk3.d.cts +77 -0
  179. package/dist/game-bySEy-QO.d.ts +77 -0
  180. package/dist/host-runtime-BuLhGQx5.d.ts +399 -0
  181. package/dist/host-runtime-_06jpW5v.d.cts +399 -0
  182. package/dist/index.cjs +11580 -7584
  183. package/dist/index.cjs.map +1 -1
  184. package/dist/index.d.cts +100 -358
  185. package/dist/index.d.ts +100 -358
  186. package/dist/index.js +414 -1903
  187. package/dist/index.js.map +1 -1
  188. package/dist/input-Xvs80gqG.d.cts +92 -0
  189. package/dist/input-Xvs80gqG.d.ts +92 -0
  190. package/dist/input-bindings-BaEFrgRb.d.cts +129 -0
  191. package/dist/input-bindings-BgsJRLPm.d.ts +129 -0
  192. package/dist/leased-control-BEg4JuXA.d.cts +158 -0
  193. package/dist/leased-control-BEg4JuXA.d.ts +158 -0
  194. package/dist/metadata.cjs +3 -9
  195. package/dist/metadata.cjs.map +1 -1
  196. package/dist/metadata.d.cts +6 -16
  197. package/dist/metadata.d.ts +6 -16
  198. package/dist/metadata.js +8 -76
  199. package/dist/metadata.js.map +1 -1
  200. package/dist/phone-room-session-Ca6rlxJr.d.ts +439 -0
  201. package/dist/phone-room-session-DkPR-K6e.d.cts +439 -0
  202. package/dist/platform-machine.cjs +133 -3
  203. package/dist/platform-machine.cjs.map +1 -1
  204. package/dist/platform-machine.d.cts +525 -27
  205. package/dist/platform-machine.d.ts +525 -27
  206. package/dist/platform-machine.js +119 -4
  207. package/dist/platform-machine.js.map +1 -1
  208. package/dist/{platform-settings-DUWs4JTy.d.cts → platform-settings-Yb0fQ1dl.d.cts} +1 -3
  209. package/dist/{platform-settings-DUWs4JTy.d.ts → platform-settings-Yb0fQ1dl.d.ts} +1 -3
  210. package/dist/prefabs.cjs +134 -3
  211. package/dist/prefabs.cjs.map +1 -1
  212. package/dist/prefabs.d.cts +23 -47
  213. package/dist/prefabs.d.ts +23 -47
  214. package/dist/prefabs.js +23 -4
  215. package/dist/prefabs.js.map +1 -1
  216. package/dist/preview.cjs +2214 -767
  217. package/dist/preview.cjs.map +1 -1
  218. package/dist/preview.d.cts +193 -38
  219. package/dist/preview.d.ts +193 -38
  220. package/dist/preview.js +478 -254
  221. package/dist/preview.js.map +1 -1
  222. package/dist/protocol.cjs +585 -391
  223. package/dist/protocol.cjs.map +1 -1
  224. package/dist/protocol.d.cts +13 -117
  225. package/dist/protocol.d.ts +13 -117
  226. package/dist/protocol.js +43 -80
  227. package/dist/protocol.js.map +1 -1
  228. package/dist/release.cjs.map +1 -1
  229. package/dist/release.d.cts +2 -2
  230. package/dist/release.d.ts +2 -2
  231. package/dist/release.js +1 -1
  232. package/dist/release.js.map +1 -1
  233. package/dist/replay-input-log-BvX4As2f.d.ts +31 -0
  234. package/dist/replay-input-log-Vcl0VDIy.d.cts +31 -0
  235. package/dist/room-protocol.cjs +794 -0
  236. package/dist/room-protocol.cjs.map +1 -0
  237. package/dist/room-protocol.d.cts +63 -0
  238. package/dist/room-protocol.d.ts +63 -0
  239. package/dist/room-protocol.js +143 -0
  240. package/dist/room-protocol.js.map +1 -0
  241. package/dist/room-session.cjs +2336 -0
  242. package/dist/room-session.cjs.map +1 -0
  243. package/dist/room-session.d.cts +77 -0
  244. package/dist/room-session.d.ts +77 -0
  245. package/dist/room-session.js +103 -0
  246. package/dist/room-session.js.map +1 -0
  247. package/dist/runtime/prefab-inspection-bridge.cjs +207 -0
  248. package/dist/runtime/prefab-inspection-bridge.cjs.map +1 -0
  249. package/dist/runtime/prefab-inspection-bridge.d.cts +156 -0
  250. package/dist/runtime/prefab-inspection-bridge.d.ts +156 -0
  251. package/dist/runtime/prefab-inspection-bridge.js +22 -0
  252. package/dist/runtime/prefab-inspection-bridge.js.map +1 -0
  253. package/dist/runtime-control.cjs +2112 -8
  254. package/dist/runtime-control.cjs.map +1 -1
  255. package/dist/runtime-control.d.cts +980 -12
  256. package/dist/runtime-control.d.ts +980 -12
  257. package/dist/runtime-control.js +264 -4
  258. package/dist/runtime-control.js.map +1 -1
  259. package/dist/runtime-inspection.cjs +1222 -558
  260. package/dist/runtime-inspection.cjs.map +1 -1
  261. package/dist/runtime-inspection.d.cts +530 -22
  262. package/dist/runtime-inspection.d.ts +530 -22
  263. package/dist/runtime-inspection.js +21 -22
  264. package/dist/runtime-inspection.js.map +1 -1
  265. package/dist/runtime-reporting-K_ZXpubu.d.cts +43 -0
  266. package/dist/runtime-reporting-K_ZXpubu.d.ts +43 -0
  267. package/dist/runtime-topology.cjs +2 -5
  268. package/dist/runtime-topology.cjs.map +1 -1
  269. package/dist/runtime-topology.d.cts +1 -1
  270. package/dist/runtime-topology.d.ts +1 -1
  271. package/dist/runtime-topology.js +1 -1
  272. package/dist/runtime-topology.js.map +1 -1
  273. package/dist/scoped-connector-CiiWu06D.d.ts +66 -0
  274. package/dist/scoped-connector-D7252pn0.d.cts +66 -0
  275. package/dist/sdk-channels-S6j6AH8v.d.cts +103 -0
  276. package/dist/sdk-channels-S6j6AH8v.d.ts +103 -0
  277. package/dist/simulation-BfRnC4rg.d.ts +782 -0
  278. package/dist/simulation-BwZx2pgt.d.cts +782 -0
  279. package/dist/{standard-match-phase-BzSgBYFg.d.ts → standard-match-phase-D4N-AU0d.d.cts} +3 -13
  280. package/dist/{standard-match-phase-CvJUW8Oe.d.cts → standard-match-phase-abt8ZjCh.d.ts} +3 -13
  281. package/dist/transport-CWF29jU6.d.cts +173 -0
  282. package/dist/transport-CWF29jU6.d.ts +173 -0
  283. package/dist/types-p28maMEo.d.cts +102 -0
  284. package/dist/types-p28maMEo.d.ts +102 -0
  285. package/dist/ui.cjs +2182 -892
  286. package/dist/ui.cjs.map +1 -1
  287. package/dist/ui.d.cts +75 -17
  288. package/dist/ui.d.ts +75 -17
  289. package/dist/ui.js +554 -393
  290. package/dist/ui.js.map +1 -1
  291. package/package.json +38 -21
  292. package/src/agent/agent-action.ts +0 -39
  293. package/src/agent/agent-contract-conformance.ts +8 -1
  294. package/src/agent/agent-contract.ts +2 -4
  295. package/src/agent/agent-evaluator.ts +95 -0
  296. package/src/agent/capture-canvas.ts +79 -0
  297. package/src/agent/host-canvas-capture.ts +189 -0
  298. package/src/agent-tooling.ts +5 -20
  299. package/src/arcade/bridge/controller.ts +8 -11
  300. package/src/arcade/bridge/host.ts +6 -11
  301. package/src/arcade/bridge/iframe.ts +1 -50
  302. package/src/arcade/host.ts +0 -1
  303. package/src/arcade/surface.ts +5 -1
  304. package/src/arcade/url.ts +2 -9
  305. package/src/audio/audio-manager.ts +23 -47
  306. package/src/audio/hooks.tsx +59 -72
  307. package/src/components/controller-player-name-field.tsx +2 -2
  308. package/src/components/controller-primary-action.tsx +1 -1
  309. package/src/components/controls.tsx +398 -0
  310. package/src/components/gamepad-layout.tsx +69 -0
  311. package/src/components/join-url-controls.tsx +5 -1
  312. package/src/components/lifecycle-action-group.tsx +1 -1
  313. package/src/components/player-avatar.tsx +50 -3
  314. package/src/components/room-qr-code.tsx +36 -77
  315. package/src/components/stage-capture-surface.tsx +91 -0
  316. package/src/components/surface-viewport.tsx +16 -3
  317. package/src/components/ui/button.tsx +1 -1
  318. package/src/constants.ts +0 -15
  319. package/src/context/air-jam-context.tsx +56 -187
  320. package/src/context/session-providers.tsx +13 -10
  321. package/src/controller-bridge.ts +7 -0
  322. package/src/core/assets.ts +48 -0
  323. package/src/core/config.ts +70 -0
  324. package/src/core/connection-store.ts +77 -0
  325. package/src/core/controller-input.ts +147 -0
  326. package/src/core/controller-runtime.ts +427 -0
  327. package/src/core/dev-events.ts +18 -0
  328. package/src/core/environment.ts +132 -0
  329. package/src/core/game-description.ts +44 -0
  330. package/src/core/game.ts +130 -0
  331. package/src/core/host-input.ts +207 -0
  332. package/src/core/host-runtime.ts +988 -0
  333. package/src/core/hosted-rooms.ts +26 -0
  334. package/src/core/input-bindings.ts +180 -0
  335. package/src/core/input-log.ts +144 -0
  336. package/src/core/input.ts +228 -0
  337. package/src/core/local-input.ts +319 -0
  338. package/src/core/replay-input-log.ts +298 -0
  339. package/src/core/replicated-store.ts +1178 -0
  340. package/src/core/room-action-ack.ts +43 -0
  341. package/src/core/settings.ts +202 -0
  342. package/src/core/simulation.ts +307 -0
  343. package/src/core/theme.ts +33 -0
  344. package/src/core.ts +162 -0
  345. package/src/dev/browser-log-sink.ts +35 -12
  346. package/src/diagnostics.ts +5 -6
  347. package/src/hooks/internal/use-controller-runtime-api.ts +58 -925
  348. package/src/hooks/internal/use-host-runtime-api.ts +98 -1270
  349. package/src/hooks/internal/use-runtime-inspection-contract.ts +14 -2
  350. package/src/hooks/use-air-jam-controller.ts +32 -53
  351. package/src/hooks/use-air-jam-host.ts +59 -100
  352. package/src/hooks/use-air-jam-settings.ts +27 -0
  353. package/src/hooks/use-controller-toasts.ts +16 -19
  354. package/src/hooks/use-host-agent-capture.ts +31 -0
  355. package/src/hooks/use-lifecycle-action-group-model.ts +1 -1
  356. package/src/hooks/use-send-signal.ts +23 -156
  357. package/src/hooks/use-simulation.ts +83 -0
  358. package/src/index.ts +24 -85
  359. package/src/lifecycle/index.ts +0 -4
  360. package/src/lifecycle/standard-match-phase.ts +1 -22
  361. package/src/metadata/manifest.ts +8 -19
  362. package/src/metadata.ts +1 -1
  363. package/src/platform-machine.ts +127 -3
  364. package/src/prefabs/types.ts +91 -20
  365. package/src/prefabs/view.ts +82 -0
  366. package/src/prefabs.ts +19 -0
  367. package/src/preview/host-workspace.tsx +4 -9
  368. package/src/preview/identity.ts +31 -23
  369. package/src/preview/layout.ts +5 -1
  370. package/src/preview/manager.ts +205 -78
  371. package/src/preview/messages.ts +47 -0
  372. package/src/preview/ownership.ts +6 -1
  373. package/src/preview/url.ts +46 -23
  374. package/src/preview/window.tsx +26 -69
  375. package/src/preview/workspace-local-seats.ts +166 -0
  376. package/src/preview/workspace.tsx +89 -37
  377. package/src/preview.ts +27 -15
  378. package/src/protocol/actions.ts +58 -0
  379. package/src/protocol/arcade-platform-actions.ts +2 -16
  380. package/src/protocol/controller.ts +14 -174
  381. package/src/protocol/core.ts +8 -15
  382. package/src/protocol/dev-log-events.ts +5 -81
  383. package/src/protocol/leased-control.ts +177 -0
  384. package/src/protocol/room/addressing.ts +35 -0
  385. package/src/protocol/room/close-codes.ts +33 -0
  386. package/src/protocol/room/frames.ts +343 -0
  387. package/src/protocol/room/input-codec.ts +182 -0
  388. package/src/protocol/room/limits.ts +58 -0
  389. package/src/protocol/room/patch.ts +135 -0
  390. package/src/protocol/room/sdk-channels.ts +81 -0
  391. package/src/protocol/room/seat-id.ts +31 -0
  392. package/src/protocol/room/transport.ts +63 -0
  393. package/src/protocol/room/weight.ts +58 -0
  394. package/src/protocol/runtime-reporting.ts +56 -10
  395. package/src/protocol.ts +2 -7
  396. package/src/qrcode.d.ts +3 -13
  397. package/src/room-protocol.ts +10 -0
  398. package/src/room-session/browser-wake-events.ts +14 -0
  399. package/src/room-session/channel-state.ts +293 -0
  400. package/src/room-session/clock.ts +24 -0
  401. package/src/room-session/host-room-session.ts +379 -0
  402. package/src/room-session/input-lane.ts +125 -0
  403. package/src/room-session/listeners.ts +22 -0
  404. package/src/room-session/loopback-link.ts +58 -0
  405. package/src/room-session/phone-room-session.ts +368 -0
  406. package/src/room-session/port-link.ts +116 -0
  407. package/src/room-session/room-key.ts +9 -0
  408. package/src/room-session/roster.ts +23 -0
  409. package/src/room-session/scoped-connector.ts +577 -0
  410. package/src/room-session/session-link.ts +306 -0
  411. package/src/room-session/web-socket-link.ts +57 -0
  412. package/src/room-session.ts +12 -0
  413. package/src/runtime/air-jam-config.ts +49 -37
  414. package/src/runtime/air-jam-error-boundary.tsx +9 -3
  415. package/src/runtime/arcade-runtime-url.ts +8 -9
  416. package/src/runtime/browser-controller-environment.ts +116 -0
  417. package/src/runtime/browser-host-environment.ts +137 -0
  418. package/src/runtime/browser-replay.ts +211 -0
  419. package/src/runtime/browser-room.ts +41 -0
  420. package/src/runtime/connected-runtime-error-boundary.tsx +35 -8
  421. package/src/runtime/contracts/agent-control.ts +195 -0
  422. package/src/runtime/contracts/clip.ts +169 -0
  423. package/src/runtime/contracts/control.ts +653 -16
  424. package/src/runtime/contracts/controller-agent.ts +130 -0
  425. package/src/runtime/contracts/input-log.ts +38 -0
  426. package/src/runtime/contracts/inspection.ts +25 -22
  427. package/src/runtime/contracts/observation.ts +186 -0
  428. package/src/runtime/contracts/runtime-identity.ts +43 -0
  429. package/src/runtime/contracts/timeline.ts +59 -0
  430. package/src/runtime/controller-agent-bridge.ts +152 -0
  431. package/src/runtime/controller-bridge-context.ts +29 -0
  432. package/src/runtime/controller-capture.ts +50 -0
  433. package/src/runtime/controller-identity.ts +53 -142
  434. package/src/runtime/controller-presentation.ts +47 -17
  435. package/src/runtime/controller-press.ts +271 -0
  436. package/src/runtime/create-air-jam-app.tsx +103 -74
  437. package/src/runtime/dev-runtime-events.ts +6 -18
  438. package/src/runtime/embedded-parent.ts +22 -0
  439. package/src/runtime/embedded-runtime-adapters.ts +10 -9
  440. package/src/runtime/host-agent-bridge.ts +127 -0
  441. package/src/runtime/host-capture-boundary.tsx +92 -0
  442. package/src/runtime/host-capture-context.ts +7 -0
  443. package/src/runtime/host-clip-reader.ts +93 -0
  444. package/src/runtime/host-clip-recorder.ts +342 -0
  445. package/src/runtime/host-input-log-reader.ts +120 -0
  446. package/src/runtime/host-observation.ts +207 -0
  447. package/src/runtime/host-pace.ts +36 -0
  448. package/src/runtime/host-runtime-fault.ts +51 -0
  449. package/src/runtime/host-timeline.ts +152 -0
  450. package/src/runtime/local-players.tsx +96 -0
  451. package/src/runtime/local-seats.ts +612 -0
  452. package/src/runtime/participant-control.ts +162 -0
  453. package/src/runtime/prefab-inspection-bridge.ts +174 -0
  454. package/src/runtime/prefab-inspection-clock.ts +12 -0
  455. package/src/runtime/prefab-inspection-context.ts +20 -0
  456. package/src/runtime/prefab-inspection-runtime.tsx +328 -0
  457. package/src/runtime/preview-inspection-bridge.ts +130 -0
  458. package/src/runtime/replay-runtime.tsx +101 -0
  459. package/src/runtime/room-bridge.ts +110 -0
  460. package/src/runtime/runtime-owner-contexts.tsx +9 -0
  461. package/src/runtime/runtime-session-params.ts +20 -23
  462. package/src/runtime/session-runtimes.tsx +231 -64
  463. package/src/runtime/stage-capture.ts +25 -0
  464. package/src/runtime-control.ts +41 -0
  465. package/src/runtime-inspection.ts +14 -7
  466. package/src/runtime-topology.ts +7 -8
  467. package/src/settings/platform-settings-runtime.tsx +47 -2
  468. package/src/settings/platform-settings.ts +0 -65
  469. package/src/store/use-air-jam-store.ts +73 -0
  470. package/src/ui.ts +3 -3
  471. package/src/utils/is-rpc-serializable.ts +11 -19
  472. package/src/utils/url-builder.ts +0 -7
  473. package/dist/air-jam-context-BlLPvCup.d.cts +0 -175
  474. package/dist/air-jam-context-DTsxF-tP.d.ts +0 -175
  475. package/dist/arcade/bridge.cjs +0 -1087
  476. package/dist/arcade/bridge.cjs.map +0 -1
  477. package/dist/arcade/bridge.d.cts +0 -11
  478. package/dist/arcade/bridge.d.ts +0 -11
  479. package/dist/arcade/bridge.js +0 -78
  480. package/dist/arcade/bridge.js.map +0 -1
  481. package/dist/arcade-runtime-url-BW-MUAOY.d.cts +0 -28
  482. package/dist/arcade-runtime-url-l8qj01Pg.d.ts +0 -28
  483. package/dist/arcade.cjs +0 -1767
  484. package/dist/arcade.cjs.map +0 -1
  485. package/dist/arcade.d.cts +0 -18
  486. package/dist/arcade.d.ts +0 -18
  487. package/dist/arcade.js +0 -129
  488. package/dist/arcade.js.map +0 -1
  489. package/dist/chunk-2SZ2YYGJ.js +0 -280
  490. package/dist/chunk-2SZ2YYGJ.js.map +0 -1
  491. package/dist/chunk-32RSSFSF.js +0 -214
  492. package/dist/chunk-32RSSFSF.js.map +0 -1
  493. package/dist/chunk-3USU7GY2.js.map +0 -1
  494. package/dist/chunk-3YMUAKPU.js +0 -10
  495. package/dist/chunk-3YMUAKPU.js.map +0 -1
  496. package/dist/chunk-56DM2KEW.js +0 -14
  497. package/dist/chunk-56DM2KEW.js.map +0 -1
  498. package/dist/chunk-BE6Z4SIT.js.map +0 -1
  499. package/dist/chunk-CM53YLT5.js +0 -59
  500. package/dist/chunk-CM53YLT5.js.map +0 -1
  501. package/dist/chunk-CV3PBXPT.js.map +0 -1
  502. package/dist/chunk-D4VDEVTZ.js.map +0 -1
  503. package/dist/chunk-EVZJA6RN.js.map +0 -1
  504. package/dist/chunk-FUA6EMSJ.js +0 -90
  505. package/dist/chunk-FUA6EMSJ.js.map +0 -1
  506. package/dist/chunk-GMLU7RI5.js +0 -70
  507. package/dist/chunk-GMLU7RI5.js.map +0 -1
  508. package/dist/chunk-IG6GZZSS.js.map +0 -1
  509. package/dist/chunk-IKKDONQL.js +0 -1
  510. package/dist/chunk-IKKDONQL.js.map +0 -1
  511. package/dist/chunk-ITMQSBTH.js +0 -26
  512. package/dist/chunk-ITMQSBTH.js.map +0 -1
  513. package/dist/chunk-J5MCII33.js +0 -620
  514. package/dist/chunk-J5MCII33.js.map +0 -1
  515. package/dist/chunk-JTF47B56.js +0 -1
  516. package/dist/chunk-JTF47B56.js.map +0 -1
  517. package/dist/chunk-K4OZ54UD.js.map +0 -1
  518. package/dist/chunk-LIHEEAVE.js +0 -191
  519. package/dist/chunk-LIHEEAVE.js.map +0 -1
  520. package/dist/chunk-LIXPF4P6.js +0 -22
  521. package/dist/chunk-LIXPF4P6.js.map +0 -1
  522. package/dist/chunk-MIMPMB7O.js.map +0 -1
  523. package/dist/chunk-MPDMJIX5.js +0 -1
  524. package/dist/chunk-MPDMJIX5.js.map +0 -1
  525. package/dist/chunk-O6X7FJ6N.js.map +0 -1
  526. package/dist/chunk-PSUYTD2L.js.map +0 -1
  527. package/dist/chunk-QO4KFUEI.js +0 -32
  528. package/dist/chunk-QO4KFUEI.js.map +0 -1
  529. package/dist/chunk-QTLYZADF.js +0 -125
  530. package/dist/chunk-QTLYZADF.js.map +0 -1
  531. package/dist/chunk-TGRTEWYV.js +0 -195
  532. package/dist/chunk-TGRTEWYV.js.map +0 -1
  533. package/dist/chunk-TTQDHKXL.js +0 -3017
  534. package/dist/chunk-TTQDHKXL.js.map +0 -1
  535. package/dist/chunk-UCPY7UJC.js +0 -8
  536. package/dist/chunk-UCPY7UJC.js.map +0 -1
  537. package/dist/chunk-UPV6YWT5.js +0 -43
  538. package/dist/chunk-UPV6YWT5.js.map +0 -1
  539. package/dist/chunk-UWJOIVON.js.map +0 -1
  540. package/dist/chunk-W2VK36RO.js +0 -11
  541. package/dist/chunk-W2VK36RO.js.map +0 -1
  542. package/dist/chunk-X24K52DG.js.map +0 -1
  543. package/dist/chunk-X35LLCWV.js.map +0 -1
  544. package/dist/chunk-YXHH3MQT.js +0 -230
  545. package/dist/chunk-YXHH3MQT.js.map +0 -1
  546. package/dist/controller-PZEM_1cH.d.ts +0 -176
  547. package/dist/controller-vj82tKm4.d.cts +0 -176
  548. package/dist/dev-log-events-BCJKmygo.d.cts +0 -120
  549. package/dist/dev-log-events-BCJKmygo.d.ts +0 -120
  550. package/dist/handshake-CC_LrK5g.d.cts +0 -31
  551. package/dist/handshake-CC_LrK5g.d.ts +0 -31
  552. package/dist/host-B9pRy0Aa.d.cts +0 -122
  553. package/dist/host-DylGsX7p.d.ts +0 -122
  554. package/dist/notices-C4bao3oi.d.ts +0 -38
  555. package/dist/notices-DNdOjwtj.d.cts +0 -38
  556. package/dist/realtime-client-Cu8yVJFw.d.cts +0 -15
  557. package/dist/realtime-client-Cu8yVJFw.d.ts +0 -15
  558. package/dist/runtime-reporting-pe-eryVz.d.cts +0 -27
  559. package/dist/runtime-reporting-pe-eryVz.d.ts +0 -27
  560. package/dist/signals-ZHftIKuc.d.cts +0 -33
  561. package/dist/signals-ZHftIKuc.d.ts +0 -33
  562. package/dist/sync-xtPfWhif.d.cts +0 -81
  563. package/dist/sync-xtPfWhif.d.ts +0 -81
  564. package/src/arcade/bridge.ts +0 -3
  565. package/src/arcade.ts +0 -4
  566. package/src/context/socket-manager.ts +0 -72
  567. package/src/events.ts +0 -119
  568. package/src/hooks/use-connection-status.ts +0 -8
  569. package/src/hooks/use-controller-tick.ts +0 -65
  570. package/src/hooks/use-get-input.ts +0 -100
  571. package/src/hooks/use-host-arcade-restore.ts +0 -35
  572. package/src/hooks/use-host-tick.ts +0 -171
  573. package/src/hooks/use-input-writer.ts +0 -83
  574. package/src/hooks/use-players.ts +0 -12
  575. package/src/internal/input-manager.ts +0 -356
  576. package/src/protocol/errors.ts +0 -21
  577. package/src/protocol/host-grant.ts +0 -103
  578. package/src/protocol/host.ts +0 -150
  579. package/src/protocol/notices.ts +0 -43
  580. package/src/protocol/signals.ts +0 -38
  581. package/src/protocol/socket-events.ts +0 -152
  582. package/src/protocol/sync.ts +0 -105
  583. package/src/runtime/admission-retry.ts +0 -62
  584. package/src/runtime/bridge-envelope-args.ts +0 -21
  585. package/src/runtime/controller-bridge.ts +0 -439
  586. package/src/runtime/controller-realtime-client.ts +0 -552
  587. package/src/runtime/host-bridge.ts +0 -380
  588. package/src/runtime/host-realtime-client.ts +0 -550
  589. package/src/runtime/realtime-client.ts +0 -20
  590. package/src/runtime/validate-arcade-bridge-attach.ts +0 -14
  591. package/src/state/connection-store.ts +0 -159
  592. package/src/store/create-air-jam-store.ts +0 -1193
  593. package/src/store/index.ts +0 -1
  594. package/src/utils/ids.ts +0 -58
@@ -0,0 +1,686 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * A channel's state travels as patches against a revision. A patch names the
5
+ * keys that changed, descending only through plain objects; arrays and other
6
+ * values are replaced whole. Unlike JSON Merge Patch it can set a value to
7
+ * `null`, which stores do constantly.
8
+ */
9
+ type StateDocument = Record<string, unknown>;
10
+ type StatePath = readonly string[];
11
+ interface StatePatch {
12
+ readonly set: ReadonlyArray<readonly [StatePath, unknown]>;
13
+ readonly unset: readonly StatePath[];
14
+ }
15
+ declare const isPlainObject: (value: unknown) => value is StateDocument;
16
+ /** The value at `path`, or undefined when the path does not lead to one. */
17
+ declare const readStatePath: (document: StateDocument, path: StatePath) => unknown;
18
+ /**
19
+ * The patch that turns `previous` into `next`. Stores update immutably, so an
20
+ * unchanged branch is skipped by identity without being walked. A key whose
21
+ * value is `undefined` counts as absent, as it does in JSON.
22
+ */
23
+ declare const diffState: (previous: StateDocument, next: StateDocument) => StatePatch;
24
+ declare const isEmptyStatePatch: (patch: StatePatch) => boolean;
25
+ /**
26
+ * Applies removals, then assignments, without touching `document`. Each
27
+ * object on a changed path is copied once however many operations reach it,
28
+ * so a frame costs what it changes rather than what it changes times the
29
+ * size of the objects it changes. `replaced` hears each operation's key and
30
+ * the values before and after it, `undefined` meaning absent. Returns null
31
+ * when the patch does not fit: a path runs through something that is not a
32
+ * plain object, or removes a key that is not there. A receiver that gets null
33
+ * has diverged and needs the full document.
34
+ */
35
+ declare const applyStatePatch: (document: StateDocument, patch: StatePatch, replaced?: (key: string, previous: unknown, next: unknown) => void) => StateDocument | null;
36
+
37
+ /**
38
+ * Text frames are JSON objects with a `type`. Within a protocol version change
39
+ * is additive: a receiver ignores frame types and fields it does not know, so
40
+ * no schema here is strict. The literal text frames `ping` and `pong` are the
41
+ * heartbeat.
42
+ */
43
+ declare const ROOM_PROTOCOL_VERSION = 1;
44
+ declare const PING_FRAME = "ping";
45
+ declare const PONG_FRAME = "pong";
46
+ /** How deeply a frame's JSON may nest; nothing walks a deeper frame. */
47
+ declare const MAXIMUM_FRAME_DEPTH = 32;
48
+ declare const seatKindSchema: z.ZodEnum<{
49
+ phone: "phone";
50
+ preview: "preview";
51
+ agent: "agent";
52
+ }>;
53
+ type SeatKind = z.infer<typeof seatKindSchema>;
54
+ declare const seatProfileSchema: z.ZodObject<{
55
+ label: z.ZodOptional<z.ZodString>;
56
+ avatarId: z.ZodOptional<z.ZodString>;
57
+ localSeatLabel: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>;
59
+ type SeatProfile = z.infer<typeof seatProfileSchema>;
60
+ declare const hostHelloSchema: z.ZodObject<{
61
+ credential: z.ZodOptional<z.ZodString>;
62
+ seats: z.ZodNumber;
63
+ type: z.ZodLiteral<"hello">;
64
+ key: z.ZodString;
65
+ instance: z.ZodOptional<z.ZodString>;
66
+ sdk: z.ZodString;
67
+ features: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ }, z.core.$strip>;
69
+ type HostHello = z.infer<typeof hostHelloSchema>;
70
+ declare const phoneHelloSchema: z.ZodObject<{
71
+ kind: z.ZodEnum<{
72
+ phone: "phone";
73
+ preview: "preview";
74
+ agent: "agent";
75
+ }>;
76
+ profile: z.ZodOptional<z.ZodObject<{
77
+ label: z.ZodOptional<z.ZodString>;
78
+ avatarId: z.ZodOptional<z.ZodString>;
79
+ localSeatLabel: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>>;
81
+ page: z.ZodOptional<z.ZodString>;
82
+ type: z.ZodLiteral<"hello">;
83
+ key: z.ZodString;
84
+ instance: z.ZodOptional<z.ZodString>;
85
+ sdk: z.ZodString;
86
+ features: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
+ }, z.core.$strip>;
88
+ type PhoneHello = z.infer<typeof phoneHelloSchema>;
89
+ declare const hostStateFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
90
+ fingerprint: z.ZodOptional<z.ZodString>;
91
+ private: z.ZodOptional<z.ZodString>;
92
+ type: z.ZodLiteral<"state">;
93
+ channel: z.ZodString;
94
+ revision: z.ZodNumber;
95
+ document: z.ZodCustom<StateDocument, StateDocument>;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ type: z.ZodLiteral<"state">;
98
+ channel: z.ZodString;
99
+ revision: z.ZodNumber;
100
+ base: z.ZodNumber;
101
+ set: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodArray<z.ZodString>, z.ZodUnknown], null>>>;
102
+ unset: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
103
+ }, z.core.$strip>]>;
104
+ type HostStateFrame = z.infer<typeof hostStateFrameSchema>;
105
+ declare const hostToRoomFrameSchemas: {
106
+ readonly state: z.ZodUnion<readonly [z.ZodObject<{
107
+ fingerprint: z.ZodOptional<z.ZodString>;
108
+ private: z.ZodOptional<z.ZodString>;
109
+ type: z.ZodLiteral<"state">;
110
+ channel: z.ZodString;
111
+ revision: z.ZodNumber;
112
+ document: z.ZodCustom<StateDocument, StateDocument>;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ type: z.ZodLiteral<"state">;
115
+ channel: z.ZodString;
116
+ revision: z.ZodNumber;
117
+ base: z.ZodNumber;
118
+ set: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodArray<z.ZodString>, z.ZodUnknown], null>>>;
119
+ unset: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
120
+ }, z.core.$strip>]>;
121
+ readonly response: z.ZodObject<{
122
+ type: z.ZodLiteral<"response">;
123
+ seat: z.ZodString;
124
+ id: z.ZodNumber;
125
+ result: z.ZodOptional<z.ZodUnknown>;
126
+ }, z.core.$strip>;
127
+ readonly signal: z.ZodObject<{
128
+ type: z.ZodLiteral<"signal">;
129
+ seat: z.ZodOptional<z.ZodString>;
130
+ kind: z.ZodString;
131
+ payload: z.ZodOptional<z.ZodUnknown>;
132
+ }, z.core.$strip>;
133
+ readonly room: z.ZodObject<{
134
+ type: z.ZodLiteral<"room">;
135
+ seats: z.ZodOptional<z.ZodNumber>;
136
+ locked: z.ZodOptional<z.ZodBoolean>;
137
+ }, z.core.$strip>;
138
+ readonly remove: z.ZodObject<{
139
+ type: z.ZodLiteral<"remove">;
140
+ seat: z.ZodString;
141
+ }, z.core.$strip>;
142
+ readonly drop: z.ZodObject<{
143
+ type: z.ZodLiteral<"drop">;
144
+ channel: z.ZodString;
145
+ }, z.core.$strip>;
146
+ readonly activity: z.ZodObject<{
147
+ type: z.ZodLiteral<"activity">;
148
+ activity: z.ZodNullable<z.ZodString>;
149
+ }, z.core.$strip>;
150
+ readonly end: z.ZodObject<{
151
+ type: z.ZodLiteral<"end">;
152
+ }, z.core.$strip>;
153
+ };
154
+ declare const phoneToRoomFrameSchemas: {
155
+ readonly request: z.ZodObject<{
156
+ type: z.ZodLiteral<"request">;
157
+ id: z.ZodNumber;
158
+ channel: z.ZodString;
159
+ name: z.ZodString;
160
+ payload: z.ZodOptional<z.ZodUnknown>;
161
+ }, z.core.$strip>;
162
+ readonly profile: z.ZodObject<{
163
+ type: z.ZodLiteral<"profile">;
164
+ label: z.ZodOptional<z.ZodString>;
165
+ avatarId: z.ZodOptional<z.ZodString>;
166
+ }, z.core.$strip>;
167
+ readonly leave: z.ZodObject<{
168
+ type: z.ZodLiteral<"leave">;
169
+ }, z.core.$strip>;
170
+ /** This seat's controls start again from zero, as a newly loaded controller frame's do. */
171
+ readonly baseline: z.ZodObject<{
172
+ type: z.ZodLiteral<"baseline">;
173
+ }, z.core.$strip>;
174
+ };
175
+ type FramesOf<Schemas extends Record<string, z.ZodType>> = {
176
+ [Type in keyof Schemas]: z.infer<Schemas[Type]>;
177
+ }[keyof Schemas];
178
+ type HostToRoomFrame = FramesOf<typeof hostToRoomFrameSchemas>;
179
+ type PhoneToRoomFrame = FramesOf<typeof phoneToRoomFrameSchemas>;
180
+ declare const seatViewSchema: z.ZodObject<{
181
+ id: z.ZodString;
182
+ label: z.ZodString;
183
+ color: z.ZodString;
184
+ avatarId: z.ZodOptional<z.ZodString>;
185
+ kind: z.ZodEnum<{
186
+ phone: "phone";
187
+ preview: "preview";
188
+ agent: "agent";
189
+ }>;
190
+ connected: z.ZodBoolean;
191
+ }, z.core.$strip>;
192
+ type SeatView = z.infer<typeof seatViewSchema>;
193
+ declare const channelCopySchema: z.ZodObject<{
194
+ channel: z.ZodString;
195
+ revision: z.ZodNumber;
196
+ document: z.ZodCustom<StateDocument, StateDocument>;
197
+ fingerprint: z.ZodOptional<z.ZodString>;
198
+ private: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strip>;
200
+ type ChannelCopy = z.infer<typeof channelCopySchema>;
201
+ declare const roomStateFrameSchema: z.ZodUnion<readonly [z.ZodObject<{
202
+ type: z.ZodLiteral<"state">;
203
+ channel: z.ZodString;
204
+ revision: z.ZodNumber;
205
+ document: z.ZodCustom<StateDocument, StateDocument>;
206
+ }, z.core.$strip>, z.ZodObject<{
207
+ type: z.ZodLiteral<"state">;
208
+ channel: z.ZodString;
209
+ revision: z.ZodNumber;
210
+ base: z.ZodNumber;
211
+ set: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodArray<z.ZodString>, z.ZodUnknown], null>>>;
212
+ unset: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
213
+ }, z.core.$strip>]>;
214
+ type RoomStateFrame = z.infer<typeof roomStateFrameSchema>;
215
+ declare const roomToHostFrameSchemas: {
216
+ readonly welcome: z.ZodObject<{
217
+ seatsWanted: z.ZodNumber;
218
+ locked: z.ZodBoolean;
219
+ activity: z.ZodNullable<z.ZodString>;
220
+ type: z.ZodLiteral<"welcome">;
221
+ code: z.ZodString;
222
+ instance: z.ZodString;
223
+ seats: z.ZodArray<z.ZodObject<{
224
+ id: z.ZodString;
225
+ label: z.ZodString;
226
+ color: z.ZodString;
227
+ avatarId: z.ZodOptional<z.ZodString>;
228
+ kind: z.ZodEnum<{
229
+ phone: "phone";
230
+ preview: "preview";
231
+ agent: "agent";
232
+ }>;
233
+ connected: z.ZodBoolean;
234
+ }, z.core.$strip>>;
235
+ channels: z.ZodArray<z.ZodObject<{
236
+ channel: z.ZodString;
237
+ revision: z.ZodNumber;
238
+ document: z.ZodCustom<StateDocument, StateDocument>;
239
+ fingerprint: z.ZodOptional<z.ZodString>;
240
+ private: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$strip>>;
242
+ limits: z.ZodObject<{
243
+ seats: z.ZodNumber;
244
+ channels: z.ZodNumber;
245
+ inputIntervalMs: z.ZodNumber;
246
+ inputBytes: z.ZodNumber;
247
+ inputsPerSecond: z.ZodNumber;
248
+ stateBytes: z.ZodNumber;
249
+ statesPerSecond: z.ZodNumber;
250
+ frameBytes: z.ZodNumber;
251
+ framesPerSecond: z.ZodNumber;
252
+ strikesPerSecond: z.ZodNumber;
253
+ seatHoldMs: z.ZodNumber;
254
+ hostGraceMs: z.ZodNumber;
255
+ maximumAgeMs: z.ZodNumber;
256
+ }, z.core.$strip>;
257
+ features: z.ZodArray<z.ZodString>;
258
+ }, z.core.$strip>;
259
+ readonly wait: z.ZodObject<{
260
+ type: z.ZodLiteral<"wait">;
261
+ position: z.ZodNumber;
262
+ }, z.core.$strip>;
263
+ readonly seat: z.ZodObject<{
264
+ type: z.ZodLiteral<"seat">;
265
+ seat: z.ZodObject<{
266
+ id: z.ZodString;
267
+ label: z.ZodString;
268
+ color: z.ZodString;
269
+ avatarId: z.ZodOptional<z.ZodString>;
270
+ kind: z.ZodEnum<{
271
+ phone: "phone";
272
+ preview: "preview";
273
+ agent: "agent";
274
+ }>;
275
+ connected: z.ZodBoolean;
276
+ }, z.core.$strip>;
277
+ inputBaseline: z.ZodOptional<z.ZodLiteral<true>>;
278
+ }, z.core.$strip>;
279
+ readonly left: z.ZodObject<{
280
+ type: z.ZodLiteral<"left">;
281
+ seat: z.ZodString;
282
+ }, z.core.$strip>;
283
+ readonly need: z.ZodObject<{
284
+ type: z.ZodLiteral<"need">;
285
+ channel: z.ZodString;
286
+ }, z.core.$strip>;
287
+ readonly request: z.ZodObject<{
288
+ type: z.ZodLiteral<"request">;
289
+ seat: z.ZodString;
290
+ id: z.ZodNumber;
291
+ channel: z.ZodString;
292
+ name: z.ZodString;
293
+ payload: z.ZodOptional<z.ZodUnknown>;
294
+ }, z.core.$strip>;
295
+ };
296
+ declare const roomToPhoneFrameSchemas: {
297
+ readonly welcome: z.ZodObject<{
298
+ seat: z.ZodString;
299
+ host: z.ZodBoolean;
300
+ type: z.ZodLiteral<"welcome">;
301
+ code: z.ZodString;
302
+ instance: z.ZodString;
303
+ seats: z.ZodArray<z.ZodObject<{
304
+ id: z.ZodString;
305
+ label: z.ZodString;
306
+ color: z.ZodString;
307
+ avatarId: z.ZodOptional<z.ZodString>;
308
+ kind: z.ZodEnum<{
309
+ phone: "phone";
310
+ preview: "preview";
311
+ agent: "agent";
312
+ }>;
313
+ connected: z.ZodBoolean;
314
+ }, z.core.$strip>>;
315
+ channels: z.ZodArray<z.ZodObject<{
316
+ channel: z.ZodString;
317
+ revision: z.ZodNumber;
318
+ document: z.ZodCustom<StateDocument, StateDocument>;
319
+ fingerprint: z.ZodOptional<z.ZodString>;
320
+ private: z.ZodOptional<z.ZodString>;
321
+ }, z.core.$strip>>;
322
+ limits: z.ZodObject<{
323
+ seats: z.ZodNumber;
324
+ channels: z.ZodNumber;
325
+ inputIntervalMs: z.ZodNumber;
326
+ inputBytes: z.ZodNumber;
327
+ inputsPerSecond: z.ZodNumber;
328
+ stateBytes: z.ZodNumber;
329
+ statesPerSecond: z.ZodNumber;
330
+ frameBytes: z.ZodNumber;
331
+ framesPerSecond: z.ZodNumber;
332
+ strikesPerSecond: z.ZodNumber;
333
+ seatHoldMs: z.ZodNumber;
334
+ hostGraceMs: z.ZodNumber;
335
+ maximumAgeMs: z.ZodNumber;
336
+ }, z.core.$strip>;
337
+ features: z.ZodArray<z.ZodString>;
338
+ }, z.core.$strip>;
339
+ readonly seat: z.ZodObject<{
340
+ type: z.ZodLiteral<"seat">;
341
+ seat: z.ZodObject<{
342
+ id: z.ZodString;
343
+ label: z.ZodString;
344
+ color: z.ZodString;
345
+ avatarId: z.ZodOptional<z.ZodString>;
346
+ kind: z.ZodEnum<{
347
+ phone: "phone";
348
+ preview: "preview";
349
+ agent: "agent";
350
+ }>;
351
+ connected: z.ZodBoolean;
352
+ }, z.core.$strip>;
353
+ inputBaseline: z.ZodOptional<z.ZodLiteral<true>>;
354
+ }, z.core.$strip>;
355
+ readonly left: z.ZodObject<{
356
+ type: z.ZodLiteral<"left">;
357
+ seat: z.ZodString;
358
+ }, z.core.$strip>;
359
+ readonly host: z.ZodObject<{
360
+ type: z.ZodLiteral<"host">;
361
+ present: z.ZodBoolean;
362
+ }, z.core.$strip>;
363
+ readonly state: z.ZodUnion<readonly [z.ZodObject<{
364
+ type: z.ZodLiteral<"state">;
365
+ channel: z.ZodString;
366
+ revision: z.ZodNumber;
367
+ document: z.ZodCustom<StateDocument, StateDocument>;
368
+ }, z.core.$strip>, z.ZodObject<{
369
+ type: z.ZodLiteral<"state">;
370
+ channel: z.ZodString;
371
+ revision: z.ZodNumber;
372
+ base: z.ZodNumber;
373
+ set: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodArray<z.ZodString>, z.ZodUnknown], null>>>;
374
+ unset: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
375
+ }, z.core.$strip>]>;
376
+ readonly drop: z.ZodObject<{
377
+ type: z.ZodLiteral<"drop">;
378
+ channel: z.ZodString;
379
+ }, z.core.$strip>;
380
+ readonly response: z.ZodUnion<readonly [z.ZodObject<{
381
+ type: z.ZodLiteral<"response">;
382
+ id: z.ZodNumber;
383
+ refused: z.ZodLiteral<"host-away">;
384
+ }, z.core.$strip>, z.ZodObject<{
385
+ type: z.ZodLiteral<"response">;
386
+ id: z.ZodNumber;
387
+ result: z.ZodOptional<z.ZodUnknown>;
388
+ }, z.core.$strip>]>;
389
+ readonly signal: z.ZodObject<{
390
+ type: z.ZodLiteral<"signal">;
391
+ kind: z.ZodString;
392
+ payload: z.ZodOptional<z.ZodUnknown>;
393
+ }, z.core.$strip>;
394
+ };
395
+ type RoomToHostFrame = FramesOf<typeof roomToHostFrameSchemas>;
396
+ type RoomToPhoneFrame = FramesOf<typeof roomToPhoneFrameSchemas>;
397
+ type ParsedFrame<Frame> = {
398
+ readonly status: "frame";
399
+ readonly frame: Frame;
400
+ }
401
+ /** A newer peer's frame type; ignored, not an error. */
402
+ | {
403
+ readonly status: "unknown";
404
+ } | {
405
+ readonly status: "invalid";
406
+ }
407
+ /** Nested past `MAXIMUM_FRAME_DEPTH`; a limit broken, not a mistake. */
408
+ | {
409
+ readonly status: "too-deep";
410
+ };
411
+ declare const parseHostToRoomFrame: (text: string) => ParsedFrame<FramesOf<{
412
+ readonly state: z.ZodUnion<readonly [z.ZodObject<{
413
+ fingerprint: z.ZodOptional<z.ZodString>;
414
+ private: z.ZodOptional<z.ZodString>;
415
+ type: z.ZodLiteral<"state">;
416
+ channel: z.ZodString;
417
+ revision: z.ZodNumber;
418
+ document: z.ZodCustom<StateDocument, StateDocument>;
419
+ }, z.core.$strip>, z.ZodObject<{
420
+ type: z.ZodLiteral<"state">;
421
+ channel: z.ZodString;
422
+ revision: z.ZodNumber;
423
+ base: z.ZodNumber;
424
+ set: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodArray<z.ZodString>, z.ZodUnknown], null>>>;
425
+ unset: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
426
+ }, z.core.$strip>]>;
427
+ readonly response: z.ZodObject<{
428
+ type: z.ZodLiteral<"response">;
429
+ seat: z.ZodString;
430
+ id: z.ZodNumber;
431
+ result: z.ZodOptional<z.ZodUnknown>;
432
+ }, z.core.$strip>;
433
+ readonly signal: z.ZodObject<{
434
+ type: z.ZodLiteral<"signal">;
435
+ seat: z.ZodOptional<z.ZodString>;
436
+ kind: z.ZodString;
437
+ payload: z.ZodOptional<z.ZodUnknown>;
438
+ }, z.core.$strip>;
439
+ readonly room: z.ZodObject<{
440
+ type: z.ZodLiteral<"room">;
441
+ seats: z.ZodOptional<z.ZodNumber>;
442
+ locked: z.ZodOptional<z.ZodBoolean>;
443
+ }, z.core.$strip>;
444
+ readonly remove: z.ZodObject<{
445
+ type: z.ZodLiteral<"remove">;
446
+ seat: z.ZodString;
447
+ }, z.core.$strip>;
448
+ readonly drop: z.ZodObject<{
449
+ type: z.ZodLiteral<"drop">;
450
+ channel: z.ZodString;
451
+ }, z.core.$strip>;
452
+ readonly activity: z.ZodObject<{
453
+ type: z.ZodLiteral<"activity">;
454
+ activity: z.ZodNullable<z.ZodString>;
455
+ }, z.core.$strip>;
456
+ readonly end: z.ZodObject<{
457
+ type: z.ZodLiteral<"end">;
458
+ }, z.core.$strip>;
459
+ }>>;
460
+ declare const parsePhoneToRoomFrame: (text: string) => ParsedFrame<FramesOf<{
461
+ readonly request: z.ZodObject<{
462
+ type: z.ZodLiteral<"request">;
463
+ id: z.ZodNumber;
464
+ channel: z.ZodString;
465
+ name: z.ZodString;
466
+ payload: z.ZodOptional<z.ZodUnknown>;
467
+ }, z.core.$strip>;
468
+ readonly profile: z.ZodObject<{
469
+ type: z.ZodLiteral<"profile">;
470
+ label: z.ZodOptional<z.ZodString>;
471
+ avatarId: z.ZodOptional<z.ZodString>;
472
+ }, z.core.$strip>;
473
+ readonly leave: z.ZodObject<{
474
+ type: z.ZodLiteral<"leave">;
475
+ }, z.core.$strip>;
476
+ /** This seat's controls start again from zero, as a newly loaded controller frame's do. */
477
+ readonly baseline: z.ZodObject<{
478
+ type: z.ZodLiteral<"baseline">;
479
+ }, z.core.$strip>;
480
+ }>>;
481
+ declare const parseRoomToHostFrame: (text: string) => ParsedFrame<FramesOf<{
482
+ readonly welcome: z.ZodObject<{
483
+ seatsWanted: z.ZodNumber;
484
+ locked: z.ZodBoolean;
485
+ activity: z.ZodNullable<z.ZodString>;
486
+ type: z.ZodLiteral<"welcome">;
487
+ code: z.ZodString;
488
+ instance: z.ZodString;
489
+ seats: z.ZodArray<z.ZodObject<{
490
+ id: z.ZodString;
491
+ label: z.ZodString;
492
+ color: z.ZodString;
493
+ avatarId: z.ZodOptional<z.ZodString>;
494
+ kind: z.ZodEnum<{
495
+ phone: "phone";
496
+ preview: "preview";
497
+ agent: "agent";
498
+ }>;
499
+ connected: z.ZodBoolean;
500
+ }, z.core.$strip>>;
501
+ channels: z.ZodArray<z.ZodObject<{
502
+ channel: z.ZodString;
503
+ revision: z.ZodNumber;
504
+ document: z.ZodCustom<StateDocument, StateDocument>;
505
+ fingerprint: z.ZodOptional<z.ZodString>;
506
+ private: z.ZodOptional<z.ZodString>;
507
+ }, z.core.$strip>>;
508
+ limits: z.ZodObject<{
509
+ seats: z.ZodNumber;
510
+ channels: z.ZodNumber;
511
+ inputIntervalMs: z.ZodNumber;
512
+ inputBytes: z.ZodNumber;
513
+ inputsPerSecond: z.ZodNumber;
514
+ stateBytes: z.ZodNumber;
515
+ statesPerSecond: z.ZodNumber;
516
+ frameBytes: z.ZodNumber;
517
+ framesPerSecond: z.ZodNumber;
518
+ strikesPerSecond: z.ZodNumber;
519
+ seatHoldMs: z.ZodNumber;
520
+ hostGraceMs: z.ZodNumber;
521
+ maximumAgeMs: z.ZodNumber;
522
+ }, z.core.$strip>;
523
+ features: z.ZodArray<z.ZodString>;
524
+ }, z.core.$strip>;
525
+ readonly wait: z.ZodObject<{
526
+ type: z.ZodLiteral<"wait">;
527
+ position: z.ZodNumber;
528
+ }, z.core.$strip>;
529
+ readonly seat: z.ZodObject<{
530
+ type: z.ZodLiteral<"seat">;
531
+ seat: z.ZodObject<{
532
+ id: z.ZodString;
533
+ label: z.ZodString;
534
+ color: z.ZodString;
535
+ avatarId: z.ZodOptional<z.ZodString>;
536
+ kind: z.ZodEnum<{
537
+ phone: "phone";
538
+ preview: "preview";
539
+ agent: "agent";
540
+ }>;
541
+ connected: z.ZodBoolean;
542
+ }, z.core.$strip>;
543
+ inputBaseline: z.ZodOptional<z.ZodLiteral<true>>;
544
+ }, z.core.$strip>;
545
+ readonly left: z.ZodObject<{
546
+ type: z.ZodLiteral<"left">;
547
+ seat: z.ZodString;
548
+ }, z.core.$strip>;
549
+ readonly need: z.ZodObject<{
550
+ type: z.ZodLiteral<"need">;
551
+ channel: z.ZodString;
552
+ }, z.core.$strip>;
553
+ readonly request: z.ZodObject<{
554
+ type: z.ZodLiteral<"request">;
555
+ seat: z.ZodString;
556
+ id: z.ZodNumber;
557
+ channel: z.ZodString;
558
+ name: z.ZodString;
559
+ payload: z.ZodOptional<z.ZodUnknown>;
560
+ }, z.core.$strip>;
561
+ }>>;
562
+ declare const parseRoomToPhoneFrame: (text: string) => ParsedFrame<FramesOf<{
563
+ readonly welcome: z.ZodObject<{
564
+ seat: z.ZodString;
565
+ host: z.ZodBoolean;
566
+ type: z.ZodLiteral<"welcome">;
567
+ code: z.ZodString;
568
+ instance: z.ZodString;
569
+ seats: z.ZodArray<z.ZodObject<{
570
+ id: z.ZodString;
571
+ label: z.ZodString;
572
+ color: z.ZodString;
573
+ avatarId: z.ZodOptional<z.ZodString>;
574
+ kind: z.ZodEnum<{
575
+ phone: "phone";
576
+ preview: "preview";
577
+ agent: "agent";
578
+ }>;
579
+ connected: z.ZodBoolean;
580
+ }, z.core.$strip>>;
581
+ channels: z.ZodArray<z.ZodObject<{
582
+ channel: z.ZodString;
583
+ revision: z.ZodNumber;
584
+ document: z.ZodCustom<StateDocument, StateDocument>;
585
+ fingerprint: z.ZodOptional<z.ZodString>;
586
+ private: z.ZodOptional<z.ZodString>;
587
+ }, z.core.$strip>>;
588
+ limits: z.ZodObject<{
589
+ seats: z.ZodNumber;
590
+ channels: z.ZodNumber;
591
+ inputIntervalMs: z.ZodNumber;
592
+ inputBytes: z.ZodNumber;
593
+ inputsPerSecond: z.ZodNumber;
594
+ stateBytes: z.ZodNumber;
595
+ statesPerSecond: z.ZodNumber;
596
+ frameBytes: z.ZodNumber;
597
+ framesPerSecond: z.ZodNumber;
598
+ strikesPerSecond: z.ZodNumber;
599
+ seatHoldMs: z.ZodNumber;
600
+ hostGraceMs: z.ZodNumber;
601
+ maximumAgeMs: z.ZodNumber;
602
+ }, z.core.$strip>;
603
+ features: z.ZodArray<z.ZodString>;
604
+ }, z.core.$strip>;
605
+ readonly seat: z.ZodObject<{
606
+ type: z.ZodLiteral<"seat">;
607
+ seat: z.ZodObject<{
608
+ id: z.ZodString;
609
+ label: z.ZodString;
610
+ color: z.ZodString;
611
+ avatarId: z.ZodOptional<z.ZodString>;
612
+ kind: z.ZodEnum<{
613
+ phone: "phone";
614
+ preview: "preview";
615
+ agent: "agent";
616
+ }>;
617
+ connected: z.ZodBoolean;
618
+ }, z.core.$strip>;
619
+ inputBaseline: z.ZodOptional<z.ZodLiteral<true>>;
620
+ }, z.core.$strip>;
621
+ readonly left: z.ZodObject<{
622
+ type: z.ZodLiteral<"left">;
623
+ seat: z.ZodString;
624
+ }, z.core.$strip>;
625
+ readonly host: z.ZodObject<{
626
+ type: z.ZodLiteral<"host">;
627
+ present: z.ZodBoolean;
628
+ }, z.core.$strip>;
629
+ readonly state: z.ZodUnion<readonly [z.ZodObject<{
630
+ type: z.ZodLiteral<"state">;
631
+ channel: z.ZodString;
632
+ revision: z.ZodNumber;
633
+ document: z.ZodCustom<StateDocument, StateDocument>;
634
+ }, z.core.$strip>, z.ZodObject<{
635
+ type: z.ZodLiteral<"state">;
636
+ channel: z.ZodString;
637
+ revision: z.ZodNumber;
638
+ base: z.ZodNumber;
639
+ set: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodArray<z.ZodString>, z.ZodUnknown], null>>>;
640
+ unset: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodString>>>;
641
+ }, z.core.$strip>]>;
642
+ readonly drop: z.ZodObject<{
643
+ type: z.ZodLiteral<"drop">;
644
+ channel: z.ZodString;
645
+ }, z.core.$strip>;
646
+ readonly response: z.ZodUnion<readonly [z.ZodObject<{
647
+ type: z.ZodLiteral<"response">;
648
+ id: z.ZodNumber;
649
+ refused: z.ZodLiteral<"host-away">;
650
+ }, z.core.$strip>, z.ZodObject<{
651
+ type: z.ZodLiteral<"response">;
652
+ id: z.ZodNumber;
653
+ result: z.ZodOptional<z.ZodUnknown>;
654
+ }, z.core.$strip>]>;
655
+ readonly signal: z.ZodObject<{
656
+ type: z.ZodLiteral<"signal">;
657
+ kind: z.ZodString;
658
+ payload: z.ZodOptional<z.ZodUnknown>;
659
+ }, z.core.$strip>;
660
+ }>>;
661
+ declare const parseHostHello: (text: string) => {
662
+ seats: number;
663
+ type: "hello";
664
+ key: string;
665
+ sdk: string;
666
+ credential?: string | undefined;
667
+ instance?: string | undefined;
668
+ features?: string[] | undefined;
669
+ } | null;
670
+ declare const parsePhoneHello: (text: string) => {
671
+ kind: "phone" | "preview" | "agent";
672
+ type: "hello";
673
+ key: string;
674
+ sdk: string;
675
+ profile?: {
676
+ label?: string | undefined;
677
+ avatarId?: string | undefined;
678
+ localSeatLabel?: string | undefined;
679
+ } | undefined;
680
+ page?: string | undefined;
681
+ instance?: string | undefined;
682
+ features?: string[] | undefined;
683
+ } | null;
684
+ declare const encodeFrame: (frame: HostHello | PhoneHello | HostToRoomFrame | PhoneToRoomFrame | RoomToHostFrame | RoomToPhoneFrame) => string;
685
+
686
+ export { parsePhoneToRoomFrame as A, parseRoomToHostFrame as B, type ChannelCopy as C, parseRoomToPhoneFrame as D, parseHostHello as E, parsePhoneHello as F, encodeFrame as G, type HostHello as H, type StatePath as I, isPlainObject as J, readStatePath as K, diffState as L, MAXIMUM_FRAME_DEPTH as M, isEmptyStatePatch as N, applyStatePatch as O, PING_FRAME as P, ROOM_PROTOCOL_VERSION as R, type SeatView as S, type StateDocument as a, type StatePatch as b, PONG_FRAME as c, type SeatKind as d, seatProfileSchema as e, type SeatProfile as f, type PhoneHello as g, hostHelloSchema as h, hostStateFrameSchema as i, type HostStateFrame as j, hostToRoomFrameSchemas as k, phoneToRoomFrameSchemas as l, type HostToRoomFrame as m, type PhoneToRoomFrame as n, seatViewSchema as o, phoneHelloSchema as p, channelCopySchema as q, roomStateFrameSchema as r, seatKindSchema as s, type RoomStateFrame as t, roomToHostFrameSchemas as u, roomToPhoneFrameSchemas as v, type RoomToHostFrame as w, type RoomToPhoneFrame as x, type ParsedFrame as y, parseHostToRoomFrame as z };