@air-jam/sdk 0.9.1 → 0.9.3

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 (247) hide show
  1. package/README.md +25 -45
  2. package/dist/{agent-tooling-BSMGBix9.d.cts → agent-contract-CD2QnbBJ.d.cts} +1 -1
  3. package/dist/{agent-tooling-BSMGBix9.d.ts → agent-contract-CD2QnbBJ.d.ts} +1 -1
  4. package/dist/agent-tooling.cjs +139 -0
  5. package/dist/agent-tooling.cjs.map +1 -1
  6. package/dist/agent-tooling.d.cts +25 -1
  7. package/dist/agent-tooling.d.ts +25 -1
  8. package/dist/agent-tooling.js +138 -0
  9. package/dist/agent-tooling.js.map +1 -1
  10. package/dist/air-jam-context-BlLPvCup.d.cts +175 -0
  11. package/dist/air-jam-context-DTsxF-tP.d.ts +175 -0
  12. package/dist/arcade/bridge/controller.cjs +214 -194
  13. package/dist/arcade/bridge/controller.cjs.map +1 -1
  14. package/dist/arcade/bridge/controller.d.cts +2 -2
  15. package/dist/arcade/bridge/controller.d.ts +2 -2
  16. package/dist/arcade/bridge/controller.js +6 -4
  17. package/dist/arcade/bridge/host.cjs +1 -1
  18. package/dist/arcade/bridge/host.cjs.map +1 -1
  19. package/dist/arcade/bridge/host.d.cts +3 -3
  20. package/dist/arcade/bridge/host.d.ts +3 -3
  21. package/dist/arcade/bridge/host.js +4 -3
  22. package/dist/arcade/bridge/iframe.cjs +1 -1
  23. package/dist/arcade/bridge/iframe.cjs.map +1 -1
  24. package/dist/arcade/bridge/iframe.d.cts +2 -2
  25. package/dist/arcade/bridge/iframe.d.ts +2 -2
  26. package/dist/arcade/bridge/iframe.js +4 -4
  27. package/dist/arcade/bridge.cjs +251 -231
  28. package/dist/arcade/bridge.cjs.map +1 -1
  29. package/dist/arcade/bridge.d.cts +4 -4
  30. package/dist/arcade/bridge.d.ts +4 -4
  31. package/dist/arcade/bridge.js +9 -7
  32. package/dist/arcade/host.cjs +145 -122
  33. package/dist/arcade/host.cjs.map +1 -1
  34. package/dist/arcade/host.d.cts +5 -4
  35. package/dist/arcade/host.d.ts +5 -4
  36. package/dist/arcade/host.js +6 -5
  37. package/dist/arcade/runtime.cjs +6499 -0
  38. package/dist/arcade/runtime.cjs.map +1 -0
  39. package/dist/arcade/runtime.d.cts +22 -0
  40. package/dist/arcade/runtime.d.ts +22 -0
  41. package/dist/arcade/runtime.js +32 -0
  42. package/dist/arcade/runtime.js.map +1 -0
  43. package/dist/arcade/surface.cjs +9 -0
  44. package/dist/arcade/surface.cjs.map +1 -1
  45. package/dist/arcade/surface.d.cts +6 -1
  46. package/dist/arcade/surface.d.ts +6 -1
  47. package/dist/arcade/surface.js +6 -2
  48. package/dist/arcade/url.d.cts +4 -4
  49. package/dist/arcade/url.d.ts +4 -4
  50. package/dist/arcade/url.js +5 -5
  51. package/dist/arcade.cjs +322 -292
  52. package/dist/arcade.cjs.map +1 -1
  53. package/dist/arcade.d.cts +6 -6
  54. package/dist/arcade.d.ts +6 -6
  55. package/dist/arcade.js +35 -29
  56. package/dist/{chunk-CEJ5RFSG.js → chunk-2SZ2YYGJ.js} +8 -16
  57. package/dist/chunk-2SZ2YYGJ.js.map +1 -0
  58. package/dist/{chunk-VKBMZHMQ.js → chunk-32RSSFSF.js} +10 -12
  59. package/dist/chunk-32RSSFSF.js.map +1 -0
  60. package/dist/chunk-3YMUAKPU.js +10 -0
  61. package/dist/chunk-3YMUAKPU.js.map +1 -0
  62. package/dist/chunk-56DM2KEW.js +14 -0
  63. package/dist/chunk-56DM2KEW.js.map +1 -0
  64. package/dist/chunk-CM53YLT5.js +59 -0
  65. package/dist/chunk-CM53YLT5.js.map +1 -0
  66. package/dist/{chunk-JEHV5C2X.js → chunk-CV3PBXPT.js} +3 -3
  67. package/dist/chunk-D4VDEVTZ.js +80 -0
  68. package/dist/chunk-D4VDEVTZ.js.map +1 -0
  69. package/dist/{chunk-W3YA5BWR.js → chunk-FUA6EMSJ.js} +24 -60
  70. package/dist/chunk-FUA6EMSJ.js.map +1 -0
  71. package/dist/chunk-GMLU7RI5.js +70 -0
  72. package/dist/chunk-GMLU7RI5.js.map +1 -0
  73. package/dist/{chunk-NCL6WJCL.js → chunk-IG6GZZSS.js} +32 -1
  74. package/dist/chunk-IG6GZZSS.js.map +1 -0
  75. package/dist/{chunk-EDRQIOCV.js → chunk-ITMQSBTH.js} +3 -2
  76. package/dist/chunk-ITMQSBTH.js.map +1 -0
  77. package/dist/{chunk-32NYL7XI.js → chunk-J5MCII33.js} +189 -108
  78. package/dist/chunk-J5MCII33.js.map +1 -0
  79. package/dist/{chunk-ZLPL2R3R.js → chunk-K4OZ54UD.js} +7 -34
  80. package/dist/chunk-K4OZ54UD.js.map +1 -0
  81. package/dist/{chunk-KXAFI5OP.js → chunk-LIHEEAVE.js} +9 -11
  82. package/dist/chunk-LIHEEAVE.js.map +1 -0
  83. package/dist/{chunk-FAT2KJ3K.js → chunk-MIMPMB7O.js} +2 -2
  84. package/dist/{chunk-NUJBMV3O.js → chunk-O6X7FJ6N.js} +29 -32
  85. package/dist/chunk-O6X7FJ6N.js.map +1 -0
  86. package/dist/chunk-PSUYTD2L.js +16 -0
  87. package/dist/chunk-PSUYTD2L.js.map +1 -0
  88. package/dist/{chunk-7UXSWCZZ.js → chunk-QO4KFUEI.js} +2 -2
  89. package/dist/chunk-QTLYZADF.js +125 -0
  90. package/dist/chunk-QTLYZADF.js.map +1 -0
  91. package/dist/chunk-TTQDHKXL.js +3017 -0
  92. package/dist/chunk-TTQDHKXL.js.map +1 -0
  93. package/dist/chunk-UCPY7UJC.js +8 -0
  94. package/dist/chunk-UCPY7UJC.js.map +1 -0
  95. package/dist/{chunk-JO2HR5PV.js → chunk-UPV6YWT5.js} +4 -4
  96. package/dist/chunk-X35LLCWV.js +65 -0
  97. package/dist/chunk-X35LLCWV.js.map +1 -0
  98. package/dist/{controller-DxVchfiA.d.ts → controller-PZEM_1cH.d.ts} +6 -2
  99. package/dist/{controller-Bod8YYr1.d.cts → controller-vj82tKm4.d.cts} +6 -2
  100. package/dist/{dev-log-events-CVAM29hx.d.cts → dev-log-events-BCJKmygo.d.cts} +0 -3
  101. package/dist/{dev-log-events-CVAM29hx.d.ts → dev-log-events-BCJKmygo.d.ts} +0 -3
  102. package/dist/{host-8hmq_Sgc.d.cts → host-B9pRy0Aa.d.cts} +20 -7
  103. package/dist/{host-Cw-N6e-5.d.ts → host-DylGsX7p.d.ts} +20 -7
  104. package/dist/index.cjs +4275 -3813
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.cts +40 -642
  107. package/dist/index.d.ts +40 -642
  108. package/dist/index.js +1032 -3658
  109. package/dist/index.js.map +1 -1
  110. package/dist/metadata.cjs.map +1 -1
  111. package/dist/metadata.d.cts +2 -3
  112. package/dist/metadata.d.ts +2 -3
  113. package/dist/metadata.js.map +1 -1
  114. package/dist/{notices-CnGaaS8B.d.ts → notices-C4bao3oi.d.ts} +1 -1
  115. package/dist/{notices-NyDM5Mtz.d.cts → notices-DNdOjwtj.d.cts} +1 -1
  116. package/dist/platform-machine.cjs +115 -15
  117. package/dist/platform-machine.cjs.map +1 -1
  118. package/dist/platform-machine.d.cts +1338 -65
  119. package/dist/platform-machine.d.ts +1338 -65
  120. package/dist/platform-machine.js +88 -15
  121. package/dist/platform-machine.js.map +1 -1
  122. package/dist/{platform-settings-cuor3i11.d.cts → platform-settings-DUWs4JTy.d.cts} +1 -1
  123. package/dist/{platform-settings-cuor3i11.d.ts → platform-settings-DUWs4JTy.d.ts} +1 -1
  124. package/dist/preview.cjs +301 -253
  125. package/dist/preview.cjs.map +1 -1
  126. package/dist/preview.d.cts +6 -4
  127. package/dist/preview.d.ts +6 -4
  128. package/dist/preview.js +31 -21
  129. package/dist/preview.js.map +1 -1
  130. package/dist/protocol.cjs +282 -167
  131. package/dist/protocol.cjs.map +1 -1
  132. package/dist/protocol.d.cts +74 -21
  133. package/dist/protocol.d.ts +74 -21
  134. package/dist/protocol.js +28 -10
  135. package/dist/release.cjs +37 -0
  136. package/dist/release.cjs.map +1 -1
  137. package/dist/release.d.cts +27 -1
  138. package/dist/release.d.ts +27 -1
  139. package/dist/release.js +13 -1
  140. package/dist/runtime-control.cjs +46 -0
  141. package/dist/runtime-control.cjs.map +1 -0
  142. package/dist/runtime-control.d.cts +17 -0
  143. package/dist/runtime-control.d.ts +17 -0
  144. package/dist/runtime-control.js +8 -0
  145. package/dist/runtime-control.js.map +1 -0
  146. package/dist/runtime-inspection.cjs +655 -0
  147. package/dist/runtime-inspection.cjs.map +1 -0
  148. package/dist/runtime-inspection.d.cts +47 -0
  149. package/dist/runtime-inspection.d.ts +47 -0
  150. package/dist/runtime-inspection.js +30 -0
  151. package/dist/runtime-inspection.js.map +1 -0
  152. package/dist/runtime-reporting-pe-eryVz.d.cts +27 -0
  153. package/dist/runtime-reporting-pe-eryVz.d.ts +27 -0
  154. package/dist/signals-ZHftIKuc.d.cts +33 -0
  155. package/dist/signals-ZHftIKuc.d.ts +33 -0
  156. package/dist/{standard-match-phase-BucA5dYo.d.ts → standard-match-phase-BzSgBYFg.d.ts} +2 -2
  157. package/dist/{standard-match-phase-U2ra8J-0.d.cts → standard-match-phase-CvJUW8Oe.d.cts} +2 -2
  158. package/dist/{sync-B6QsNrXz.d.cts → sync-xtPfWhif.d.cts} +1 -45
  159. package/dist/{sync-B6QsNrXz.d.ts → sync-xtPfWhif.d.ts} +1 -45
  160. package/dist/ui.cjs +689 -629
  161. package/dist/ui.cjs.map +1 -1
  162. package/dist/ui.d.cts +14 -4
  163. package/dist/ui.d.ts +14 -4
  164. package/dist/ui.js +117 -35
  165. package/dist/ui.js.map +1 -1
  166. package/dist/use-air-jam-host-COLy8t4s.d.ts +403 -0
  167. package/dist/use-air-jam-host-DM-ybB3C.d.cts +403 -0
  168. package/package.json +55 -21
  169. package/src/agent/agent-contract-conformance.ts +201 -0
  170. package/src/agent-tooling.ts +5 -0
  171. package/src/arcade/runtime.ts +6 -0
  172. package/src/arcade/surface.ts +1 -0
  173. package/src/components/join-qr-overlay.tsx +115 -31
  174. package/src/context/air-jam-context.tsx +8 -8
  175. package/src/context/socket-manager.ts +0 -7
  176. package/src/dev/browser-log-sink.ts +12 -15
  177. package/src/events.ts +0 -5
  178. package/src/hooks/internal/use-controller-runtime-api.ts +110 -21
  179. package/src/hooks/internal/use-host-runtime-api.ts +306 -49
  180. package/src/hooks/use-air-jam-controller.ts +9 -9
  181. package/src/hooks/use-air-jam-host.ts +7 -7
  182. package/src/hooks/use-get-input.ts +1 -1
  183. package/src/hooks/use-host-arcade-restore.ts +6 -1
  184. package/src/hooks/use-host-audio-mute-preference.ts +99 -0
  185. package/src/index.ts +6 -21
  186. package/src/metadata/manifest.ts +2 -3
  187. package/src/platform-machine.ts +109 -12
  188. package/src/preview/workspace.tsx +48 -29
  189. package/src/protocol/arcade-platform-actions.ts +19 -1
  190. package/src/protocol/controller.ts +8 -2
  191. package/src/protocol/dev-log-events.ts +0 -3
  192. package/src/protocol/host-grant.ts +58 -140
  193. package/src/protocol/host.ts +21 -9
  194. package/src/protocol/runtime-reporting.ts +32 -0
  195. package/src/protocol/signed-envelope.ts +176 -0
  196. package/src/protocol/socket-events.ts +8 -10
  197. package/src/protocol/sync.ts +0 -16
  198. package/src/protocol.ts +2 -0
  199. package/src/release.ts +32 -0
  200. package/src/runtime/admission-retry.ts +62 -0
  201. package/src/runtime/air-jam-config.ts +6 -16
  202. package/src/runtime/air-jam-error-boundary.tsx +46 -2
  203. package/src/runtime/bridge-envelope-args.ts +21 -0
  204. package/src/runtime/connected-runtime-error-boundary.tsx +31 -0
  205. package/src/runtime/contracts/control.ts +107 -59
  206. package/src/runtime/controller-bridge.ts +12 -24
  207. package/src/runtime/controller-identity.ts +55 -27
  208. package/src/runtime/controller-realtime-client.ts +8 -47
  209. package/src/runtime/create-air-jam-app.tsx +21 -13
  210. package/src/runtime/host-bridge.ts +16 -24
  211. package/src/runtime/local-reference-game-identity.ts +13 -0
  212. package/src/runtime/runtime-session-params.ts +4 -64
  213. package/src/runtime-control.ts +3 -8
  214. package/src/settings/platform-settings-runtime.tsx +1 -6
  215. package/src/settings/platform-settings.ts +7 -38
  216. package/src/state/connection-store.ts +13 -6
  217. package/src/store/create-air-jam-store.ts +59 -7
  218. package/src/utils/ids.ts +32 -5
  219. package/dist/capabilities.cjs +0 -39
  220. package/dist/capabilities.cjs.map +0 -1
  221. package/dist/capabilities.d.cts +0 -31
  222. package/dist/capabilities.d.ts +0 -31
  223. package/dist/capabilities.js +0 -12
  224. package/dist/capabilities.js.map +0 -1
  225. package/dist/chunk-32NYL7XI.js.map +0 -1
  226. package/dist/chunk-CABEUV65.js +0 -184
  227. package/dist/chunk-CABEUV65.js.map +0 -1
  228. package/dist/chunk-CEJ5RFSG.js.map +0 -1
  229. package/dist/chunk-EDRQIOCV.js.map +0 -1
  230. package/dist/chunk-KXAFI5OP.js.map +0 -1
  231. package/dist/chunk-NCL6WJCL.js.map +0 -1
  232. package/dist/chunk-NUJBMV3O.js.map +0 -1
  233. package/dist/chunk-VKBMZHMQ.js.map +0 -1
  234. package/dist/chunk-W3YA5BWR.js.map +0 -1
  235. package/dist/chunk-ZLPL2R3R.js.map +0 -1
  236. package/dist/chunk-ZTQ5SP4H.js +0 -9
  237. package/dist/chunk-ZTQ5SP4H.js.map +0 -1
  238. package/src/capabilities/manifest.ts +0 -71
  239. package/src/capabilities.ts +0 -12
  240. package/src/hooks/internal/use-runtime-control-contract.ts +0 -15
  241. package/src/hooks/internal/use-runtime-observability-contract.ts +0 -24
  242. package/src/runtime/contracts/observability.ts +0 -94
  243. package/src/runtime-observability.ts +0 -9
  244. /package/dist/{chunk-JEHV5C2X.js.map → chunk-CV3PBXPT.js.map} +0 -0
  245. /package/dist/{chunk-FAT2KJ3K.js.map → chunk-MIMPMB7O.js.map} +0 -0
  246. /package/dist/{chunk-7UXSWCZZ.js.map → chunk-QO4KFUEI.js.map} +0 -0
  247. /package/dist/{chunk-JO2HR5PV.js.map → chunk-UPV6YWT5.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,21 +1,27 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, JSX, Component, ErrorInfo, MutableRefObject } from 'react';
3
- export { d as DEFAULT_PLATFORM_SETTINGS, D as DEFAULT_ROOM_PLATFORM_SETTINGS, i as PartialRoomPlatformSettingsPatch, e as PlatformAccessibilitySettings, b as PlatformAudioSettings, f as PlatformFeedbackSettings, h as PlatformPreviewControllerSettings, j as PlatformSettings, P as PlatformSettingsPersistence, a as PlatformSettingsSnapshot, R as RoomPlatformSettingsSnapshot, g as getEffectiveAudioVolume, m as mergeRoomPlatformSettingsSnapshot, t as toRoomPlatformSettingsSnapshot } from './platform-settings-cuor3i11.cjs';
4
- export { P as PlatformAudioSettingsApi, a as PlatformSettingsBoundary, e as PlatformSettingsBoundaryProps, f as PlatformSettingsOwnerApi, b as PlatformSettingsRuntime, g as PlatformSettingsRuntimeProps, S as ShellMatchPhase, k as StandardMatchPhase, i as isActiveMatchPhase, h as isEndedMatchPhase, j as isStandardMatchPhase, s as standardMatchPhases, t as toShellMatchPhase, u as useInheritedPlatformSettings, c as usePlatformAudioSettings, d as usePlatformSettings } from './standard-match-phase-U2ra8J-0.cjs';
5
- import { R as RoomCode, H as ConnectionStatus, J as RuntimeState, o as ControllerOrientation, u as ControllerRoomSettingsState, z as PlayerProfilePatch, f as ControllerUpdatePlayerProfileAck, h as ControllerLeaveAck, P as PlayerProfile, t as ControllerStatePayload, I as RunMode, m as ControllerInputPayload } from './controller-Bod8YYr1.cjs';
6
- import { A as AirJamRealtimeClient } from './realtime-client-Cu8yVJFw.cjs';
2
+ import { ReactNode, Component, JSX, ErrorInfo, MutableRefObject } from 'react';
3
+ export { d as DEFAULT_PLATFORM_SETTINGS, D as DEFAULT_ROOM_PLATFORM_SETTINGS, e as PartialRoomPlatformSettingsPatch, f as PlatformAccessibilitySettings, b as PlatformAudioSettings, h as PlatformFeedbackSettings, i as PlatformPreviewControllerSettings, j as PlatformSettings, P as PlatformSettingsPersistence, a as PlatformSettingsSnapshot, R as RoomPlatformSettingsSnapshot, g as getEffectiveAudioVolume, m as mergeRoomPlatformSettingsSnapshot, t as toRoomPlatformSettingsSnapshot } from './platform-settings-DUWs4JTy.cjs';
4
+ export { d as PlatformAudioSettingsApi, P as PlatformSettingsBoundary, e as PlatformSettingsBoundaryProps, f as PlatformSettingsOwnerApi, a as PlatformSettingsRuntime, g as PlatformSettingsRuntimeProps, S as ShellMatchPhase, k as StandardMatchPhase, i as isActiveMatchPhase, h as isEndedMatchPhase, j as isStandardMatchPhase, s as standardMatchPhases, t as toShellMatchPhase, u as useInheritedPlatformSettings, b as usePlatformAudioSettings, c as usePlatformSettings } from './standard-match-phase-CvJUW8Oe.cjs';
5
+ import { a as AirJamHostOptions, A as AirJamControllerOptions } from './use-air-jam-host-DM-ybB3C.cjs';
6
+ export { b as AirJamControllerApi, d as AirJamControllerState, c as AirJamHostApi, f as AirJamHostState, J as JoinUrlStatus, u as useAirJamController, e as useAirJamHost } from './use-air-jam-host-DM-ybB3C.cjs';
7
+ import { b as ConnectionStatus, t as ControllerInputPayload, P as PlayerProfile, R as RoomCode } from './controller-vj82tKm4.cjs';
8
+ export { d as ControllerOrientation, j as ControllerStatePayload, h as ControllerUpdatePlayerProfileAck, g as PlayerProfilePatch, e as RunMode, c as RuntimeState } from './controller-vj82tKm4.cjs';
9
+ import { T as ToastSignalPayload, H as HapticSignalPayload } from './signals-ZHftIKuc.cjs';
10
+ export { S as SignalPayload, b as SignalType } from './signals-ZHftIKuc.cjs';
7
11
  import { z } from 'zod';
8
- import { h as HostControllerActionAck, c as HostRegistrationAck, n as HostSessionKind } from './host-8hmq_Sgc.cjs';
9
- import { C as ControllerPresenceNotice } from './notices-NyDM5Mtz.cjs';
10
- import { h as HapticSignalPayload, T as ToastSignalPayload, i as AirJamActionActorRole, A as AirJamActionInvocationResult, k as AirJamActionPayload } from './sync-B6QsNrXz.cjs';
11
- export { m as AirJamActionAccepted, n as AirJamActionRejected, S as SignalPayload, g as SignalType } from './sync-B6QsNrXz.cjs';
12
- import { RuntimeTopologyInput, ResolvedAirJamRuntimeTopology, SurfaceRole } from './runtime-topology.cjs';
13
- import { A as AirJamAgentContract } from './agent-tooling-BSMGBix9.cjs';
14
- export { j as AirJamAgentActionContract, b as AirJamAgentActionCustomOptions, c as AirJamAgentActionOptions, d as AirJamAgentActionPayloadKind, e as AirJamAgentActionPayloadMetadata, k as AirJamAgentActionTarget, l as AirJamAgentContractActionOptions, m as AirJamAgentContractPayloadKind, n as AirJamAgentContractPayloadMetadata, o as AirJamAgentJsonObject, p as AirJamAgentResolvedActionContract, q as AirJamAgentSnapshotContext, r as AirJamAgentStoreDeclaration, s as AirJamAgentStoreDeclarations, t as AirJamAgentStores, u as AnyAirJamAgentContract, I as InferAirJamAgentActionInputPayload, v as InferAirJamAgentStores, f as agentAction, a as agentActionInput, g as agentStore, h as defineAirJamAgentContract, i as defineAirJamAgentStores } from './agent-tooling-BSMGBix9.cjs';
15
- import { AirJamGameCapabilityManifest } from './capabilities.cjs';
12
+ import { e as AirJamActionActorRole, A as AirJamActionInvocationResult, g as AirJamActionPayload } from './sync-xtPfWhif.cjs';
13
+ export { i as AirJamActionAccepted, j as AirJamActionRejected } from './sync-xtPfWhif.cjs';
14
+ import { R as RuntimeErrorReport } from './runtime-reporting-pe-eryVz.cjs';
15
+ import { o as AirJamAgentContract } from './agent-contract-CD2QnbBJ.cjs';
16
+ export { n as AirJamAgentActionContract, k as AirJamAgentActionCustomOptions, g as AirJamAgentActionOptions, i as AirJamAgentActionPayloadKind, j as AirJamAgentActionPayloadMetadata, v as AirJamAgentActionTarget, w as AirJamAgentContractActionOptions, x as AirJamAgentContractPayloadKind, y as AirJamAgentContractPayloadMetadata, z as AirJamAgentJsonObject, B as AirJamAgentResolvedActionContract, C as AirJamAgentSnapshotContext, D as AirJamAgentStoreDeclaration, E as AirJamAgentStoreDeclarations, F as AirJamAgentStores, A as AnyAirJamAgentContract, I as InferAirJamAgentActionInputPayload, G as InferAirJamAgentStores, q as agentAction, p as agentActionInput, s as agentStore, t as defineAirJamAgentContract, u as defineAirJamAgentStores } from './agent-contract-CD2QnbBJ.cjs';
17
+ import { A as AirJamProviderProps } from './air-jam-context-BlLPvCup.cjs';
16
18
  import { AirJamGameMetadata } from './metadata.cjs';
19
+ import { H as HostSessionKind } from './host-B9pRy0Aa.cjs';
20
+ import { RuntimeTopologyInput, ResolvedAirJamRuntimeTopology, SurfaceRole } from './runtime-topology.cjs';
17
21
  import { StateCreator } from 'zustand';
18
22
  import { StoreApi } from 'zustand/vanilla';
23
+ import './realtime-client-Cu8yVJFw.cjs';
24
+ import './notices-DNdOjwtj.cjs';
19
25
 
20
26
  type SoundCategory = "music" | "sfx";
21
27
  interface SoundConfig {
@@ -87,401 +93,6 @@ type AirJamDiagnosticListener = (diagnostic: AirJamDiagnostic) => void;
87
93
  declare const onAirJamDiagnostic: (listener: AirJamDiagnosticListener) => (() => void);
88
94
  declare const setAirJamDiagnosticsEnabled: (enabled: boolean) => void;
89
95
 
90
- /**
91
- * Options for configuring the controller runtime boundary.
92
- *
93
- * @example Basic runtime boundary usage (room from URL)
94
- * ```tsx
95
- * // URL: https://yourgame.com/controller?room=ABCD
96
- * <AirJamControllerRuntime>
97
- * <ControllerView />
98
- * </AirJamControllerRuntime>
99
- * ```
100
- *
101
- * @example With nickname
102
- * ```tsx
103
- * <AirJamControllerRuntime
104
- * nickname={playerName}
105
- * onState={(state) => {
106
- * if (state.runtimeState === "playing") startGame();
107
- * }}
108
- * >
109
- * <ControllerView />
110
- * </AirJamControllerRuntime>
111
- * ```
112
- */
113
- interface AirJamControllerOptions {
114
- /**
115
- * Room ID (4-character code) to join.
116
- * Can also be provided via URL query parameter: `?room=XXXX`
117
- * The URL parameter takes precedence if both are provided.
118
- */
119
- roomId?: string;
120
- /**
121
- * Player nickname to display in the game.
122
- * If not provided, the server assigns a random label.
123
- */
124
- nickname?: string;
125
- /**
126
- * Preset avatar id sent on join (optional).
127
- */
128
- avatarId?: string;
129
- /**
130
- * Controller ID for this instance.
131
- * Auto-generated if not provided. Persists across reconnects.
132
- */
133
- controllerId?: string;
134
- /**
135
- * Optional privileged controller capability token.
136
- * Undefined falls back to `aj_controller_cap` from the URL; null explicitly disables URL token use.
137
- */
138
- capabilityToken?: string | null;
139
- /**
140
- * Called when the host sends a state update (game state, messages, etc.)
141
- */
142
- onState?: (state: ControllerStatePayload) => void;
143
- }
144
- /**
145
- * Return type of useAirJamController hook.
146
- *
147
- * Provides state and functions for a mobile/web controller interface.
148
- */
149
- interface AirJamControllerApi {
150
- /** Room code this controller is connected to (or attempting to join) */
151
- roomId: RoomCode | null;
152
- /** This controller's unique ID */
153
- controllerId: string | null;
154
- /** Current connection status */
155
- connectionStatus: ConnectionStatus;
156
- /** Last error message, if any */
157
- lastError?: string;
158
- /** Current game state (paused or playing) */
159
- runtimeState: RuntimeState;
160
- /** Intended controller presentation orientation for the active game UI. */
161
- controllerOrientation: ControllerOrientation;
162
- /** Optional message from the host (e.g., "Get Ready!") */
163
- stateMessage?: string;
164
- /** Current host-owned room settings mirrored onto the controller. */
165
- roomSettings: ControllerRoomSettingsState;
166
- /**
167
- * Send a system command to the host.
168
- *
169
- * @example Pause or resume
170
- * ```ts
171
- * controller.sendSystemCommand("pause");
172
- * controller.sendSystemCommand("resume");
173
- * ```
174
- */
175
- sendSystemCommand: (command: "exit" | "pause" | "resume") => void;
176
- /**
177
- * Update the player nickname (local draft for next join).
178
- */
179
- setNickname: (value: string) => void;
180
- /**
181
- * Update preset avatar id (local draft for next join).
182
- */
183
- setAvatarId: (value: string) => void;
184
- /**
185
- * Patch display name and/or avatar on the server without reconnecting.
186
- * In Arcade (embedded iframe), updates are forwarded through the controller bridge; the room
187
- * still learns the new name via `server:playerUpdated` (ack payload is not round-tripped).
188
- */
189
- updatePlayerProfile: (patch: PlayerProfilePatch) => Promise<ControllerUpdatePlayerProfileAck>;
190
- /** Explicitly leave the current room and release the controller binding. */
191
- leave: () => Promise<ControllerLeaveAck>;
192
- /** Force reconnection to the room */
193
- reconnect: () => void;
194
- /** List of all connected players in the room */
195
- players: PlayerProfile[];
196
- /** This controller's current player profile when known. */
197
- selfPlayer: PlayerProfile | null;
198
- /** Realtime client for controller events (socket-backed standalone, bridge-backed in arcade embeds) */
199
- socket: AirJamRealtimeClient | null;
200
- }
201
- interface AirJamControllerState {
202
- roomId: RoomCode | null;
203
- controllerId: string | null;
204
- connectionStatus: ConnectionStatus;
205
- lastError?: string;
206
- runtimeState: RuntimeState;
207
- controllerOrientation: ControllerOrientation;
208
- stateMessage?: string;
209
- roomSettings: ControllerRoomSettingsState;
210
- players: PlayerProfile[];
211
- selfPlayer: PlayerProfile | null;
212
- }
213
- /**
214
- * Read the mounted controller runtime API.
215
- *
216
- * Use this inside `AirJamControllerRuntime` or another explicit controller runtime
217
- * boundary such as `airjam.Controller`. Runtime ownership is mounted once at the
218
- * boundary; child code reads from that runtime through this hook.
219
- *
220
- * **Typical usage flow:**
221
- * 1. Player scans QR code on game screen
222
- * 2. Opens controller URL with ?room=XXXX parameter
223
- * 3. Controller auto-connects to the game session
224
- * 4. Player uses joystick/buttons to send input
225
- * 5. Receives haptic feedback on game events
226
- *
227
- * @returns Controller API with state and functions
228
- *
229
- * @example Basic controller setup
230
- * ```tsx
231
- * const ControllerView = () => {
232
- * const controller = useAirJamController();
233
- *
234
- * if (controller.connectionStatus !== "connected") {
235
- * return <div>Connecting to room {controller.roomId}...</div>;
236
- * }
237
- *
238
- * return (
239
- * <div>
240
- * <p>Connected: {controller.controllerId}</p>
241
- * <p>Game: {controller.runtimeState}</p>
242
- * </div>
243
- * );
244
- * };
245
- * ```
246
- *
247
- * @example With state callback
248
- * ```tsx
249
- * <AirJamControllerRuntime
250
- * onState={(state) => {
251
- * if (state.message) {
252
- * showNotification(state.message);
253
- * }
254
- * }}
255
- * >
256
- * <ControllerView />
257
- * </AirJamControllerRuntime>
258
- * ```
259
- */
260
- declare function useAirJamController(): AirJamControllerApi;
261
- declare function useAirJamController<TSelected>(selector: (state: AirJamControllerState) => TSelected): TSelected;
262
-
263
- type JoinUrlStatus = "loading" | "ready" | "unavailable";
264
- /**
265
- * Options for configuring the host runtime boundary.
266
- *
267
- * @example Runtime boundary usage with callbacks
268
- * ```tsx
269
- * <AirJamHostRuntime
270
- * onPlayerJoin={(player) => {
271
- * console.log(`${player.label} joined!`);
272
- * spawnPlayerShip(player.id);
273
- * }}
274
- * onPlayerLeave={(controllerId) => {
275
- * console.log(`Player ${controllerId} left`);
276
- * removePlayerShip(controllerId);
277
- * }}
278
- * >
279
- * <HostView />
280
- * </AirJamHostRuntime>
281
- * ```
282
- *
283
- * @example With custom room ID
284
- * ```tsx
285
- * <AirJamHostRuntime roomId="GAME1">
286
- * <HostView />
287
- * </AirJamHostRuntime>
288
- * ```
289
- */
290
- interface AirJamHostOptions {
291
- /**
292
- * Room ID (4-character code) to use for this session.
293
- * If not provided, a random room code will be generated.
294
- * Can also be set via URL query parameter: `?room=XXXX`
295
- */
296
- roomId?: string;
297
- /**
298
- * Called when a player successfully joins the room.
299
- * Use this to spawn player entities, update UI, etc.
300
- */
301
- onPlayerJoin?: (player: PlayerProfile) => void;
302
- /**
303
- * Called when a player leaves the room (disconnects or exits).
304
- * Use this to remove player entities, handle cleanup.
305
- */
306
- onPlayerLeave?: (controllerId: string) => void;
307
- }
308
- /**
309
- * Return type of useAirJamHost hook.
310
- *
311
- * Provides all the state and functions needed to run a multiplayer game session.
312
- *
313
- * @template TSchema - Zod schema type for input (inferred from provider)
314
- */
315
- interface AirJamHostApi<TSchema extends z.ZodSchema = z.ZodSchema> {
316
- /** The room code for this session (e.g., "ABCD") */
317
- roomId: RoomCode;
318
- /** Full URL for controllers to join (display as QR code) */
319
- joinUrl: string;
320
- /** Whether the join URL is still being resolved, ready to render, or unavailable */
321
- joinUrlStatus: JoinUrlStatus;
322
- /** Current connection status to the server */
323
- connectionStatus: ConnectionStatus;
324
- /** List of currently connected players */
325
- players: PlayerProfile[];
326
- /** Full controller-session roster for the current room, including source and lease state. */
327
- controllers: ControllerPresenceNotice[];
328
- /** Last error message, if any */
329
- lastError?: string;
330
- /** Current run mode (standalone, arcade, platform) */
331
- mode: RunMode;
332
- /** Current runtime pause/play state */
333
- runtimeState: RuntimeState;
334
- /** Pause the runtime for every connected surface. */
335
- pauseRuntime: () => void;
336
- /** Resume the runtime for every connected surface. */
337
- resumeRuntime: () => void;
338
- /** Set the runtime pause/play state explicitly. */
339
- setRuntimeState: (state: RuntimeState) => void;
340
- /**
341
- * Send state update to all connected controllers.
342
- * Use for syncing game state, messages, etc.
343
- */
344
- sendState: (state: ControllerStatePayload) => boolean;
345
- /**
346
- * Send a signal (haptic feedback or toast) to controllers.
347
- *
348
- * @example Send haptic to specific player
349
- * ```ts
350
- * host.sendSignal("HAPTIC", { pattern: "heavy" }, playerId);
351
- * ```
352
- *
353
- * @example Send toast to all players
354
- * ```ts
355
- * host.sendSignal("TOAST", {
356
- * title: "Round Start!",
357
- * message: "Game begins in 3 seconds",
358
- * });
359
- * ```
360
- */
361
- sendSignal: {
362
- (type: "HAPTIC", payload: HapticSignalPayload, targetId?: string): void;
363
- (type: "TOAST", payload: ToastSignalPayload, targetId?: string): void;
364
- };
365
- /** Reconnect to the server */
366
- reconnect: () => void;
367
- /** Remove one controller from the room immediately. */
368
- removeController: (controllerId: string) => Promise<HostControllerActionAck>;
369
- /** Tear down the current room and create a fresh empty room for this host. */
370
- resetRoom: () => Promise<HostRegistrationAck>;
371
- /** Realtime client for host events (socket-backed standalone, bridge-backed in arcade embeds) */
372
- socket: AirJamRealtimeClient;
373
- /**
374
- * Get the latest input from a specific controller.
375
- *
376
- * Returns validated, typed input based on the schema provided to the session provider.
377
- * Input behavior defaults are tap-safe booleans (`pulse`) and latest vectors (`latest`),
378
- * with optional per-field overrides.
379
- *
380
- * @example In a game loop
381
- * ```ts
382
- * useFrame(() => {
383
- * players.forEach((player) => {
384
- * const input = host.getInput(player.id);
385
- * if (input?.action) {
386
- * fireWeapon(player.id);
387
- * }
388
- * movePlayer(player.id, input?.vector ?? { x: 0, y: 0 });
389
- * });
390
- * });
391
- * ```
392
- */
393
- getInput: (controllerId: string) => z.infer<TSchema> | undefined;
394
- }
395
- interface AirJamHostState {
396
- roomId: RoomCode | null;
397
- connectionStatus: ConnectionStatus;
398
- players: PlayerProfile[];
399
- controllers: ControllerPresenceNotice[];
400
- lastError?: string;
401
- mode: RunMode;
402
- runtimeState: RuntimeState;
403
- }
404
- /**
405
- * Read the mounted host runtime API.
406
- *
407
- * Use this inside `AirJamHostRuntime` or another explicit host runtime boundary
408
- * such as `airjam.Host`. Runtime ownership is mounted once at the boundary; child
409
- * code reads from that runtime through this hook.
410
- *
411
- * This hook is runtime-aware:
412
- * - standalone: creates/reconnects host rooms directly
413
- * - arcade iframe runtime: auto-detects `aj_room` + `aj_cap` and bridges through the platform-owned host session
414
- *
415
- * This hook no longer creates host runtime side effects.
416
- *
417
- * **Features:**
418
- * - Automatic room creation and management
419
- * - Real-time player join/leave events
420
- * - Typed input with validation and behavior defaults
421
- * - Haptic feedback and toast notifications
422
- * - Runtime state synchronization
423
- *
424
- * @template TSchema - Zod schema for input validation (from provider)
425
- * @returns API object with state and functions
426
- *
427
- * @example Basic usage
428
- * ```tsx
429
- * const HostView = () => {
430
- * const host = useAirJamHost();
431
- *
432
- * return (
433
- * <div>
434
- * <h1>Room: {host.roomId}</h1>
435
- * <QRCode value={host.joinUrl} />
436
- * <p>Players: {host.players.length}</p>
437
- * <button
438
- * onClick={
439
- * host.runtimeState === "playing"
440
- * ? host.pauseRuntime
441
- * : host.resumeRuntime
442
- * }
443
- * >
444
- * {host.runtimeState === "playing" ? "Pause" : "Resume"}
445
- * </button>
446
- * </div>
447
- * );
448
- * };
449
- * ```
450
- *
451
- * @example Reading input in a game loop
452
- * ```tsx
453
- * const GameScene = () => {
454
- * const host = useAirJamHost();
455
- *
456
- * useFrame(() => {
457
- * host.players.forEach((player) => {
458
- * const input = host.getInput(player.id);
459
- * if (!input) return;
460
- *
461
- * // Move player based on joystick
462
- * movePlayer(player.id, input.vector);
463
- *
464
- * // Handle button press (tap-safe pulse default)
465
- * if (input.action) {
466
- * playerShoot(player.id);
467
- * }
468
- * });
469
- * });
470
- *
471
- * return <GameCanvas />;
472
- * };
473
- * ```
474
- *
475
- * @example Sending haptic feedback
476
- * ```tsx
477
- * const handleHit = (playerId: string) => {
478
- * host.sendSignal("HAPTIC", { pattern: "heavy" }, playerId);
479
- * };
480
- * ```
481
- */
482
- declare function useAirJamHost<TSchema extends z.ZodSchema = z.ZodSchema>(): AirJamHostApi<TSchema>;
483
- declare function useAirJamHost<TSelected>(selector: (state: AirJamHostState) => TSelected): TSelected;
484
-
485
96
  declare const useConnectionStatus: () => ConnectionStatus;
486
97
 
487
98
  interface ControllerTickInfo {
@@ -524,7 +135,7 @@ declare const useControllerToasts: (options?: UseControllerToastsOptions) => {
524
135
  * to host session state, so it won't cause re-renders when connection state changes.
525
136
  *
526
137
  * **Requirements:**
527
- * - Must be used within `AirJamHostRuntime`, `airjam.Host`, or the underlying scoped host runtime
138
+ * - Must be used within `airjam.Host` or the underlying scoped host runtime
528
139
  * - Input configuration must be provided to the provider
529
140
  *
530
141
  * @template TSchema - Zod schema type for input (from provider)
@@ -574,6 +185,13 @@ declare const useControllerToasts: (options?: UseControllerToastsOptions) => {
574
185
  */
575
186
  declare const useGetInput: <TSchema extends z.ZodSchema = z.ZodSchema>() => ((controllerId: string) => z.infer<TSchema> | undefined);
576
187
 
188
+ interface HostAudioMutePreference {
189
+ muted: boolean;
190
+ setMuted: (muted: boolean) => void;
191
+ toggleMuted: () => void;
192
+ }
193
+ declare const useHostAudioMutePreference: (scope: string, defaultMuted?: boolean) => HostAudioMutePreference;
194
+
577
195
  interface HostTickInfo {
578
196
  now: number;
579
197
  deltaMs: number;
@@ -728,231 +346,6 @@ interface SendSignalFn {
728
346
  */
729
347
  declare const useSendSignal: () => SendSignalFn;
730
348
 
731
- type HostInspectionApi = Pick<AirJamHostApi, "roomId" | "joinUrl" | "joinUrlStatus" | "connectionStatus" | "players" | "controllers" | "lastError" | "mode" | "runtimeState">;
732
- type ControllerInspectionApi = Pick<AirJamControllerApi, "roomId" | "controllerId" | "connectionStatus" | "lastError" | "runtimeState" | "controllerOrientation" | "roomSettings" | "stateMessage" | "players" | "selfPlayer">;
733
- interface HostRuntimeInspectionContract {
734
- role: "host";
735
- roomId: RoomCode;
736
- joinUrl: string;
737
- joinUrlStatus: JoinUrlStatus;
738
- connectionStatus: ConnectionStatus;
739
- players: readonly PlayerProfile[];
740
- controllers: readonly ControllerPresenceNotice[];
741
- lastError?: string;
742
- mode: RunMode;
743
- runtimeState: RuntimeState;
744
- }
745
- interface ControllerRuntimeInspectionContract {
746
- role: "controller";
747
- roomId: RoomCode | null;
748
- controllerId: string | null;
749
- connectionStatus: ConnectionStatus;
750
- players: readonly PlayerProfile[];
751
- selfPlayer: PlayerProfile | null;
752
- lastError?: string;
753
- runtimeState: RuntimeState;
754
- controllerOrientation: ControllerOrientation;
755
- stateMessage?: string;
756
- roomSettings: ControllerInspectionApi["roomSettings"];
757
- }
758
- type RuntimeInspectionContract = HostRuntimeInspectionContract | ControllerRuntimeInspectionContract;
759
- declare const AIR_JAM_RUNTIME_INSPECTION_KEY = "__airJamRuntimeInspection";
760
- declare const createHostRuntimeInspectionContract: (api: HostInspectionApi) => HostRuntimeInspectionContract;
761
- declare const createControllerRuntimeInspectionContract: (api: ControllerInspectionApi) => ControllerRuntimeInspectionContract;
762
- declare const readRuntimeInspectionContract: (target: object) => RuntimeInspectionContract | null;
763
- declare const publishRuntimeInspectionContract: (target: object, contract: RuntimeInspectionContract | null) => void;
764
-
765
- declare const useHostRuntimeInspectionContract: () => HostRuntimeInspectionContract;
766
- declare const useControllerRuntimeInspectionContract: () => ControllerRuntimeInspectionContract;
767
-
768
- /**
769
- * @module InputManager
770
- * @description Internal input runtime used by host hooks.
771
- *
772
- * Public API terms:
773
- * - `pulse`: consume-on-read, tap-safe behavior (default for booleans)
774
- * - `hold`: keep last active vector until a new active value arrives
775
- * - `latest`: read current value as-is (default for vectors and other fields)
776
- *
777
- * @internal This class is not exported publicly. Use hooks to access input.
778
- */
779
-
780
- /**
781
- * Configuration for input handling with optional validation and per-field behavior.
782
- *
783
- * Provided to `HostSessionProvider` to enable typed and behavior-aware input reads.
784
- *
785
- * @template TSchema - Zod schema type for input validation
786
- *
787
- * @example Basic schema validation
788
- * ```ts
789
- * const config: InputConfig = {
790
- * schema: z.object({
791
- * vector: z.object({ x: z.number(), y: z.number() }),
792
- * action: z.boolean(),
793
- * }),
794
- * };
795
- * ```
796
- *
797
- * @example With custom behavior overrides
798
- * ```ts
799
- * const config: InputConfig = {
800
- * schema: gameInputSchema,
801
- * behavior: {
802
- * pulse: ["action", "ability"], // consume-on-read
803
- * latest: ["aim"], // read latest value
804
- * hold: ["menuVector"], // keep last non-zero vector
805
- * },
806
- * };
807
- * ```
808
- */
809
- interface InputConfig<TSchema extends z.ZodSchema = z.ZodSchema> {
810
- /**
811
- * Zod schema for input validation and type inference.
812
- *
813
- * When provided:
814
- * - Incoming input is validated against the schema
815
- * - Invalid input returns `undefined` (with console warning)
816
- * - Return type is inferred from the schema
817
- *
818
- * @example
819
- * ```ts
820
- * schema: z.object({
821
- * vector: z.object({ x: z.number(), y: z.number() }),
822
- * action: z.boolean(),
823
- * ability: z.boolean(),
824
- * timestamp: z.number(),
825
- * })
826
- * ```
827
- */
828
- schema?: TSchema;
829
- behavior?: {
830
- /**
831
- * Consume-on-read behavior. Useful for tap-safe buttons and one-shot vectors.
832
- *
833
- * Defaults: booleans use `pulse` even without explicit config.
834
- */
835
- pulse?: string[];
836
- /**
837
- * Sticky behavior. For vectors, keeps the last non-zero direction until
838
- * another non-zero direction arrives.
839
- */
840
- hold?: string[];
841
- /**
842
- * Stateless behavior. Returns the latest raw value.
843
- *
844
- * Defaults: vectors and non-boolean fields use `latest`.
845
- */
846
- latest?: string[];
847
- };
848
- }
849
-
850
- interface ResolveAirJamConfigInput {
851
- topology?: RuntimeTopologyInput | ResolvedAirJamRuntimeTopology;
852
- surfaceRole?: SurfaceRole;
853
- appId?: string;
854
- hostGrantEndpoint?: string;
855
- maxPlayers?: number;
856
- hostSessionKind?: HostSessionKind;
857
- resolveEnv?: boolean;
858
- }
859
-
860
- /**
861
- * Props for the AirJamProvider component.
862
- *
863
- * @template TSchema - Zod schema type for input validation (inferred from input.schema)
864
- *
865
- * @example Minimal configuration (uses environment variables)
866
- * ```tsx
867
- * <HostSessionProvider>
868
- * <App />
869
- * </HostSessionProvider>
870
- * ```
871
- *
872
- * @example Full configuration
873
- * ```tsx
874
- * <HostSessionProvider
875
- * topology={myTopology}
876
- * appId="your-app-id"
877
- * hostGrantEndpoint="/api/airjam/host-grant"
878
- * maxPlayers={4}
879
- * input={{
880
- * schema: myInputSchema,
881
- * behavior: { pulse: ["fire"], latest: ["move"] },
882
- * }}
883
- * >
884
- * <App />
885
- * </HostSessionProvider>
886
- * ```
887
- */
888
- interface AirJamProviderProps<TSchema extends z.ZodSchema = z.ZodSchema> {
889
- /** React children to render within the provider */
890
- children: ReactNode;
891
- /** Explicit runtime topology for this surface. Prefer this over loose endpoint props. */
892
- topology?: RuntimeTopologyInput | ResolvedAirJamRuntimeTopology;
893
- /** Internal surface-role hint when normalizing legacy endpoint props into topology. */
894
- surfaceRole?: SurfaceRole;
895
- /**
896
- * App ID for production bootstrap identity.
897
- * Falls back to VITE_AIR_JAM_APP_ID or NEXT_PUBLIC_AIR_JAM_APP_ID
898
- * when not provided directly.
899
- */
900
- appId?: string;
901
- /**
902
- * Optional endpoint that returns a short-lived signed host grant for stronger production bootstrap.
903
- * When provided, the host runtime fetches a grant automatically before `host:bootstrap`.
904
- */
905
- hostGrantEndpoint?: string;
906
- /**
907
- * Maximum number of players allowed in a room.
908
- * @default 8
909
- */
910
- maxPlayers?: number;
911
- /**
912
- * Declares whether this host provider owns a standalone game room or a system shell room.
913
- * Standalone games should use `"game"`; Arcade shell hosts should use `"system"`.
914
- * @default "game"
915
- */
916
- hostSessionKind?: HostSessionKind;
917
- /**
918
- * Enable environment-variable fallback resolution for config fields.
919
- * Set to false to require explicit `topology` / `appId` / `hostGrantEndpoint`.
920
- * @default true
921
- */
922
- resolveEnv?: boolean;
923
- /**
924
- * Input handling configuration including Zod schema validation and field behavior.
925
- * When provided, enables typed input with tap-safe defaults:
926
- * - booleans => `pulse`
927
- * - vectors => `latest`
928
- *
929
- * @example
930
- * ```ts
931
- * input={{
932
- * schema: z.object({
933
- * vector: z.object({ x: z.number(), y: z.number() }),
934
- * action: z.boolean(),
935
- * ability: z.boolean(),
936
- * }),
937
- * behavior: {
938
- * pulse: ["action", "ability"], // consume-on-read actions
939
- * latest: ["vector"], // continuous movement
940
- * },
941
- * }}
942
- * ```
943
- */
944
- input?: InputConfig<TSchema>;
945
- }
946
-
947
- type AirJamHostRuntimeProps<TSchema extends z.ZodSchema = z.ZodSchema> = AirJamProviderProps<TSchema> & AirJamHostOptions & {
948
- children: ReactNode;
949
- };
950
- type AirJamControllerRuntimeProps = AirJamProviderProps & AirJamControllerOptions & {
951
- children: ReactNode;
952
- };
953
- declare const AirJamHostRuntime: <TSchema extends z.ZodSchema = z.ZodSchema>({ children, roomId, onPlayerJoin, onPlayerLeave, ...providerProps }: AirJamHostRuntimeProps<TSchema>) => JSX.Element;
954
- declare const AirJamControllerRuntime: ({ children, roomId, nickname, avatarId, controllerId, capabilityToken, onState, ...providerProps }: AirJamControllerRuntimeProps) => JSX.Element;
955
-
956
349
  type AirJamRuntimeRole = "host" | "controller";
957
350
  interface AirJamRuntimeErrorContext {
958
351
  role: AirJamRuntimeRole;
@@ -969,6 +362,7 @@ type AirJamErrorFallbackRenderer = (props: AirJamErrorFallbackRenderProps) => JS
969
362
  interface AirJamErrorBoundaryProps extends AirJamRuntimeErrorContext {
970
363
  children: ReactNode;
971
364
  renderFallback?: AirJamErrorFallbackRenderer;
365
+ reportError?: (report: RuntimeErrorReport) => void;
972
366
  onError?: (error: Error, errorInfo: ErrorInfo, context: AirJamRuntimeErrorContext) => void;
973
367
  }
974
368
  interface AirJamErrorBoundaryState {
@@ -983,6 +377,16 @@ declare class AirJamErrorBoundary extends Component<AirJamErrorBoundaryProps, Ai
983
377
  render(): JSX.Element;
984
378
  }
985
379
 
380
+ interface ResolveAirJamConfigInput {
381
+ topology?: RuntimeTopologyInput | ResolvedAirJamRuntimeTopology;
382
+ surfaceRole?: SurfaceRole;
383
+ appId?: string;
384
+ hostGrantEndpoint?: string;
385
+ maxPlayers?: number;
386
+ hostSessionKind?: HostSessionKind;
387
+ resolveEnv?: boolean;
388
+ }
389
+
986
390
  type HostSessionProps<TSchema extends z.ZodSchema> = Omit<AirJamProviderProps<TSchema>, "children">;
987
391
  type ControllerSessionProps = Omit<AirJamProviderProps, "children" | "input">;
988
392
  interface AirJamRuntimeErrorBoundaryOptions {
@@ -1001,11 +405,6 @@ interface CreateAirJamAppOptions<TSchema extends z.ZodSchema = z.ZodSchema> {
1001
405
  * Defaults to "/controller".
1002
406
  */
1003
407
  controllerPath?: string;
1004
- /**
1005
- * Experimental capability metadata for future agent-facing control,
1006
- * inspection, and evaluation workflows.
1007
- */
1008
- capabilities?: AirJamGameCapabilityManifest;
1009
408
  /**
1010
409
  * Optional semantic agent contract published by the app.
1011
410
  */
@@ -1030,7 +429,6 @@ interface AirJamApp<TSchema extends z.ZodSchema = z.ZodSchema> {
1030
429
  runtime: ResolveAirJamConfigInput;
1031
430
  metadata?: AirJamGameMetadata;
1032
431
  controllerPath: string;
1033
- capabilities?: AirJamGameCapabilityManifest;
1034
432
  agent?: AirJamAgentContract;
1035
433
  }
1036
434
  type ViteEnvSource = Record<string, unknown> | undefined;
@@ -1040,7 +438,7 @@ declare const env: {
1040
438
  readonly next: () => ResolveAirJamConfigInput;
1041
439
  readonly explicit: (runtime: Omit<ResolveAirJamConfigInput, "resolveEnv">) => ResolveAirJamConfigInput;
1042
440
  };
1043
- declare const createAirJamApp: <TSchema extends z.ZodSchema = z.ZodSchema>({ runtime, metadata, controllerPath: requestedControllerPath, capabilities, agent, input, errorBoundary, }?: CreateAirJamAppOptions<TSchema>) => AirJamApp<TSchema>;
441
+ declare const createAirJamApp: <TSchema extends z.ZodSchema = z.ZodSchema>({ runtime, metadata, controllerPath: requestedControllerPath, agent, input, errorBoundary, }?: CreateAirJamAppOptions<TSchema>) => AirJamApp<TSchema>;
1044
442
 
1045
443
  declare const resolveAirJamBrowserRouterBasename: () => string;
1046
444
 
@@ -1153,4 +551,4 @@ interface ElementWithFullscreen extends HTMLElement {
1153
551
  msRequestFullscreen?: () => Promise<void>;
1154
552
  }
1155
553
 
1156
- export { AIR_JAM_RUNTIME_INSPECTION_KEY, type AirJamActionAcceptance, type AirJamActionContext, AirJamActionInvocationResult, type AirJamActionRejection, AirJamAgentContract, type AirJamApp, type AirJamAppErrorBoundaryOptions, type AirJamControllerApi, type AirJamControllerOptions, AirJamControllerRuntime, type AirJamControllerRuntimeProps, type AirJamControllerState, type AirJamDiagnostic, type AirJamDiagnosticCode, type AirJamDiagnosticSeverity, AirJamErrorBoundary, type AirJamErrorBoundaryProps, type AirJamErrorFallbackRenderProps, type AirJamErrorFallbackRenderer, type AirJamHostActionEvent, type AirJamHostActionListener, type AirJamHostActionSubscriptionOptions, type AirJamHostApi, type AirJamHostOptions, AirJamHostRuntime, type AirJamHostRuntimeProps, type AirJamHostState, type AirJamRuntimeErrorBoundaryOptions, type AirJamRuntimeRole, type AirJamSyncedStoreHook, type AudioHandle, AudioRuntime, type AudioRuntimeControls, type AudioRuntimeProps, type AudioRuntimeStatus, type AudioVolumeCategory, ConnectionStatus, ControllerOrientation, type ControllerRuntimeInspectionContract, ControllerStatePayload, type ControllerTickInfo, type ControllerTickOptions, type ControllerToast, ControllerUpdatePlayerProfileAck, type CreateAirJamAppOptions, type CreateAirJamStoreOptions, type DocumentWithFullscreen, type ElementWithFullscreen, HapticSignalPayload, type HostFrameInfo, type HostRuntimeInspectionContract, type HostTickInfo, type HostTickOptions, type JoinUrlStatus, MusicPlaylist, type MusicPlaylistProps, type PlayOptions, PlayerProfile, PlayerProfilePatch, RoomCode, type RoomState, RunMode, type RuntimeInspectionContract, RuntimeState, type SendSignalFn, type SoundCategory, type SoundConfig, type SoundManifest, ToastSignalPayload, type UseControllerToastsOptions, acceptAirJamAction, createAirJamApp, createAirJamStore, createControllerRuntimeInspectionContract, createHostRuntimeInspectionContract, env, onAirJamDiagnostic, publishRuntimeInspectionContract, readRuntimeInspectionContract, rejectAirJamAction, resolveAirJamBrowserRouterBasename, setAirJamDiagnosticsEnabled, useAirJamController, useAirJamHost, useAudio, useAudioCategoryVolume, useAudioRuntimeControls, useAudioRuntimeStatus, useConnectionStatus, useControllerRuntimeInspectionContract, useControllerTick, useControllerToasts, useGetInput, useHostRuntimeInspectionContract, useHostTick, useInputWriter, useMusicVolume, usePlayers, useRoom, useSendSignal };
554
+ export { type AirJamActionAcceptance, type AirJamActionContext, AirJamActionInvocationResult, type AirJamActionRejection, AirJamAgentContract, type AirJamApp, type AirJamAppErrorBoundaryOptions, AirJamControllerOptions, type AirJamDiagnostic, type AirJamDiagnosticCode, type AirJamDiagnosticSeverity, AirJamErrorBoundary, type AirJamErrorBoundaryProps, type AirJamErrorFallbackRenderProps, type AirJamErrorFallbackRenderer, type AirJamHostActionEvent, type AirJamHostActionListener, type AirJamHostActionSubscriptionOptions, AirJamHostOptions, type AirJamRuntimeErrorBoundaryOptions, type AirJamRuntimeRole, type AirJamSyncedStoreHook, type AudioHandle, AudioRuntime, type AudioRuntimeControls, type AudioRuntimeProps, type AudioRuntimeStatus, type AudioVolumeCategory, ConnectionStatus, type ControllerTickInfo, type ControllerTickOptions, type ControllerToast, type CreateAirJamAppOptions, type CreateAirJamStoreOptions, type DocumentWithFullscreen, type ElementWithFullscreen, HapticSignalPayload, type HostAudioMutePreference, type HostFrameInfo, type HostTickInfo, type HostTickOptions, MusicPlaylist, type MusicPlaylistProps, type PlayOptions, PlayerProfile, RoomCode, type RoomState, type SendSignalFn, type SoundCategory, type SoundConfig, type SoundManifest, ToastSignalPayload, type UseControllerToastsOptions, acceptAirJamAction, createAirJamApp, createAirJamStore, env, onAirJamDiagnostic, rejectAirJamAction, resolveAirJamBrowserRouterBasename, setAirJamDiagnosticsEnabled, useAudio, useAudioCategoryVolume, useAudioRuntimeControls, useAudioRuntimeStatus, useConnectionStatus, useControllerTick, useControllerToasts, useGetInput, useHostAudioMutePreference, useHostTick, useInputWriter, useMusicVolume, usePlayers, useRoom, useSendSignal };