@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.
- package/README.md +168 -205
- package/dist/actions-D4eh6Xaa.d.cts +72 -0
- package/dist/actions-D4eh6Xaa.d.ts +72 -0
- package/dist/{agent-contract-CD2QnbBJ.d.cts → agent-contract-DfLm4Mf-.d.ts} +3 -19
- package/dist/{agent-contract-CD2QnbBJ.d.ts → agent-contract-TINzp-5Y.d.cts} +3 -19
- package/dist/agent-tooling.cjs +135 -46
- package/dist/agent-tooling.cjs.map +1 -1
- package/dist/agent-tooling.d.cts +96 -5
- package/dist/agent-tooling.d.ts +96 -5
- package/dist/agent-tooling.js +15 -14
- package/dist/agent-tooling.js.map +1 -1
- package/dist/{use-air-jam-host-COLy8t4s.d.ts → air-jam-context-BCVCWiaT.d.ts} +121 -114
- package/dist/{use-air-jam-host-DM-ybB3C.d.cts → air-jam-context-DavligpM.d.cts} +121 -114
- package/dist/arcade/bridge/controller.cjs +873 -603
- package/dist/arcade/bridge/controller.cjs.map +1 -1
- package/dist/arcade/bridge/controller.d.cts +28 -76
- package/dist/arcade/bridge/controller.d.ts +28 -76
- package/dist/arcade/bridge/controller.js +27 -28
- package/dist/arcade/bridge/controller.js.map +1 -1
- package/dist/arcade/bridge/host.cjs +1017 -252
- package/dist/arcade/bridge/host.cjs.map +1 -1
- package/dist/arcade/bridge/host.d.cts +6 -72
- package/dist/arcade/bridge/host.d.ts +6 -72
- package/dist/arcade/bridge/host.js +19 -22
- package/dist/arcade/bridge/host.js.map +1 -1
- package/dist/arcade/bridge/iframe.cjs +3 -31
- package/dist/arcade/bridge/iframe.cjs.map +1 -1
- package/dist/arcade/bridge/iframe.d.cts +4 -46
- package/dist/arcade/bridge/iframe.d.ts +4 -46
- package/dist/arcade/bridge/iframe.js +6 -18
- package/dist/arcade/bridge/iframe.js.map +1 -1
- package/dist/arcade/host.cjs +0 -502
- package/dist/arcade/host.cjs.map +1 -1
- package/dist/arcade/host.d.cts +1 -19
- package/dist/arcade/host.d.ts +1 -19
- package/dist/arcade/host.js +0 -14
- package/dist/arcade/host.js.map +1 -1
- package/dist/arcade/runtime.cjs +10354 -4690
- package/dist/arcade/runtime.cjs.map +1 -1
- package/dist/arcade/runtime.d.cts +45 -13
- package/dist/arcade/runtime.d.ts +45 -13
- package/dist/arcade/runtime.js +37 -24
- package/dist/arcade/runtime.js.map +1 -1
- package/dist/arcade/surface.cjs +3 -35
- package/dist/arcade/surface.cjs.map +1 -1
- package/dist/arcade/surface.d.cts +14 -2
- package/dist/arcade/surface.d.ts +14 -2
- package/dist/arcade/surface.js +7 -13
- package/dist/arcade/surface.js.map +1 -1
- package/dist/arcade/url.cjs +45 -283
- package/dist/arcade/url.cjs.map +1 -1
- package/dist/arcade/url.d.cts +3 -56
- package/dist/arcade/url.d.ts +3 -56
- package/dist/arcade/url.js +33 -16
- package/dist/arcade/url.js.map +1 -1
- package/dist/chunk-24NZZOIO.js +700 -0
- package/dist/chunk-24NZZOIO.js.map +1 -0
- package/dist/chunk-27QLKLZL.js +469 -0
- package/dist/chunk-27QLKLZL.js.map +1 -0
- package/dist/{chunk-UWJOIVON.js → chunk-2H2FGF3H.js} +3 -6
- package/dist/chunk-2H2FGF3H.js.map +1 -0
- package/dist/chunk-2QZADUGA.js +188 -0
- package/dist/chunk-2QZADUGA.js.map +1 -0
- package/dist/chunk-3LDQCQL2.js +307 -0
- package/dist/chunk-3LDQCQL2.js.map +1 -0
- package/dist/chunk-3M7656SU.js +389 -0
- package/dist/chunk-3M7656SU.js.map +1 -0
- package/dist/{chunk-K4OZ54UD.js → chunk-5CRZFIN6.js} +2 -55
- package/dist/chunk-5CRZFIN6.js.map +1 -0
- package/dist/chunk-5TVVPBQI.js +7 -0
- package/dist/chunk-5TVVPBQI.js.map +1 -0
- package/dist/chunk-6Y3F6Y2K.js +343 -0
- package/dist/chunk-6Y3F6Y2K.js.map +1 -0
- package/dist/{chunk-EVZJA6RN.js → chunk-6ZJUA63D.js} +183 -2
- package/dist/chunk-6ZJUA63D.js.map +1 -0
- package/dist/chunk-A6EOGRRG.js +49 -0
- package/dist/chunk-A6EOGRRG.js.map +1 -0
- package/dist/chunk-BEM77SVQ.js +57 -0
- package/dist/chunk-BEM77SVQ.js.map +1 -0
- package/dist/chunk-C5722GTG.js +176 -0
- package/dist/chunk-C5722GTG.js.map +1 -0
- package/dist/{chunk-CV3PBXPT.js → chunk-C5GS2GMK.js} +99 -105
- package/dist/chunk-C5GS2GMK.js.map +1 -0
- package/dist/chunk-CDL7LYZH.js +19 -0
- package/dist/chunk-CDL7LYZH.js.map +1 -0
- package/dist/{chunk-PSUYTD2L.js → chunk-DA3TE4OP.js} +1 -1
- package/dist/chunk-DA3TE4OP.js.map +1 -0
- package/dist/chunk-DBF7NJ3S.js +72 -0
- package/dist/chunk-DBF7NJ3S.js.map +1 -0
- package/dist/chunk-DHFKL3DI.js +2477 -0
- package/dist/chunk-DHFKL3DI.js.map +1 -0
- package/dist/chunk-DRBPVG47.js +89 -0
- package/dist/chunk-DRBPVG47.js.map +1 -0
- package/dist/{chunk-MIMPMB7O.js → chunk-EG25EXSA.js} +24 -3
- package/dist/chunk-EG25EXSA.js.map +1 -0
- package/dist/chunk-FCG42U7D.js +131 -0
- package/dist/chunk-FCG42U7D.js.map +1 -0
- package/dist/chunk-FJ4J2BEC.js +26 -0
- package/dist/chunk-FJ4J2BEC.js.map +1 -0
- package/dist/chunk-H4DEVMTO.js +221 -0
- package/dist/chunk-H4DEVMTO.js.map +1 -0
- package/dist/{chunk-X35LLCWV.js → chunk-I6TSHJF7.js} +6 -8
- package/dist/chunk-I6TSHJF7.js.map +1 -0
- package/dist/{chunk-IG6GZZSS.js → chunk-JCGTL77W.js} +1 -1
- package/dist/chunk-JCGTL77W.js.map +1 -0
- package/dist/chunk-JJVCBUYM.js +98 -0
- package/dist/chunk-JJVCBUYM.js.map +1 -0
- package/dist/chunk-K6BJJJJM.js +138 -0
- package/dist/chunk-K6BJJJJM.js.map +1 -0
- package/dist/chunk-KSYN4I5Y.js +50 -0
- package/dist/chunk-KSYN4I5Y.js.map +1 -0
- package/dist/chunk-KUGROY5S.js +265 -0
- package/dist/chunk-KUGROY5S.js.map +1 -0
- package/dist/chunk-LX6CTPDW.js +16 -0
- package/dist/chunk-LX6CTPDW.js.map +1 -0
- package/dist/{chunk-BE6Z4SIT.js → chunk-M5553I2G.js} +2 -11
- package/dist/chunk-M5553I2G.js.map +1 -0
- package/dist/{chunk-X24K52DG.js → chunk-MD25536W.js} +1 -1
- package/dist/chunk-MD25536W.js.map +1 -0
- package/dist/{chunk-3USU7GY2.js → chunk-MJAWAHLT.js} +1 -1
- package/dist/chunk-MJAWAHLT.js.map +1 -0
- package/dist/chunk-OAXCFPZ7.js +14 -0
- package/dist/chunk-OAXCFPZ7.js.map +1 -0
- package/dist/{chunk-D4VDEVTZ.js → chunk-QHBRHYMV.js} +18 -17
- package/dist/chunk-QHBRHYMV.js.map +1 -0
- package/dist/chunk-QTNYGAZ7.js +45 -0
- package/dist/chunk-QTNYGAZ7.js.map +1 -0
- package/dist/chunk-S3TN7Y7L.js +921 -0
- package/dist/chunk-S3TN7Y7L.js.map +1 -0
- package/dist/chunk-SMKD4JY3.js +129 -0
- package/dist/chunk-SMKD4JY3.js.map +1 -0
- package/dist/{chunk-O6X7FJ6N.js → chunk-TFW4NJW2.js} +619 -643
- package/dist/chunk-TFW4NJW2.js.map +1 -0
- package/dist/chunk-UBBP2UY3.js +83 -0
- package/dist/chunk-UBBP2UY3.js.map +1 -0
- package/dist/chunk-URVBMQCK.js +802 -0
- package/dist/chunk-URVBMQCK.js.map +1 -0
- package/dist/chunk-VGX2274F.js +1995 -0
- package/dist/chunk-VGX2274F.js.map +1 -0
- package/dist/chunk-WAFGYJZN.js +1513 -0
- package/dist/chunk-WAFGYJZN.js.map +1 -0
- package/dist/chunk-WGHNGQUS.js +78 -0
- package/dist/chunk-WGHNGQUS.js.map +1 -0
- package/dist/chunk-XLY44PXZ.js +46 -0
- package/dist/chunk-XLY44PXZ.js.map +1 -0
- package/dist/connection-store-BYpQ50W2.d.ts +41 -0
- package/dist/connection-store-D6QqzXU1.d.cts +41 -0
- package/dist/control-Bv8dWjyp.d.ts +1400 -0
- package/dist/control-CNzybWMd.d.cts +1400 -0
- package/dist/controller-0CVO1t_3.d.cts +26 -0
- package/dist/controller-agent-vOiuK7T6.d.cts +130 -0
- package/dist/controller-agent-vOiuK7T6.d.ts +130 -0
- package/dist/controller-bridge.cjs +992 -0
- package/dist/controller-bridge.cjs.map +1 -0
- package/dist/controller-bridge.d.cts +52 -0
- package/dist/controller-bridge.d.ts +52 -0
- package/dist/controller-bridge.js +23 -0
- package/dist/controller-bridge.js.map +1 -0
- package/dist/controller-capture-2GKKGHJ2.js +8 -0
- package/dist/controller-capture-2GKKGHJ2.js.map +1 -0
- package/dist/controller-h9M2Nngd.d.ts +26 -0
- package/dist/controller-press-EWWIMVXP.js +231 -0
- package/dist/controller-press-EWWIMVXP.js.map +1 -0
- package/dist/core-BAO0pHrJ.d.cts +15 -0
- package/dist/core-BAO0pHrJ.d.ts +15 -0
- package/dist/core.cjs +5931 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +232 -0
- package/dist/core.d.ts +232 -0
- package/dist/core.js +906 -0
- package/dist/core.js.map +1 -0
- package/dist/dev-events-BffobOfb.d.ts +31 -0
- package/dist/dev-events-Ct7QEgKb.d.cts +31 -0
- package/dist/dev-log-events-B1_B3guZ.d.cts +47 -0
- package/dist/dev-log-events-B1_B3guZ.d.ts +47 -0
- package/dist/frames-D-xKuODS.d.cts +686 -0
- package/dist/frames-D-xKuODS.d.ts +686 -0
- package/dist/game-Db58JNk3.d.cts +77 -0
- package/dist/game-bySEy-QO.d.ts +77 -0
- package/dist/host-runtime-BuLhGQx5.d.ts +399 -0
- package/dist/host-runtime-_06jpW5v.d.cts +399 -0
- package/dist/index.cjs +11580 -7584
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -358
- package/dist/index.d.ts +100 -358
- package/dist/index.js +414 -1903
- package/dist/index.js.map +1 -1
- package/dist/input-Xvs80gqG.d.cts +92 -0
- package/dist/input-Xvs80gqG.d.ts +92 -0
- package/dist/input-bindings-BaEFrgRb.d.cts +129 -0
- package/dist/input-bindings-BgsJRLPm.d.ts +129 -0
- package/dist/leased-control-BEg4JuXA.d.cts +158 -0
- package/dist/leased-control-BEg4JuXA.d.ts +158 -0
- package/dist/metadata.cjs +3 -9
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.d.cts +6 -16
- package/dist/metadata.d.ts +6 -16
- package/dist/metadata.js +8 -76
- package/dist/metadata.js.map +1 -1
- package/dist/phone-room-session-Ca6rlxJr.d.ts +439 -0
- package/dist/phone-room-session-DkPR-K6e.d.cts +439 -0
- package/dist/platform-machine.cjs +133 -3
- package/dist/platform-machine.cjs.map +1 -1
- package/dist/platform-machine.d.cts +525 -27
- package/dist/platform-machine.d.ts +525 -27
- package/dist/platform-machine.js +119 -4
- package/dist/platform-machine.js.map +1 -1
- package/dist/{platform-settings-DUWs4JTy.d.cts → platform-settings-Yb0fQ1dl.d.cts} +1 -3
- package/dist/{platform-settings-DUWs4JTy.d.ts → platform-settings-Yb0fQ1dl.d.ts} +1 -3
- package/dist/prefabs.cjs +134 -3
- package/dist/prefabs.cjs.map +1 -1
- package/dist/prefabs.d.cts +23 -47
- package/dist/prefabs.d.ts +23 -47
- package/dist/prefabs.js +23 -4
- package/dist/prefabs.js.map +1 -1
- package/dist/preview.cjs +2214 -767
- package/dist/preview.cjs.map +1 -1
- package/dist/preview.d.cts +193 -38
- package/dist/preview.d.ts +193 -38
- package/dist/preview.js +478 -254
- package/dist/preview.js.map +1 -1
- package/dist/protocol.cjs +585 -391
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +13 -117
- package/dist/protocol.d.ts +13 -117
- package/dist/protocol.js +43 -80
- package/dist/protocol.js.map +1 -1
- package/dist/release.cjs.map +1 -1
- package/dist/release.d.cts +2 -2
- package/dist/release.d.ts +2 -2
- package/dist/release.js +1 -1
- package/dist/release.js.map +1 -1
- package/dist/replay-input-log-BvX4As2f.d.ts +31 -0
- package/dist/replay-input-log-Vcl0VDIy.d.cts +31 -0
- package/dist/room-protocol.cjs +794 -0
- package/dist/room-protocol.cjs.map +1 -0
- package/dist/room-protocol.d.cts +63 -0
- package/dist/room-protocol.d.ts +63 -0
- package/dist/room-protocol.js +143 -0
- package/dist/room-protocol.js.map +1 -0
- package/dist/room-session.cjs +2336 -0
- package/dist/room-session.cjs.map +1 -0
- package/dist/room-session.d.cts +77 -0
- package/dist/room-session.d.ts +77 -0
- package/dist/room-session.js +103 -0
- package/dist/room-session.js.map +1 -0
- package/dist/runtime/prefab-inspection-bridge.cjs +207 -0
- package/dist/runtime/prefab-inspection-bridge.cjs.map +1 -0
- package/dist/runtime/prefab-inspection-bridge.d.cts +156 -0
- package/dist/runtime/prefab-inspection-bridge.d.ts +156 -0
- package/dist/runtime/prefab-inspection-bridge.js +22 -0
- package/dist/runtime/prefab-inspection-bridge.js.map +1 -0
- package/dist/runtime-control.cjs +2112 -8
- package/dist/runtime-control.cjs.map +1 -1
- package/dist/runtime-control.d.cts +980 -12
- package/dist/runtime-control.d.ts +980 -12
- package/dist/runtime-control.js +264 -4
- package/dist/runtime-control.js.map +1 -1
- package/dist/runtime-inspection.cjs +1222 -558
- package/dist/runtime-inspection.cjs.map +1 -1
- package/dist/runtime-inspection.d.cts +530 -22
- package/dist/runtime-inspection.d.ts +530 -22
- package/dist/runtime-inspection.js +21 -22
- package/dist/runtime-inspection.js.map +1 -1
- package/dist/runtime-reporting-K_ZXpubu.d.cts +43 -0
- package/dist/runtime-reporting-K_ZXpubu.d.ts +43 -0
- package/dist/runtime-topology.cjs +2 -5
- package/dist/runtime-topology.cjs.map +1 -1
- package/dist/runtime-topology.d.cts +1 -1
- package/dist/runtime-topology.d.ts +1 -1
- package/dist/runtime-topology.js +1 -1
- package/dist/runtime-topology.js.map +1 -1
- package/dist/scoped-connector-CiiWu06D.d.ts +66 -0
- package/dist/scoped-connector-D7252pn0.d.cts +66 -0
- package/dist/sdk-channels-S6j6AH8v.d.cts +103 -0
- package/dist/sdk-channels-S6j6AH8v.d.ts +103 -0
- package/dist/simulation-BfRnC4rg.d.ts +782 -0
- package/dist/simulation-BwZx2pgt.d.cts +782 -0
- package/dist/{standard-match-phase-BzSgBYFg.d.ts → standard-match-phase-D4N-AU0d.d.cts} +3 -13
- package/dist/{standard-match-phase-CvJUW8Oe.d.cts → standard-match-phase-abt8ZjCh.d.ts} +3 -13
- package/dist/transport-CWF29jU6.d.cts +173 -0
- package/dist/transport-CWF29jU6.d.ts +173 -0
- package/dist/types-p28maMEo.d.cts +102 -0
- package/dist/types-p28maMEo.d.ts +102 -0
- package/dist/ui.cjs +2182 -892
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +75 -17
- package/dist/ui.d.ts +75 -17
- package/dist/ui.js +554 -393
- package/dist/ui.js.map +1 -1
- package/package.json +38 -21
- package/src/agent/agent-action.ts +0 -39
- package/src/agent/agent-contract-conformance.ts +8 -1
- package/src/agent/agent-contract.ts +2 -4
- package/src/agent/agent-evaluator.ts +95 -0
- package/src/agent/capture-canvas.ts +79 -0
- package/src/agent/host-canvas-capture.ts +189 -0
- package/src/agent-tooling.ts +5 -20
- package/src/arcade/bridge/controller.ts +8 -11
- package/src/arcade/bridge/host.ts +6 -11
- package/src/arcade/bridge/iframe.ts +1 -50
- package/src/arcade/host.ts +0 -1
- package/src/arcade/surface.ts +5 -1
- package/src/arcade/url.ts +2 -9
- package/src/audio/audio-manager.ts +23 -47
- package/src/audio/hooks.tsx +59 -72
- package/src/components/controller-player-name-field.tsx +2 -2
- package/src/components/controller-primary-action.tsx +1 -1
- package/src/components/controls.tsx +398 -0
- package/src/components/gamepad-layout.tsx +69 -0
- package/src/components/join-url-controls.tsx +5 -1
- package/src/components/lifecycle-action-group.tsx +1 -1
- package/src/components/player-avatar.tsx +50 -3
- package/src/components/room-qr-code.tsx +36 -77
- package/src/components/stage-capture-surface.tsx +91 -0
- package/src/components/surface-viewport.tsx +16 -3
- package/src/components/ui/button.tsx +1 -1
- package/src/constants.ts +0 -15
- package/src/context/air-jam-context.tsx +56 -187
- package/src/context/session-providers.tsx +13 -10
- package/src/controller-bridge.ts +7 -0
- package/src/core/assets.ts +48 -0
- package/src/core/config.ts +70 -0
- package/src/core/connection-store.ts +77 -0
- package/src/core/controller-input.ts +147 -0
- package/src/core/controller-runtime.ts +427 -0
- package/src/core/dev-events.ts +18 -0
- package/src/core/environment.ts +132 -0
- package/src/core/game-description.ts +44 -0
- package/src/core/game.ts +130 -0
- package/src/core/host-input.ts +207 -0
- package/src/core/host-runtime.ts +988 -0
- package/src/core/hosted-rooms.ts +26 -0
- package/src/core/input-bindings.ts +180 -0
- package/src/core/input-log.ts +144 -0
- package/src/core/input.ts +228 -0
- package/src/core/local-input.ts +319 -0
- package/src/core/replay-input-log.ts +298 -0
- package/src/core/replicated-store.ts +1178 -0
- package/src/core/room-action-ack.ts +43 -0
- package/src/core/settings.ts +202 -0
- package/src/core/simulation.ts +307 -0
- package/src/core/theme.ts +33 -0
- package/src/core.ts +162 -0
- package/src/dev/browser-log-sink.ts +35 -12
- package/src/diagnostics.ts +5 -6
- package/src/hooks/internal/use-controller-runtime-api.ts +58 -925
- package/src/hooks/internal/use-host-runtime-api.ts +98 -1270
- package/src/hooks/internal/use-runtime-inspection-contract.ts +14 -2
- package/src/hooks/use-air-jam-controller.ts +32 -53
- package/src/hooks/use-air-jam-host.ts +59 -100
- package/src/hooks/use-air-jam-settings.ts +27 -0
- package/src/hooks/use-controller-toasts.ts +16 -19
- package/src/hooks/use-host-agent-capture.ts +31 -0
- package/src/hooks/use-lifecycle-action-group-model.ts +1 -1
- package/src/hooks/use-send-signal.ts +23 -156
- package/src/hooks/use-simulation.ts +83 -0
- package/src/index.ts +24 -85
- package/src/lifecycle/index.ts +0 -4
- package/src/lifecycle/standard-match-phase.ts +1 -22
- package/src/metadata/manifest.ts +8 -19
- package/src/metadata.ts +1 -1
- package/src/platform-machine.ts +127 -3
- package/src/prefabs/types.ts +91 -20
- package/src/prefabs/view.ts +82 -0
- package/src/prefabs.ts +19 -0
- package/src/preview/host-workspace.tsx +4 -9
- package/src/preview/identity.ts +31 -23
- package/src/preview/layout.ts +5 -1
- package/src/preview/manager.ts +205 -78
- package/src/preview/messages.ts +47 -0
- package/src/preview/ownership.ts +6 -1
- package/src/preview/url.ts +46 -23
- package/src/preview/window.tsx +26 -69
- package/src/preview/workspace-local-seats.ts +166 -0
- package/src/preview/workspace.tsx +89 -37
- package/src/preview.ts +27 -15
- package/src/protocol/actions.ts +58 -0
- package/src/protocol/arcade-platform-actions.ts +2 -16
- package/src/protocol/controller.ts +14 -174
- package/src/protocol/core.ts +8 -15
- package/src/protocol/dev-log-events.ts +5 -81
- package/src/protocol/leased-control.ts +177 -0
- package/src/protocol/room/addressing.ts +35 -0
- package/src/protocol/room/close-codes.ts +33 -0
- package/src/protocol/room/frames.ts +343 -0
- package/src/protocol/room/input-codec.ts +182 -0
- package/src/protocol/room/limits.ts +58 -0
- package/src/protocol/room/patch.ts +135 -0
- package/src/protocol/room/sdk-channels.ts +81 -0
- package/src/protocol/room/seat-id.ts +31 -0
- package/src/protocol/room/transport.ts +63 -0
- package/src/protocol/room/weight.ts +58 -0
- package/src/protocol/runtime-reporting.ts +56 -10
- package/src/protocol.ts +2 -7
- package/src/qrcode.d.ts +3 -13
- package/src/room-protocol.ts +10 -0
- package/src/room-session/browser-wake-events.ts +14 -0
- package/src/room-session/channel-state.ts +293 -0
- package/src/room-session/clock.ts +24 -0
- package/src/room-session/host-room-session.ts +379 -0
- package/src/room-session/input-lane.ts +125 -0
- package/src/room-session/listeners.ts +22 -0
- package/src/room-session/loopback-link.ts +58 -0
- package/src/room-session/phone-room-session.ts +368 -0
- package/src/room-session/port-link.ts +116 -0
- package/src/room-session/room-key.ts +9 -0
- package/src/room-session/roster.ts +23 -0
- package/src/room-session/scoped-connector.ts +577 -0
- package/src/room-session/session-link.ts +306 -0
- package/src/room-session/web-socket-link.ts +57 -0
- package/src/room-session.ts +12 -0
- package/src/runtime/air-jam-config.ts +49 -37
- package/src/runtime/air-jam-error-boundary.tsx +9 -3
- package/src/runtime/arcade-runtime-url.ts +8 -9
- package/src/runtime/browser-controller-environment.ts +116 -0
- package/src/runtime/browser-host-environment.ts +137 -0
- package/src/runtime/browser-replay.ts +211 -0
- package/src/runtime/browser-room.ts +41 -0
- package/src/runtime/connected-runtime-error-boundary.tsx +35 -8
- package/src/runtime/contracts/agent-control.ts +195 -0
- package/src/runtime/contracts/clip.ts +169 -0
- package/src/runtime/contracts/control.ts +653 -16
- package/src/runtime/contracts/controller-agent.ts +130 -0
- package/src/runtime/contracts/input-log.ts +38 -0
- package/src/runtime/contracts/inspection.ts +25 -22
- package/src/runtime/contracts/observation.ts +186 -0
- package/src/runtime/contracts/runtime-identity.ts +43 -0
- package/src/runtime/contracts/timeline.ts +59 -0
- package/src/runtime/controller-agent-bridge.ts +152 -0
- package/src/runtime/controller-bridge-context.ts +29 -0
- package/src/runtime/controller-capture.ts +50 -0
- package/src/runtime/controller-identity.ts +53 -142
- package/src/runtime/controller-presentation.ts +47 -17
- package/src/runtime/controller-press.ts +271 -0
- package/src/runtime/create-air-jam-app.tsx +103 -74
- package/src/runtime/dev-runtime-events.ts +6 -18
- package/src/runtime/embedded-parent.ts +22 -0
- package/src/runtime/embedded-runtime-adapters.ts +10 -9
- package/src/runtime/host-agent-bridge.ts +127 -0
- package/src/runtime/host-capture-boundary.tsx +92 -0
- package/src/runtime/host-capture-context.ts +7 -0
- package/src/runtime/host-clip-reader.ts +93 -0
- package/src/runtime/host-clip-recorder.ts +342 -0
- package/src/runtime/host-input-log-reader.ts +120 -0
- package/src/runtime/host-observation.ts +207 -0
- package/src/runtime/host-pace.ts +36 -0
- package/src/runtime/host-runtime-fault.ts +51 -0
- package/src/runtime/host-timeline.ts +152 -0
- package/src/runtime/local-players.tsx +96 -0
- package/src/runtime/local-seats.ts +612 -0
- package/src/runtime/participant-control.ts +162 -0
- package/src/runtime/prefab-inspection-bridge.ts +174 -0
- package/src/runtime/prefab-inspection-clock.ts +12 -0
- package/src/runtime/prefab-inspection-context.ts +20 -0
- package/src/runtime/prefab-inspection-runtime.tsx +328 -0
- package/src/runtime/preview-inspection-bridge.ts +130 -0
- package/src/runtime/replay-runtime.tsx +101 -0
- package/src/runtime/room-bridge.ts +110 -0
- package/src/runtime/runtime-owner-contexts.tsx +9 -0
- package/src/runtime/runtime-session-params.ts +20 -23
- package/src/runtime/session-runtimes.tsx +231 -64
- package/src/runtime/stage-capture.ts +25 -0
- package/src/runtime-control.ts +41 -0
- package/src/runtime-inspection.ts +14 -7
- package/src/runtime-topology.ts +7 -8
- package/src/settings/platform-settings-runtime.tsx +47 -2
- package/src/settings/platform-settings.ts +0 -65
- package/src/store/use-air-jam-store.ts +73 -0
- package/src/ui.ts +3 -3
- package/src/utils/is-rpc-serializable.ts +11 -19
- package/src/utils/url-builder.ts +0 -7
- package/dist/air-jam-context-BlLPvCup.d.cts +0 -175
- package/dist/air-jam-context-DTsxF-tP.d.ts +0 -175
- package/dist/arcade/bridge.cjs +0 -1087
- package/dist/arcade/bridge.cjs.map +0 -1
- package/dist/arcade/bridge.d.cts +0 -11
- package/dist/arcade/bridge.d.ts +0 -11
- package/dist/arcade/bridge.js +0 -78
- package/dist/arcade/bridge.js.map +0 -1
- package/dist/arcade-runtime-url-BW-MUAOY.d.cts +0 -28
- package/dist/arcade-runtime-url-l8qj01Pg.d.ts +0 -28
- package/dist/arcade.cjs +0 -1767
- package/dist/arcade.cjs.map +0 -1
- package/dist/arcade.d.cts +0 -18
- package/dist/arcade.d.ts +0 -18
- package/dist/arcade.js +0 -129
- package/dist/arcade.js.map +0 -1
- package/dist/chunk-2SZ2YYGJ.js +0 -280
- package/dist/chunk-2SZ2YYGJ.js.map +0 -1
- package/dist/chunk-32RSSFSF.js +0 -214
- package/dist/chunk-32RSSFSF.js.map +0 -1
- package/dist/chunk-3USU7GY2.js.map +0 -1
- package/dist/chunk-3YMUAKPU.js +0 -10
- package/dist/chunk-3YMUAKPU.js.map +0 -1
- package/dist/chunk-56DM2KEW.js +0 -14
- package/dist/chunk-56DM2KEW.js.map +0 -1
- package/dist/chunk-BE6Z4SIT.js.map +0 -1
- package/dist/chunk-CM53YLT5.js +0 -59
- package/dist/chunk-CM53YLT5.js.map +0 -1
- package/dist/chunk-CV3PBXPT.js.map +0 -1
- package/dist/chunk-D4VDEVTZ.js.map +0 -1
- package/dist/chunk-EVZJA6RN.js.map +0 -1
- package/dist/chunk-FUA6EMSJ.js +0 -90
- package/dist/chunk-FUA6EMSJ.js.map +0 -1
- package/dist/chunk-GMLU7RI5.js +0 -70
- package/dist/chunk-GMLU7RI5.js.map +0 -1
- package/dist/chunk-IG6GZZSS.js.map +0 -1
- package/dist/chunk-IKKDONQL.js +0 -1
- package/dist/chunk-IKKDONQL.js.map +0 -1
- package/dist/chunk-ITMQSBTH.js +0 -26
- package/dist/chunk-ITMQSBTH.js.map +0 -1
- package/dist/chunk-J5MCII33.js +0 -620
- package/dist/chunk-J5MCII33.js.map +0 -1
- package/dist/chunk-JTF47B56.js +0 -1
- package/dist/chunk-JTF47B56.js.map +0 -1
- package/dist/chunk-K4OZ54UD.js.map +0 -1
- package/dist/chunk-LIHEEAVE.js +0 -191
- package/dist/chunk-LIHEEAVE.js.map +0 -1
- package/dist/chunk-LIXPF4P6.js +0 -22
- package/dist/chunk-LIXPF4P6.js.map +0 -1
- package/dist/chunk-MIMPMB7O.js.map +0 -1
- package/dist/chunk-MPDMJIX5.js +0 -1
- package/dist/chunk-MPDMJIX5.js.map +0 -1
- package/dist/chunk-O6X7FJ6N.js.map +0 -1
- package/dist/chunk-PSUYTD2L.js.map +0 -1
- package/dist/chunk-QO4KFUEI.js +0 -32
- package/dist/chunk-QO4KFUEI.js.map +0 -1
- package/dist/chunk-QTLYZADF.js +0 -125
- package/dist/chunk-QTLYZADF.js.map +0 -1
- package/dist/chunk-TGRTEWYV.js +0 -195
- package/dist/chunk-TGRTEWYV.js.map +0 -1
- package/dist/chunk-TTQDHKXL.js +0 -3017
- package/dist/chunk-TTQDHKXL.js.map +0 -1
- package/dist/chunk-UCPY7UJC.js +0 -8
- package/dist/chunk-UCPY7UJC.js.map +0 -1
- package/dist/chunk-UPV6YWT5.js +0 -43
- package/dist/chunk-UPV6YWT5.js.map +0 -1
- package/dist/chunk-UWJOIVON.js.map +0 -1
- package/dist/chunk-W2VK36RO.js +0 -11
- package/dist/chunk-W2VK36RO.js.map +0 -1
- package/dist/chunk-X24K52DG.js.map +0 -1
- package/dist/chunk-X35LLCWV.js.map +0 -1
- package/dist/chunk-YXHH3MQT.js +0 -230
- package/dist/chunk-YXHH3MQT.js.map +0 -1
- package/dist/controller-PZEM_1cH.d.ts +0 -176
- package/dist/controller-vj82tKm4.d.cts +0 -176
- package/dist/dev-log-events-BCJKmygo.d.cts +0 -120
- package/dist/dev-log-events-BCJKmygo.d.ts +0 -120
- package/dist/handshake-CC_LrK5g.d.cts +0 -31
- package/dist/handshake-CC_LrK5g.d.ts +0 -31
- package/dist/host-B9pRy0Aa.d.cts +0 -122
- package/dist/host-DylGsX7p.d.ts +0 -122
- package/dist/notices-C4bao3oi.d.ts +0 -38
- package/dist/notices-DNdOjwtj.d.cts +0 -38
- package/dist/realtime-client-Cu8yVJFw.d.cts +0 -15
- package/dist/realtime-client-Cu8yVJFw.d.ts +0 -15
- package/dist/runtime-reporting-pe-eryVz.d.cts +0 -27
- package/dist/runtime-reporting-pe-eryVz.d.ts +0 -27
- package/dist/signals-ZHftIKuc.d.cts +0 -33
- package/dist/signals-ZHftIKuc.d.ts +0 -33
- package/dist/sync-xtPfWhif.d.cts +0 -81
- package/dist/sync-xtPfWhif.d.ts +0 -81
- package/src/arcade/bridge.ts +0 -3
- package/src/arcade.ts +0 -4
- package/src/context/socket-manager.ts +0 -72
- package/src/events.ts +0 -119
- package/src/hooks/use-connection-status.ts +0 -8
- package/src/hooks/use-controller-tick.ts +0 -65
- package/src/hooks/use-get-input.ts +0 -100
- package/src/hooks/use-host-arcade-restore.ts +0 -35
- package/src/hooks/use-host-tick.ts +0 -171
- package/src/hooks/use-input-writer.ts +0 -83
- package/src/hooks/use-players.ts +0 -12
- package/src/internal/input-manager.ts +0 -356
- package/src/protocol/errors.ts +0 -21
- package/src/protocol/host-grant.ts +0 -103
- package/src/protocol/host.ts +0 -150
- package/src/protocol/notices.ts +0 -43
- package/src/protocol/signals.ts +0 -38
- package/src/protocol/socket-events.ts +0 -152
- package/src/protocol/sync.ts +0 -105
- package/src/runtime/admission-retry.ts +0 -62
- package/src/runtime/bridge-envelope-args.ts +0 -21
- package/src/runtime/controller-bridge.ts +0 -439
- package/src/runtime/controller-realtime-client.ts +0 -552
- package/src/runtime/host-bridge.ts +0 -380
- package/src/runtime/host-realtime-client.ts +0 -550
- package/src/runtime/realtime-client.ts +0 -20
- package/src/runtime/validate-arcade-bridge-attach.ts +0 -14
- package/src/state/connection-store.ts +0 -159
- package/src/store/create-air-jam-store.ts +0 -1193
- package/src/store/index.ts +0 -1
- package/src/utils/ids.ts +0 -58
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-air-jam-controller.ts"],"sourcesContent":["/**\n * @module useAirJamController\n * @description Hook for building mobile/web controllers that connect to AirJam hosts.\n *\n * This hook is used on the controller side (typically a mobile phone) to:\n * - Connect to a game session via room code\n * - Send input (joystick, buttons) to the host\n * - Receive game state updates\n * - Handle haptic feedback signals\n *\n * Controllers automatically handle:\n * - Room joining via URL parameter (?room=XXXX) or props\n * - Haptic feedback (vibration patterns on signal receipt)\n *\n * **Standalone:** joins using `?room=` or `roomId` (and optional `controllerId`).\n *\n * **Embedded controller iframe:** when `aj_room` + `aj_controller_id` are present, binds as the\n * platform-injected sub-controller; see\n * {@link ../runtime/embedded-runtime-adapters.readEmbeddedControllerChildSession}.\n */\nimport { useContext } from \"react\";\nimport { useStore } from \"zustand\";\nimport { useShallow } from \"zustand/react/shallow\";\nimport { useAirJamContext } from \"../context/air-jam-context\";\nimport { useAssertSessionScope } from \"../context/session-scope\";\nimport { createAirJamDiagnosticError } from \"../diagnostics\";\nimport type {\n ConnectionStatus,\n ControllerLeaveAck,\n ControllerOrientation,\n ControllerRoomSettingsState,\n ControllerStatePayload,\n ControllerUpdatePlayerProfileAck,\n PlayerProfile,\n PlayerProfilePatch,\n RoomCode,\n RuntimeState,\n} from \"../protocol\";\nimport type { AirJamRealtimeClient } from \"../runtime/realtime-client\";\nimport { controllerRuntimeContext } from \"../runtime/runtime-owner-contexts\";\nimport type { AirJamStore } from \"../state/connection-store\";\n\n/**\n * Options for configuring the controller runtime boundary.\n *\n * @example Basic runtime boundary usage (room from URL)\n * ```tsx\n * // URL: https://yourgame.com/controller?room=ABCD\n * <airjam.Controller>\n * <ControllerView />\n * </airjam.Controller>\n * ```\n *\n * @example With nickname\n * ```tsx\n * <airjam.Controller\n * nickname={playerName}\n * onState={(state) => {\n * if (state.runtimeState === \"playing\") startGame();\n * }}\n * >\n * <ControllerView />\n * </airjam.Controller>\n * ```\n */\nexport interface AirJamControllerOptions {\n /**\n * Room ID (4-character code) to join.\n * Can also be provided via URL query parameter: `?room=XXXX`\n * The URL parameter takes precedence if both are provided.\n */\n roomId?: string;\n /**\n * Player nickname to display in the game.\n * If not provided, the server assigns a random label.\n */\n nickname?: string;\n /**\n * Preset avatar id sent on join (optional).\n */\n avatarId?: string;\n /**\n * Controller ID for this instance.\n * Auto-generated if not provided. Persists across reconnects.\n */\n controllerId?: string;\n /**\n * Optional privileged controller capability token.\n * Undefined falls back to `aj_controller_cap` from the URL; null explicitly disables URL token use.\n */\n capabilityToken?: string | null;\n /**\n * Called when the host sends a state update (game state, messages, etc.)\n */\n onState?: (state: ControllerStatePayload) => void;\n}\n\n/**\n * Return type of useAirJamController hook.\n *\n * Provides state and functions for a mobile/web controller interface.\n */\nexport interface AirJamControllerApi {\n /** Room code this controller is connected to (or attempting to join) */\n roomId: RoomCode | null;\n /** This controller's unique ID */\n controllerId: string | null;\n /** Current connection status */\n connectionStatus: ConnectionStatus;\n /** Last error message, if any */\n lastError?: string;\n /** Current game state (paused or playing) */\n runtimeState: RuntimeState;\n /** Intended controller presentation orientation for the active game UI. */\n controllerOrientation: ControllerOrientation;\n /** Optional message from the host (e.g., \"Get Ready!\") */\n stateMessage?: string;\n /** Current host-owned room settings mirrored onto the controller. */\n roomSettings: ControllerRoomSettingsState;\n /**\n * Send a system command to the host.\n *\n * @example Pause or resume\n * ```ts\n * controller.sendSystemCommand(\"pause\");\n * controller.sendSystemCommand(\"resume\");\n * ```\n */\n sendSystemCommand: (command: \"exit\" | \"pause\" | \"resume\") => void;\n /**\n * Update the player nickname (local draft for next join).\n */\n setNickname: (value: string) => void;\n /**\n * Update preset avatar id (local draft for next join).\n */\n setAvatarId: (value: string) => void;\n /**\n * Patch display name and/or avatar on the server without reconnecting.\n * In Arcade (embedded iframe), updates are forwarded through the controller bridge; the room\n * still learns the new name via `server:playerUpdated` (ack payload is not round-tripped).\n */\n updatePlayerProfile: (\n patch: PlayerProfilePatch,\n ) => Promise<ControllerUpdatePlayerProfileAck>;\n /** Explicitly leave the current room and release the controller binding. */\n leave: () => Promise<ControllerLeaveAck>;\n /** Force reconnection to the room */\n reconnect: () => void;\n /** List of all connected players in the room */\n players: PlayerProfile[];\n /** This controller's current player profile when known. */\n selfPlayer: PlayerProfile | null;\n /** Realtime client for controller events (socket-backed standalone, bridge-backed in arcade embeds) */\n socket: AirJamRealtimeClient | null;\n}\n\nexport interface AirJamControllerState {\n roomId: RoomCode | null;\n controllerId: string | null;\n connectionStatus: ConnectionStatus;\n lastError?: string;\n runtimeState: RuntimeState;\n controllerOrientation: ControllerOrientation;\n stateMessage?: string;\n roomSettings: ControllerRoomSettingsState;\n players: PlayerProfile[];\n selfPlayer: PlayerProfile | null;\n}\n\nexport type AirJamControllerRuntimeControls = Pick<\n AirJamControllerApi,\n | \"sendSystemCommand\"\n | \"setNickname\"\n | \"setAvatarId\"\n | \"updatePlayerProfile\"\n | \"leave\"\n | \"reconnect\"\n | \"socket\"\n>;\n\nconst toControllerState = (state: AirJamStore): AirJamControllerState => {\n const selfPlayer = state.controllerId\n ? (state.players.find((player) => player.id === state.controllerId) ?? null)\n : null;\n\n return {\n roomId: state.roomId,\n controllerId: state.controllerId,\n connectionStatus: state.connectionStatus,\n lastError: state.lastError,\n runtimeState: state.runtimeState,\n controllerOrientation: state.controllerOrientation,\n stateMessage: state.stateMessage,\n roomSettings: state.roomSettings,\n players: state.players,\n selfPlayer,\n };\n};\n\n/**\n * Read the mounted controller runtime API.\n *\n * Use this inside the explicit `airjam.Controller` runtime boundary. Runtime\n * ownership is mounted once at the\n * boundary; child code reads from that runtime through this hook.\n *\n * **Typical usage flow:**\n * 1. Player scans QR code on game screen\n * 2. Opens controller URL with ?room=XXXX parameter\n * 3. Controller auto-connects to the game session\n * 4. Player uses joystick/buttons to send input\n * 5. Receives haptic feedback on game events\n *\n * @returns Controller API with state and functions\n *\n * @example Basic controller setup\n * ```tsx\n * const ControllerView = () => {\n * const controller = useAirJamController();\n *\n * if (controller.connectionStatus !== \"connected\") {\n * return <div>Connecting to room {controller.roomId}...</div>;\n * }\n *\n * return (\n * <div>\n * <p>Connected: {controller.controllerId}</p>\n * <p>Game: {controller.runtimeState}</p>\n * </div>\n * );\n * };\n * ```\n *\n * @example With state callback\n * ```tsx\n * <airjam.Controller\n * onState={(state) => {\n * if (state.message) {\n * showNotification(state.message);\n * }\n * }}\n * >\n * <ControllerView />\n * </airjam.Controller>\n * ```\n */\nexport function useAirJamController(): AirJamControllerApi;\nexport function useAirJamController<TSelected>(\n selector: (state: AirJamControllerState) => TSelected,\n): TSelected;\nexport function useAirJamController<TSelected>(\n selector?: (state: AirJamControllerState) => TSelected,\n): AirJamControllerApi | TSelected {\n useAssertSessionScope(\"controller\", \"useAirJamController\");\n\n const { store } = useAirJamContext();\n const selectedState = useStore(\n store,\n useShallow((state) => {\n const controllerState = toControllerState(state);\n return selector ? selector(controllerState) : controllerState;\n }),\n );\n const runtime = useContext(\n controllerRuntimeContext,\n ) as AirJamControllerRuntimeControls | null;\n if (!runtime) {\n throw createAirJamDiagnosticError(\n \"AJ_SCOPE_MISMATCH\",\n \"useAirJamController requires a mounted controller runtime boundary. Wrap the controller tree with <airjam.Controller> before reading controller state.\",\n {\n hookName: \"useAirJamController\",\n expectedScope: \"controller\",\n receivedScope: \"controller\",\n },\n );\n }\n\n if (selector) {\n return selectedState as TSelected;\n }\n\n return {\n ...(selectedState as AirJamControllerState),\n ...runtime,\n };\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AA+J3B,IAAM,oBAAoB,CAAC,UAA8C;AACvE,QAAM,aAAa,MAAM,eACpB,MAAM,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,MAAM,YAAY,KAAK,OACrE;AAEJ,SAAO;AAAA,IACL,QAAQ,MAAM;AAAA,IACd,cAAc,MAAM;AAAA,IACpB,kBAAkB,MAAM;AAAA,IACxB,WAAW,MAAM;AAAA,IACjB,cAAc,MAAM;AAAA,IACpB,uBAAuB,MAAM;AAAA,IAC7B,cAAc,MAAM;AAAA,IACpB,cAAc,MAAM;AAAA,IACpB,SAAS,MAAM;AAAA,IACf;AAAA,EACF;AACF;AAqDO,SAAS,oBACd,UACiC;AACjC,wBAAsB,cAAc,qBAAqB;AAEzD,QAAM,EAAE,MAAM,IAAI,iBAAiB;AACnC,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,WAAW,CAAC,UAAU;AACpB,YAAM,kBAAkB,kBAAkB,KAAK;AAC/C,aAAO,WAAW,SAAS,eAAe,IAAI;AAAA,IAChD,CAAC;AAAA,EACH;AACA,QAAM,UAAU;AAAA,IACd;AAAA,EACF;AACA,MAAI,CAAC,SAAS;AACZ,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAEA,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAI;AAAA,IACJ,GAAG;AAAA,EACL;AACF;","names":[]}
|
package/dist/chunk-YXHH3MQT.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CONTROLLER_PATH,
|
|
3
|
-
DEFAULT_SERVER_PORT
|
|
4
|
-
} from "./chunk-W2VK36RO.js";
|
|
5
|
-
|
|
6
|
-
// src/utils/network-ip.ts
|
|
7
|
-
var isVirtualNetwork = (ip) => {
|
|
8
|
-
if (ip.startsWith("192.168.64.") || ip.startsWith("192.168.65.")) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
if (ip.startsWith("172.17.")) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (ip.startsWith("172.18.") || ip.startsWith("172.19.")) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
if (ip.startsWith("169.254.")) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
};
|
|
22
|
-
var scoreIp = (ip) => {
|
|
23
|
-
if (ip.startsWith("192.168.")) {
|
|
24
|
-
const parts = ip.split(".");
|
|
25
|
-
const thirdOctet = parseInt(parts[2] || "0", 10);
|
|
26
|
-
if (thirdOctet < 64) {
|
|
27
|
-
return 100 - thirdOctet;
|
|
28
|
-
}
|
|
29
|
-
return 10;
|
|
30
|
-
}
|
|
31
|
-
if (ip.startsWith("10.")) {
|
|
32
|
-
return 50;
|
|
33
|
-
}
|
|
34
|
-
if (/^172\.(1[6-9]|2[0-9]|3[01])\./.test(ip)) {
|
|
35
|
-
return 30;
|
|
36
|
-
}
|
|
37
|
-
return 0;
|
|
38
|
-
};
|
|
39
|
-
var getLocalNetworkIp = () => {
|
|
40
|
-
return new Promise((resolve) => {
|
|
41
|
-
if (typeof window === "undefined" || typeof RTCPeerConnection === "undefined") {
|
|
42
|
-
resolve(null);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const pc = new RTCPeerConnection({
|
|
46
|
-
iceServers: [{ urls: "stun:stun.l.google.com:19302" }]
|
|
47
|
-
});
|
|
48
|
-
const candidates = [];
|
|
49
|
-
let candidateGatheringComplete = false;
|
|
50
|
-
const resolveOnce = (ip) => {
|
|
51
|
-
pc.close();
|
|
52
|
-
resolve(ip);
|
|
53
|
-
};
|
|
54
|
-
const timeout = setTimeout(() => {
|
|
55
|
-
if (candidateGatheringComplete) {
|
|
56
|
-
pickBestCandidate();
|
|
57
|
-
} else {
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
pickBestCandidate();
|
|
60
|
-
}, 500);
|
|
61
|
-
}
|
|
62
|
-
}, 3e3);
|
|
63
|
-
const pickBestCandidate = () => {
|
|
64
|
-
if (candidates.length === 0) {
|
|
65
|
-
resolveOnce(null);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
candidates.sort((a, b) => b.score - a.score);
|
|
69
|
-
const best = candidates[0];
|
|
70
|
-
clearTimeout(timeout);
|
|
71
|
-
resolveOnce(best.ip);
|
|
72
|
-
};
|
|
73
|
-
pc.onicecandidate = (event) => {
|
|
74
|
-
if (event.candidate) {
|
|
75
|
-
const candidate = event.candidate.candidate;
|
|
76
|
-
const match = candidate.match(/([0-9]{1,3}(\.[0-9]{1,3}){3})/);
|
|
77
|
-
if (match) {
|
|
78
|
-
const ip = match[1];
|
|
79
|
-
if (ip === "127.0.0.1") {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const isPrivate = ip.startsWith("192.168.") || ip.startsWith("10.") || /^172\.(1[6-9]|2[0-9]|3[01])\./.test(ip);
|
|
83
|
-
if (isPrivate && !isVirtualNetwork(ip)) {
|
|
84
|
-
const score = scoreIp(ip);
|
|
85
|
-
candidates.push({ ip, score });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
candidateGatheringComplete = true;
|
|
90
|
-
setTimeout(() => {
|
|
91
|
-
pickBestCandidate();
|
|
92
|
-
}, 200);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
pc.createDataChannel("");
|
|
96
|
-
pc.createOffer().then((offer) => pc.setLocalDescription(offer)).catch(() => {
|
|
97
|
-
clearTimeout(timeout);
|
|
98
|
-
resolveOnce(null);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// src/utils/url-builder.ts
|
|
104
|
-
var UrlBuilder = class {
|
|
105
|
-
cachedLocalIp = null;
|
|
106
|
-
ipDetectionPromise = null;
|
|
107
|
-
/**
|
|
108
|
-
* Get the local network IP address with caching.
|
|
109
|
-
* First call triggers detection, subsequent calls return cached value.
|
|
110
|
-
*/
|
|
111
|
-
async getLocalIp() {
|
|
112
|
-
if (this.cachedLocalIp !== null) {
|
|
113
|
-
return this.cachedLocalIp;
|
|
114
|
-
}
|
|
115
|
-
if (this.ipDetectionPromise !== null) {
|
|
116
|
-
return this.ipDetectionPromise;
|
|
117
|
-
}
|
|
118
|
-
this.ipDetectionPromise = getLocalNetworkIp().then((ip) => {
|
|
119
|
-
this.cachedLocalIp = ip;
|
|
120
|
-
this.ipDetectionPromise = null;
|
|
121
|
-
return ip;
|
|
122
|
-
});
|
|
123
|
-
return this.ipDetectionPromise;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Clear the cached IP address.
|
|
127
|
-
* Useful for testing or when network changes are detected.
|
|
128
|
-
*/
|
|
129
|
-
clearCache() {
|
|
130
|
-
this.cachedLocalIp = null;
|
|
131
|
-
this.ipDetectionPromise = null;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Normalize a URL for mobile access.
|
|
135
|
-
* Replaces localhost with the local network IP.
|
|
136
|
-
*/
|
|
137
|
-
async normalizeForMobile(url) {
|
|
138
|
-
if (typeof window === "undefined") return url;
|
|
139
|
-
try {
|
|
140
|
-
const urlObj = new URL(url);
|
|
141
|
-
if (urlObj.hostname === "localhost" || urlObj.hostname === "127.0.0.1") {
|
|
142
|
-
const localIp = await this.getLocalIp();
|
|
143
|
-
if (localIp) {
|
|
144
|
-
urlObj.hostname = localIp;
|
|
145
|
-
return urlObj.toString();
|
|
146
|
-
}
|
|
147
|
-
urlObj.hostname = window.location.hostname;
|
|
148
|
-
return urlObj.toString();
|
|
149
|
-
}
|
|
150
|
-
return url;
|
|
151
|
-
} catch {
|
|
152
|
-
return url;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Build a controller URL with room code.
|
|
157
|
-
* Controller is always at {baseUrl}/controller (standardized convention).
|
|
158
|
-
* Automatically uses local IP when running on localhost.
|
|
159
|
-
*/
|
|
160
|
-
async buildControllerUrl(roomId, options) {
|
|
161
|
-
const path = CONTROLLER_PATH;
|
|
162
|
-
if (options?.host) {
|
|
163
|
-
const url2 = new URL(path, this.normalizeOrigin(options.host));
|
|
164
|
-
url2.searchParams.set("room", roomId);
|
|
165
|
-
if (options.capabilityToken) {
|
|
166
|
-
url2.searchParams.set("aj_controller_cap", options.capabilityToken);
|
|
167
|
-
}
|
|
168
|
-
return url2.toString();
|
|
169
|
-
}
|
|
170
|
-
let base;
|
|
171
|
-
if (typeof window === "undefined") {
|
|
172
|
-
base = `http://localhost:${DEFAULT_SERVER_PORT}`;
|
|
173
|
-
} else {
|
|
174
|
-
const currentUrl = new URL(window.location.href);
|
|
175
|
-
if (!this.isLocalhost(currentUrl.hostname)) {
|
|
176
|
-
base = currentUrl.origin;
|
|
177
|
-
} else {
|
|
178
|
-
const localIp = await this.getLocalIp();
|
|
179
|
-
if (localIp) {
|
|
180
|
-
const port = currentUrl.port;
|
|
181
|
-
base = port ? `http://${localIp}:${port}` : `http://${localIp}`;
|
|
182
|
-
} else {
|
|
183
|
-
base = currentUrl.origin;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const url = new URL(path, base);
|
|
188
|
-
url.searchParams.set("room", roomId);
|
|
189
|
-
if (options?.capabilityToken) {
|
|
190
|
-
url.searchParams.set("aj_controller_cap", options.capabilityToken);
|
|
191
|
-
}
|
|
192
|
-
return url.toString();
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Resolve the server URL.
|
|
196
|
-
* Uses explicit URL if provided, otherwise infers from window location.
|
|
197
|
-
*/
|
|
198
|
-
resolveServerUrl(explicit) {
|
|
199
|
-
if (explicit) {
|
|
200
|
-
return this.normalizeOrigin(explicit);
|
|
201
|
-
}
|
|
202
|
-
if (typeof window !== "undefined") {
|
|
203
|
-
const url = new URL(window.location.href);
|
|
204
|
-
url.port = String(DEFAULT_SERVER_PORT);
|
|
205
|
-
return url.origin;
|
|
206
|
-
}
|
|
207
|
-
return `http://localhost:${DEFAULT_SERVER_PORT}`;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Check if a hostname is localhost.
|
|
211
|
-
*/
|
|
212
|
-
isLocalhost(hostname) {
|
|
213
|
-
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Normalize an origin string to ensure it has a protocol.
|
|
217
|
-
*/
|
|
218
|
-
normalizeOrigin(origin) {
|
|
219
|
-
if (!origin.includes("://")) {
|
|
220
|
-
return `http://${origin}`;
|
|
221
|
-
}
|
|
222
|
-
return origin;
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
var urlBuilder = new UrlBuilder();
|
|
226
|
-
|
|
227
|
-
export {
|
|
228
|
-
urlBuilder
|
|
229
|
-
};
|
|
230
|
-
//# sourceMappingURL=chunk-YXHH3MQT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/network-ip.ts","../src/utils/url-builder.ts"],"sourcesContent":["/**\n * Checks if an IP is from a virtual network interface (Docker, VMs, etc.)\n */\nconst isVirtualNetwork = (ip: string): boolean => {\n // Docker Desktop on Mac uses 192.168.64.x and 192.168.65.x\n if (ip.startsWith(\"192.168.64.\") || ip.startsWith(\"192.168.65.\")) {\n return true;\n }\n // Docker default bridge network\n if (ip.startsWith(\"172.17.\")) {\n return true;\n }\n // Other common virtual network ranges\n if (ip.startsWith(\"172.18.\") || ip.startsWith(\"172.19.\")) {\n return true;\n }\n // Link-local addresses\n if (ip.startsWith(\"169.254.\")) {\n return true;\n }\n return false;\n};\n\n/**\n * Scores an IP address to determine preference.\n * Higher score = more preferred.\n */\nconst scoreIp = (ip: string): number => {\n // Prefer 192.168.0.x - 192.168.63.x (common home network ranges, excluding virtual networks)\n if (ip.startsWith(\"192.168.\")) {\n const parts = ip.split(\".\");\n const thirdOctet = parseInt(parts[2] || \"0\", 10);\n // Prefer lower third octets (0-63) as they're more likely to be real networks\n if (thirdOctet < 64) {\n return 100 - thirdOctet; // Higher score for lower numbers\n }\n // 64+ are often virtual, but we'll still consider them if nothing else\n return 10;\n }\n // Prefer 10.x.x.x networks\n if (ip.startsWith(\"10.\")) {\n return 50;\n }\n // 172.16-31.x.x networks (but not 172.17.x.x which is Docker)\n if (/^172\\.(1[6-9]|2[0-9]|3[01])\\./.test(ip)) {\n return 30;\n }\n return 0;\n};\n\n/**\n * Gets the local network IP address using WebRTC.\n * Filters out virtual network interfaces and prefers real network IPs.\n * Returns null if unable to determine the IP.\n */\nexport const getLocalNetworkIp = (): Promise<string | null> => {\n return new Promise((resolve) => {\n // If not in browser, return null\n if (\n typeof window === \"undefined\" ||\n typeof RTCPeerConnection === \"undefined\"\n ) {\n resolve(null);\n return;\n }\n\n const pc = new RTCPeerConnection({\n iceServers: [{ urls: \"stun:stun.l.google.com:19302\" }],\n });\n\n const candidates: Array<{ ip: string; score: number }> = [];\n let candidateGatheringComplete = false;\n\n const resolveOnce = (ip: string | null) => {\n pc.close();\n resolve(ip);\n };\n\n // Timeout after 3 seconds\n const timeout = setTimeout(() => {\n if (candidateGatheringComplete) {\n pickBestCandidate();\n } else {\n // Wait a bit more for candidates to arrive\n setTimeout(() => {\n pickBestCandidate();\n }, 500);\n }\n }, 3000);\n\n const pickBestCandidate = () => {\n if (candidates.length === 0) {\n resolveOnce(null);\n return;\n }\n\n // Sort by score (highest first), then pick the best one\n candidates.sort((a, b) => b.score - a.score);\n const best = candidates[0];\n clearTimeout(timeout);\n resolveOnce(best.ip);\n };\n\n pc.onicecandidate = (event) => {\n if (event.candidate) {\n const candidate = event.candidate.candidate;\n const match = candidate.match(/([0-9]{1,3}(\\.[0-9]{1,3}){3})/);\n if (match) {\n const ip = match[1];\n // Filter out localhost\n if (ip === \"127.0.0.1\") {\n return;\n }\n\n // Check if it's a private network IP\n const isPrivate =\n ip.startsWith(\"192.168.\") ||\n ip.startsWith(\"10.\") ||\n /^172\\.(1[6-9]|2[0-9]|3[01])\\./.test(ip);\n\n if (isPrivate && !isVirtualNetwork(ip)) {\n const score = scoreIp(ip);\n candidates.push({ ip, score });\n }\n }\n } else {\n // No more candidates - gathering is complete\n candidateGatheringComplete = true;\n // Give it a moment for any last candidates to arrive, then pick the best\n setTimeout(() => {\n pickBestCandidate();\n }, 200);\n }\n };\n\n // Create a data channel to trigger candidate gathering\n pc.createDataChannel(\"\");\n pc.createOffer()\n .then((offer) => pc.setLocalDescription(offer))\n .catch(() => {\n clearTimeout(timeout);\n resolveOnce(null);\n });\n });\n};\n","import { CONTROLLER_PATH, DEFAULT_SERVER_PORT } from \"../constants\";\nimport type { RoomCode } from \"../protocol\";\nimport { getLocalNetworkIp } from \"./network-ip\";\n\n/**\n * Centralized URL builder service for Air Jam.\n * Handles IP detection, URL normalization, and construction of all URL types.\n */\nclass UrlBuilder {\n private cachedLocalIp: string | null = null;\n private ipDetectionPromise: Promise<string | null> | null = null;\n\n /**\n * Get the local network IP address with caching.\n * First call triggers detection, subsequent calls return cached value.\n */\n async getLocalIp(): Promise<string | null> {\n // Return cached value if available\n if (this.cachedLocalIp !== null) {\n return this.cachedLocalIp;\n }\n\n // If detection is already in progress, wait for it\n if (this.ipDetectionPromise !== null) {\n return this.ipDetectionPromise;\n }\n\n // Start IP detection\n this.ipDetectionPromise = getLocalNetworkIp().then((ip) => {\n this.cachedLocalIp = ip;\n this.ipDetectionPromise = null;\n return ip;\n });\n\n return this.ipDetectionPromise;\n }\n\n /**\n * Clear the cached IP address.\n * Useful for testing or when network changes are detected.\n */\n clearCache(): void {\n this.cachedLocalIp = null;\n this.ipDetectionPromise = null;\n }\n\n /**\n * Normalize a URL for mobile access.\n * Replaces localhost with the local network IP.\n */\n async normalizeForMobile(url: string): Promise<string> {\n if (typeof window === \"undefined\") return url;\n\n try {\n const urlObj = new URL(url);\n\n // If URL uses localhost, replace with local network IP\n if (urlObj.hostname === \"localhost\" || urlObj.hostname === \"127.0.0.1\") {\n const localIp = await this.getLocalIp();\n\n if (localIp) {\n urlObj.hostname = localIp;\n return urlObj.toString();\n }\n\n // Fallback to current hostname if IP detection fails\n urlObj.hostname = window.location.hostname;\n return urlObj.toString();\n }\n\n return url;\n } catch {\n return url;\n }\n }\n\n /**\n * Build a controller URL with room code.\n * Controller is always at {baseUrl}/controller (standardized convention).\n * Automatically uses local IP when running on localhost.\n */\n async buildControllerUrl(\n roomId: RoomCode,\n options?: {\n host?: string;\n capabilityToken?: string;\n },\n ): Promise<string> {\n const path = CONTROLLER_PATH;\n\n // If explicit host is provided, use it\n if (options?.host) {\n const url = new URL(path, this.normalizeOrigin(options.host));\n url.searchParams.set(\"room\", roomId);\n if (options.capabilityToken) {\n url.searchParams.set(\"aj_controller_cap\", options.capabilityToken);\n }\n return url.toString();\n }\n\n // Determine base URL\n let base: string;\n if (typeof window === \"undefined\") {\n base = `http://localhost:${DEFAULT_SERVER_PORT}`;\n } else {\n const currentUrl = new URL(window.location.href);\n\n // If not localhost, use the current origin\n if (!this.isLocalhost(currentUrl.hostname)) {\n base = currentUrl.origin;\n } else {\n // If localhost, try to get the local network IP\n const localIp = await this.getLocalIp();\n if (localIp) {\n // Preserve the port from the current URL\n const port = currentUrl.port;\n base = port ? `http://${localIp}:${port}` : `http://${localIp}`;\n } else {\n // Fallback to localhost if we can't determine the IP\n base = currentUrl.origin;\n }\n }\n }\n\n const url = new URL(path, base);\n url.searchParams.set(\"room\", roomId);\n if (options?.capabilityToken) {\n url.searchParams.set(\"aj_controller_cap\", options.capabilityToken);\n }\n return url.toString();\n }\n\n /**\n * Resolve the server URL.\n * Uses explicit URL if provided, otherwise infers from window location.\n */\n resolveServerUrl(explicit?: string): string {\n if (explicit) {\n return this.normalizeOrigin(explicit);\n }\n\n if (typeof window !== \"undefined\") {\n const url = new URL(window.location.href);\n url.port = String(DEFAULT_SERVER_PORT);\n return url.origin;\n }\n\n return `http://localhost:${DEFAULT_SERVER_PORT}`;\n }\n\n /**\n * Check if a hostname is localhost.\n */\n private isLocalhost(hostname: string): boolean {\n return (\n hostname === \"localhost\" ||\n hostname === \"127.0.0.1\" ||\n hostname === \"[::1]\"\n );\n }\n\n /**\n * Normalize an origin string to ensure it has a protocol.\n */\n private normalizeOrigin(origin: string): string {\n if (!origin.includes(\"://\")) {\n return `http://${origin}`;\n }\n return origin;\n }\n}\n\n// Export singleton instance\nexport const urlBuilder = new UrlBuilder();\n\n// Export class for testing/advanced usage\nexport { UrlBuilder };\n"],"mappings":"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","names":["url"]}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { R as RoomPlatformSettingsSnapshot } from './platform-settings-DUWs4JTy.js';
|
|
3
|
-
|
|
4
|
-
type RoomCode = string;
|
|
5
|
-
type ConnectionRole = "host" | "controller";
|
|
6
|
-
type ConnectionStatus = "idle" | "connecting" | "connected" | "disconnected" | "reconnecting";
|
|
7
|
-
type RunMode = "standalone" | "platform";
|
|
8
|
-
type RuntimeState = "paused" | "playing";
|
|
9
|
-
declare const roomCodeSchema: z.ZodString;
|
|
10
|
-
|
|
11
|
-
declare enum ErrorCode {
|
|
12
|
-
ROOM_NOT_FOUND = "ROOM_NOT_FOUND",
|
|
13
|
-
ROOM_FULL = "ROOM_FULL",
|
|
14
|
-
INVALID_APP_ID = "INVALID_APP_ID",
|
|
15
|
-
UNAUTHORIZED = "UNAUTHORIZED",
|
|
16
|
-
INVALID_TOKEN = "INVALID_TOKEN",
|
|
17
|
-
TOKEN_EXPIRED = "TOKEN_EXPIRED",
|
|
18
|
-
CONNECTION_FAILED = "CONNECTION_FAILED",
|
|
19
|
-
ALREADY_CONNECTED = "ALREADY_CONNECTED",
|
|
20
|
-
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
21
|
-
INVALID_ROOM_CODE = "INVALID_ROOM_CODE",
|
|
22
|
-
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
|
|
23
|
-
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
24
|
-
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
25
|
-
}
|
|
26
|
-
interface ServerErrorPayload {
|
|
27
|
-
code: ErrorCode | string;
|
|
28
|
-
message: string;
|
|
29
|
-
details?: unknown;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare const controllerInputSchema: z.ZodObject<{
|
|
33
|
-
roomId: z.ZodString;
|
|
34
|
-
controllerId: z.ZodString;
|
|
35
|
-
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
36
|
-
}, z.core.$strip>;
|
|
37
|
-
type ControllerInputPayload = Record<string, unknown>;
|
|
38
|
-
interface ControllerInputEvent {
|
|
39
|
-
roomId: RoomCode;
|
|
40
|
-
controllerId: string;
|
|
41
|
-
input: ControllerInputPayload;
|
|
42
|
-
}
|
|
43
|
-
declare const controllerOrientationSchema: z.ZodEnum<{
|
|
44
|
-
portrait: "portrait";
|
|
45
|
-
landscape: "landscape";
|
|
46
|
-
}>;
|
|
47
|
-
type ControllerOrientation = z.infer<typeof controllerOrientationSchema>;
|
|
48
|
-
declare const controllerSourceSchema: z.ZodEnum<{
|
|
49
|
-
phone: "phone";
|
|
50
|
-
preview: "preview";
|
|
51
|
-
virtual: "virtual";
|
|
52
|
-
}>;
|
|
53
|
-
type ControllerSource = z.infer<typeof controllerSourceSchema>;
|
|
54
|
-
declare const PREVIEW_CONTROLLER_DEVICE_ID_PREFIX = "pd_";
|
|
55
|
-
declare const VIRTUAL_CONTROLLER_DEVICE_ID_PREFIX = "aj-mcp-device-";
|
|
56
|
-
declare const inferControllerSourceFromDeviceId: (deviceId: string | null | undefined) => ControllerSource;
|
|
57
|
-
declare const controllerStateSchema: z.ZodObject<{
|
|
58
|
-
roomId: z.ZodString;
|
|
59
|
-
state: z.ZodObject<{
|
|
60
|
-
orientation: z.ZodOptional<z.ZodEnum<{
|
|
61
|
-
portrait: "portrait";
|
|
62
|
-
landscape: "landscape";
|
|
63
|
-
}>>;
|
|
64
|
-
message: z.ZodOptional<z.ZodString>;
|
|
65
|
-
roomSettings: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
audio: z.ZodObject<{
|
|
67
|
-
masterVolume: z.ZodNumber;
|
|
68
|
-
musicVolume: z.ZodNumber;
|
|
69
|
-
sfxVolume: z.ZodNumber;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
previewControllers: z.ZodObject<{
|
|
72
|
-
activeOpacity: z.ZodNumber;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
}, z.core.$strip>>;
|
|
75
|
-
runtimeState: z.ZodOptional<z.ZodEnum<{
|
|
76
|
-
paused: "paused";
|
|
77
|
-
playing: "playing";
|
|
78
|
-
}>>;
|
|
79
|
-
stateVersion: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
}, z.core.$strip>;
|
|
82
|
-
type ControllerStateMessage = z.infer<typeof controllerStateSchema>;
|
|
83
|
-
type ControllerStatePayload = z.infer<typeof controllerStateSchema>["state"];
|
|
84
|
-
type ControllerRoomSettingsState = RoomPlatformSettingsSnapshot;
|
|
85
|
-
declare const controllerJoinSchema: z.ZodObject<{
|
|
86
|
-
roomId: z.ZodString;
|
|
87
|
-
controllerId: z.ZodString;
|
|
88
|
-
deviceId: z.ZodOptional<z.ZodString>;
|
|
89
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
90
|
-
avatarId: z.ZodOptional<z.ZodString>;
|
|
91
|
-
capabilityToken: z.ZodOptional<z.ZodString>;
|
|
92
|
-
resumeCapabilityToken: z.ZodOptional<z.ZodString>;
|
|
93
|
-
}, z.core.$strip>;
|
|
94
|
-
type ControllerJoinPayload = z.infer<typeof controllerJoinSchema>;
|
|
95
|
-
declare const controllerLeaveSchema: z.ZodObject<{
|
|
96
|
-
roomId: z.ZodString;
|
|
97
|
-
controllerId: z.ZodString;
|
|
98
|
-
}, z.core.$strip>;
|
|
99
|
-
type ControllerLeavePayload = z.infer<typeof controllerLeaveSchema>;
|
|
100
|
-
interface ControllerLeaveAck {
|
|
101
|
-
ok: boolean;
|
|
102
|
-
message?: string;
|
|
103
|
-
code?: ErrorCode | string;
|
|
104
|
-
}
|
|
105
|
-
declare const controllerSystemSchema: z.ZodObject<{
|
|
106
|
-
roomId: z.ZodString;
|
|
107
|
-
command: z.ZodEnum<{
|
|
108
|
-
exit: "exit";
|
|
109
|
-
pause: "pause";
|
|
110
|
-
resume: "resume";
|
|
111
|
-
}>;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
type ControllerSystemPayload = z.infer<typeof controllerSystemSchema>;
|
|
114
|
-
interface PlayerProfile {
|
|
115
|
-
id: string;
|
|
116
|
-
label: string;
|
|
117
|
-
color?: string;
|
|
118
|
-
/** Preset avatar id chosen by the player (platform resolves to artwork). */
|
|
119
|
-
avatarId?: string;
|
|
120
|
-
}
|
|
121
|
-
declare const playerProfilePatchSchema: z.ZodObject<{
|
|
122
|
-
label: z.ZodOptional<z.ZodString>;
|
|
123
|
-
avatarId: z.ZodOptional<z.ZodString>;
|
|
124
|
-
}, z.core.$strict>;
|
|
125
|
-
type PlayerProfilePatch = z.infer<typeof playerProfilePatchSchema>;
|
|
126
|
-
declare const controllerUpdatePlayerProfileSchema: z.ZodObject<{
|
|
127
|
-
roomId: z.ZodString;
|
|
128
|
-
controllerId: z.ZodString;
|
|
129
|
-
patch: z.ZodObject<{
|
|
130
|
-
label: z.ZodOptional<z.ZodString>;
|
|
131
|
-
avatarId: z.ZodOptional<z.ZodString>;
|
|
132
|
-
}, z.core.$strict>;
|
|
133
|
-
}, z.core.$strip>;
|
|
134
|
-
type ControllerUpdatePlayerProfilePayload = z.infer<typeof controllerUpdatePlayerProfileSchema>;
|
|
135
|
-
interface ControllerUpdatePlayerProfileAck {
|
|
136
|
-
ok: boolean;
|
|
137
|
-
message?: string;
|
|
138
|
-
player?: PlayerProfile;
|
|
139
|
-
code?: ErrorCode | string;
|
|
140
|
-
}
|
|
141
|
-
interface ControllerJoinAck {
|
|
142
|
-
ok: boolean;
|
|
143
|
-
controllerId?: string;
|
|
144
|
-
roomId?: RoomCode;
|
|
145
|
-
resumed?: boolean;
|
|
146
|
-
/** Private to the joining client; never publish in presence or bridge state. */
|
|
147
|
-
resumeCapabilityToken?: string;
|
|
148
|
-
message?: string;
|
|
149
|
-
code?: ErrorCode | string;
|
|
150
|
-
retryAfterSeconds?: number;
|
|
151
|
-
}
|
|
152
|
-
declare const controllerPrivilegedGrantSchema: z.ZodEnum<{
|
|
153
|
-
system: "system";
|
|
154
|
-
play_sound: "play_sound";
|
|
155
|
-
action_rpc: "action_rpc";
|
|
156
|
-
}>;
|
|
157
|
-
type ControllerPrivilegedGrant = z.infer<typeof controllerPrivilegedGrantSchema>;
|
|
158
|
-
declare const controllerPrivilegedCapabilitySchema: z.ZodObject<{
|
|
159
|
-
token: z.ZodString;
|
|
160
|
-
expiresAt: z.ZodNumber;
|
|
161
|
-
grants: z.ZodArray<z.ZodEnum<{
|
|
162
|
-
system: "system";
|
|
163
|
-
play_sound: "play_sound";
|
|
164
|
-
action_rpc: "action_rpc";
|
|
165
|
-
}>>;
|
|
166
|
-
}, z.core.$strip>;
|
|
167
|
-
type ControllerPrivilegedCapability = z.infer<typeof controllerPrivilegedCapabilitySchema>;
|
|
168
|
-
interface ControllerSocketAuthority {
|
|
169
|
-
roomId: RoomCode;
|
|
170
|
-
controllerId: string;
|
|
171
|
-
deviceId: string;
|
|
172
|
-
joinedAt: number;
|
|
173
|
-
privilegedGrants: ControllerPrivilegedGrant[];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export { controllerLeaveSchema as A, controllerSystemSchema as B, type ControllerPrivilegedCapability as C, playerProfilePatchSchema as D, ErrorCode as E, controllerUpdatePlayerProfileSchema as F, controllerPrivilegedGrantSchema as G, type ControllerPrivilegedGrant as H, controllerPrivilegedCapabilitySchema as I, type ConnectionRole as J, roomCodeSchema as K, type PlayerProfile as P, type RoomCode as R, type ServerErrorPayload as S, VIRTUAL_CONTROLLER_DEVICE_ID_PREFIX as V, type ControllerSource as a, type ConnectionStatus as b, type RuntimeState as c, type ControllerOrientation as d, type RunMode as e, type ControllerRoomSettingsState as f, type PlayerProfilePatch as g, type ControllerUpdatePlayerProfileAck as h, type ControllerLeaveAck as i, type ControllerStatePayload as j, type ControllerStateMessage as k, type ControllerJoinPayload as l, type ControllerJoinAck as m, type ControllerUpdatePlayerProfilePayload as n, type ControllerLeavePayload as o, type ControllerInputEvent as p, type ControllerSystemPayload as q, type ControllerSocketAuthority as r, controllerInputSchema as s, type ControllerInputPayload as t, controllerOrientationSchema as u, controllerSourceSchema as v, PREVIEW_CONTROLLER_DEVICE_ID_PREFIX as w, inferControllerSourceFromDeviceId as x, controllerStateSchema as y, controllerJoinSchema as z };
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { R as RoomPlatformSettingsSnapshot } from './platform-settings-DUWs4JTy.cjs';
|
|
3
|
-
|
|
4
|
-
type RoomCode = string;
|
|
5
|
-
type ConnectionRole = "host" | "controller";
|
|
6
|
-
type ConnectionStatus = "idle" | "connecting" | "connected" | "disconnected" | "reconnecting";
|
|
7
|
-
type RunMode = "standalone" | "platform";
|
|
8
|
-
type RuntimeState = "paused" | "playing";
|
|
9
|
-
declare const roomCodeSchema: z.ZodString;
|
|
10
|
-
|
|
11
|
-
declare enum ErrorCode {
|
|
12
|
-
ROOM_NOT_FOUND = "ROOM_NOT_FOUND",
|
|
13
|
-
ROOM_FULL = "ROOM_FULL",
|
|
14
|
-
INVALID_APP_ID = "INVALID_APP_ID",
|
|
15
|
-
UNAUTHORIZED = "UNAUTHORIZED",
|
|
16
|
-
INVALID_TOKEN = "INVALID_TOKEN",
|
|
17
|
-
TOKEN_EXPIRED = "TOKEN_EXPIRED",
|
|
18
|
-
CONNECTION_FAILED = "CONNECTION_FAILED",
|
|
19
|
-
ALREADY_CONNECTED = "ALREADY_CONNECTED",
|
|
20
|
-
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
21
|
-
INVALID_ROOM_CODE = "INVALID_ROOM_CODE",
|
|
22
|
-
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
|
|
23
|
-
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
24
|
-
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
25
|
-
}
|
|
26
|
-
interface ServerErrorPayload {
|
|
27
|
-
code: ErrorCode | string;
|
|
28
|
-
message: string;
|
|
29
|
-
details?: unknown;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare const controllerInputSchema: z.ZodObject<{
|
|
33
|
-
roomId: z.ZodString;
|
|
34
|
-
controllerId: z.ZodString;
|
|
35
|
-
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
36
|
-
}, z.core.$strip>;
|
|
37
|
-
type ControllerInputPayload = Record<string, unknown>;
|
|
38
|
-
interface ControllerInputEvent {
|
|
39
|
-
roomId: RoomCode;
|
|
40
|
-
controllerId: string;
|
|
41
|
-
input: ControllerInputPayload;
|
|
42
|
-
}
|
|
43
|
-
declare const controllerOrientationSchema: z.ZodEnum<{
|
|
44
|
-
portrait: "portrait";
|
|
45
|
-
landscape: "landscape";
|
|
46
|
-
}>;
|
|
47
|
-
type ControllerOrientation = z.infer<typeof controllerOrientationSchema>;
|
|
48
|
-
declare const controllerSourceSchema: z.ZodEnum<{
|
|
49
|
-
phone: "phone";
|
|
50
|
-
preview: "preview";
|
|
51
|
-
virtual: "virtual";
|
|
52
|
-
}>;
|
|
53
|
-
type ControllerSource = z.infer<typeof controllerSourceSchema>;
|
|
54
|
-
declare const PREVIEW_CONTROLLER_DEVICE_ID_PREFIX = "pd_";
|
|
55
|
-
declare const VIRTUAL_CONTROLLER_DEVICE_ID_PREFIX = "aj-mcp-device-";
|
|
56
|
-
declare const inferControllerSourceFromDeviceId: (deviceId: string | null | undefined) => ControllerSource;
|
|
57
|
-
declare const controllerStateSchema: z.ZodObject<{
|
|
58
|
-
roomId: z.ZodString;
|
|
59
|
-
state: z.ZodObject<{
|
|
60
|
-
orientation: z.ZodOptional<z.ZodEnum<{
|
|
61
|
-
portrait: "portrait";
|
|
62
|
-
landscape: "landscape";
|
|
63
|
-
}>>;
|
|
64
|
-
message: z.ZodOptional<z.ZodString>;
|
|
65
|
-
roomSettings: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
audio: z.ZodObject<{
|
|
67
|
-
masterVolume: z.ZodNumber;
|
|
68
|
-
musicVolume: z.ZodNumber;
|
|
69
|
-
sfxVolume: z.ZodNumber;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
previewControllers: z.ZodObject<{
|
|
72
|
-
activeOpacity: z.ZodNumber;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
}, z.core.$strip>>;
|
|
75
|
-
runtimeState: z.ZodOptional<z.ZodEnum<{
|
|
76
|
-
paused: "paused";
|
|
77
|
-
playing: "playing";
|
|
78
|
-
}>>;
|
|
79
|
-
stateVersion: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
}, z.core.$strip>;
|
|
82
|
-
type ControllerStateMessage = z.infer<typeof controllerStateSchema>;
|
|
83
|
-
type ControllerStatePayload = z.infer<typeof controllerStateSchema>["state"];
|
|
84
|
-
type ControllerRoomSettingsState = RoomPlatformSettingsSnapshot;
|
|
85
|
-
declare const controllerJoinSchema: z.ZodObject<{
|
|
86
|
-
roomId: z.ZodString;
|
|
87
|
-
controllerId: z.ZodString;
|
|
88
|
-
deviceId: z.ZodOptional<z.ZodString>;
|
|
89
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
90
|
-
avatarId: z.ZodOptional<z.ZodString>;
|
|
91
|
-
capabilityToken: z.ZodOptional<z.ZodString>;
|
|
92
|
-
resumeCapabilityToken: z.ZodOptional<z.ZodString>;
|
|
93
|
-
}, z.core.$strip>;
|
|
94
|
-
type ControllerJoinPayload = z.infer<typeof controllerJoinSchema>;
|
|
95
|
-
declare const controllerLeaveSchema: z.ZodObject<{
|
|
96
|
-
roomId: z.ZodString;
|
|
97
|
-
controllerId: z.ZodString;
|
|
98
|
-
}, z.core.$strip>;
|
|
99
|
-
type ControllerLeavePayload = z.infer<typeof controllerLeaveSchema>;
|
|
100
|
-
interface ControllerLeaveAck {
|
|
101
|
-
ok: boolean;
|
|
102
|
-
message?: string;
|
|
103
|
-
code?: ErrorCode | string;
|
|
104
|
-
}
|
|
105
|
-
declare const controllerSystemSchema: z.ZodObject<{
|
|
106
|
-
roomId: z.ZodString;
|
|
107
|
-
command: z.ZodEnum<{
|
|
108
|
-
exit: "exit";
|
|
109
|
-
pause: "pause";
|
|
110
|
-
resume: "resume";
|
|
111
|
-
}>;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
type ControllerSystemPayload = z.infer<typeof controllerSystemSchema>;
|
|
114
|
-
interface PlayerProfile {
|
|
115
|
-
id: string;
|
|
116
|
-
label: string;
|
|
117
|
-
color?: string;
|
|
118
|
-
/** Preset avatar id chosen by the player (platform resolves to artwork). */
|
|
119
|
-
avatarId?: string;
|
|
120
|
-
}
|
|
121
|
-
declare const playerProfilePatchSchema: z.ZodObject<{
|
|
122
|
-
label: z.ZodOptional<z.ZodString>;
|
|
123
|
-
avatarId: z.ZodOptional<z.ZodString>;
|
|
124
|
-
}, z.core.$strict>;
|
|
125
|
-
type PlayerProfilePatch = z.infer<typeof playerProfilePatchSchema>;
|
|
126
|
-
declare const controllerUpdatePlayerProfileSchema: z.ZodObject<{
|
|
127
|
-
roomId: z.ZodString;
|
|
128
|
-
controllerId: z.ZodString;
|
|
129
|
-
patch: z.ZodObject<{
|
|
130
|
-
label: z.ZodOptional<z.ZodString>;
|
|
131
|
-
avatarId: z.ZodOptional<z.ZodString>;
|
|
132
|
-
}, z.core.$strict>;
|
|
133
|
-
}, z.core.$strip>;
|
|
134
|
-
type ControllerUpdatePlayerProfilePayload = z.infer<typeof controllerUpdatePlayerProfileSchema>;
|
|
135
|
-
interface ControllerUpdatePlayerProfileAck {
|
|
136
|
-
ok: boolean;
|
|
137
|
-
message?: string;
|
|
138
|
-
player?: PlayerProfile;
|
|
139
|
-
code?: ErrorCode | string;
|
|
140
|
-
}
|
|
141
|
-
interface ControllerJoinAck {
|
|
142
|
-
ok: boolean;
|
|
143
|
-
controllerId?: string;
|
|
144
|
-
roomId?: RoomCode;
|
|
145
|
-
resumed?: boolean;
|
|
146
|
-
/** Private to the joining client; never publish in presence or bridge state. */
|
|
147
|
-
resumeCapabilityToken?: string;
|
|
148
|
-
message?: string;
|
|
149
|
-
code?: ErrorCode | string;
|
|
150
|
-
retryAfterSeconds?: number;
|
|
151
|
-
}
|
|
152
|
-
declare const controllerPrivilegedGrantSchema: z.ZodEnum<{
|
|
153
|
-
system: "system";
|
|
154
|
-
play_sound: "play_sound";
|
|
155
|
-
action_rpc: "action_rpc";
|
|
156
|
-
}>;
|
|
157
|
-
type ControllerPrivilegedGrant = z.infer<typeof controllerPrivilegedGrantSchema>;
|
|
158
|
-
declare const controllerPrivilegedCapabilitySchema: z.ZodObject<{
|
|
159
|
-
token: z.ZodString;
|
|
160
|
-
expiresAt: z.ZodNumber;
|
|
161
|
-
grants: z.ZodArray<z.ZodEnum<{
|
|
162
|
-
system: "system";
|
|
163
|
-
play_sound: "play_sound";
|
|
164
|
-
action_rpc: "action_rpc";
|
|
165
|
-
}>>;
|
|
166
|
-
}, z.core.$strip>;
|
|
167
|
-
type ControllerPrivilegedCapability = z.infer<typeof controllerPrivilegedCapabilitySchema>;
|
|
168
|
-
interface ControllerSocketAuthority {
|
|
169
|
-
roomId: RoomCode;
|
|
170
|
-
controllerId: string;
|
|
171
|
-
deviceId: string;
|
|
172
|
-
joinedAt: number;
|
|
173
|
-
privilegedGrants: ControllerPrivilegedGrant[];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export { controllerLeaveSchema as A, controllerSystemSchema as B, type ControllerPrivilegedCapability as C, playerProfilePatchSchema as D, ErrorCode as E, controllerUpdatePlayerProfileSchema as F, controllerPrivilegedGrantSchema as G, type ControllerPrivilegedGrant as H, controllerPrivilegedCapabilitySchema as I, type ConnectionRole as J, roomCodeSchema as K, type PlayerProfile as P, type RoomCode as R, type ServerErrorPayload as S, VIRTUAL_CONTROLLER_DEVICE_ID_PREFIX as V, type ControllerSource as a, type ConnectionStatus as b, type RuntimeState as c, type ControllerOrientation as d, type RunMode as e, type ControllerRoomSettingsState as f, type PlayerProfilePatch as g, type ControllerUpdatePlayerProfileAck as h, type ControllerLeaveAck as i, type ControllerStatePayload as j, type ControllerStateMessage as k, type ControllerJoinPayload as l, type ControllerJoinAck as m, type ControllerUpdatePlayerProfilePayload as n, type ControllerLeavePayload as o, type ControllerInputEvent as p, type ControllerSystemPayload as q, type ControllerSocketAuthority as r, controllerInputSchema as s, type ControllerInputPayload as t, controllerOrientationSchema as u, controllerSourceSchema as v, PREVIEW_CONTROLLER_DEVICE_ID_PREFIX as w, inferControllerSourceFromDeviceId as x, controllerStateSchema as y, controllerJoinSchema as z };
|