@air-jam/cli 1.0.0-beta.1 → 1.0.0-beta.11

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 CHANGED
@@ -1,4 +1,4 @@
1
- > **Prerelease `1.0.0-beta.1`** from Air Jam's `beta` channel. It is not stable and may change or break between prereleases; install `@latest` for the stable release.
1
+ > **Prerelease `1.0.0-beta.11`** from Air Jam's `beta` channel. It is not stable and may change or break between prereleases; install `@latest` for the stable release.
2
2
 
3
3
  # `@air-jam/cli`
4
4
 
@@ -1,6 +1,13 @@
1
1
  export { AIRJAM_PROJECT_MCP_FILE, createProjectLocalMcpConfig } from '@air-jam/devtools/mcp-config';
2
+ import { AirJamHostedEnvironment } from '@air-jam/sdk/core';
2
3
 
3
4
  declare const resolveAirJamManagedAssetsDir: () => string;
4
5
  declare const resolveAirJamBootstrapAssetsDir: () => string;
5
6
 
6
- export { resolveAirJamBootstrapAssetsDir, resolveAirJamManagedAssetsDir };
7
+ /**
8
+ * The hosted Air Jam a new game publishes to: a prerelease scaffolder builds
9
+ * against beta, a release against production.
10
+ */
11
+ declare const resolveScaffoldHostedEnvironment: (createAirJamVersion: string) => AirJamHostedEnvironment;
12
+
13
+ export { resolveAirJamBootstrapAssetsDir, resolveAirJamManagedAssetsDir, resolveScaffoldHostedEnvironment };
package/dist/scaffold.js CHANGED
@@ -3,6 +3,9 @@ import {
3
3
  AIRJAM_PROJECT_MCP_FILE,
4
4
  createProjectLocalMcpConfig
5
5
  } from "@air-jam/devtools/mcp-config";
6
+ import {
7
+ AIR_JAM_HOSTED_ENVIRONMENTS
8
+ } from "@air-jam/sdk/core";
6
9
  import path from "path";
7
10
  import { fileURLToPath } from "url";
8
11
  var packageRoot = path.resolve(
@@ -11,10 +14,12 @@ var packageRoot = path.resolve(
11
14
  );
12
15
  var resolveAirJamManagedAssetsDir = () => path.join(packageRoot, "template-assets", "managed");
13
16
  var resolveAirJamBootstrapAssetsDir = () => path.join(packageRoot, "template-assets", "bootstrap");
17
+ var resolveScaffoldHostedEnvironment = (createAirJamVersion) => AIR_JAM_HOSTED_ENVIRONMENTS[createAirJamVersion.includes("-") ? 1 : 0];
14
18
  export {
15
19
  AIRJAM_PROJECT_MCP_FILE,
16
20
  createProjectLocalMcpConfig,
17
21
  resolveAirJamBootstrapAssetsDir,
18
- resolveAirJamManagedAssetsDir
22
+ resolveAirJamManagedAssetsDir,
23
+ resolveScaffoldHostedEnvironment
19
24
  };
20
25
  //# sourceMappingURL=scaffold.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scaffold.ts"],"sourcesContent":["import {\n AIRJAM_PROJECT_MCP_FILE,\n createProjectLocalMcpConfig,\n} from \"@air-jam/devtools/mcp-config\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst packageRoot = path.resolve(\n path.dirname(fileURLToPath(import.meta.url)),\n \"..\",\n);\n\nexport const resolveAirJamManagedAssetsDir = (): string =>\n path.join(packageRoot, \"template-assets\", \"managed\");\n\nexport const resolveAirJamBootstrapAssetsDir = (): string =>\n path.join(packageRoot, \"template-assets\", \"bootstrap\");\n\nexport { AIRJAM_PROJECT_MCP_FILE, createProjectLocalMcpConfig };\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAE9B,IAAM,cAAc,KAAK;AAAA,EACvB,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAAA,EAC3C;AACF;AAEO,IAAM,gCAAgC,MAC3C,KAAK,KAAK,aAAa,mBAAmB,SAAS;AAE9C,IAAM,kCAAkC,MAC7C,KAAK,KAAK,aAAa,mBAAmB,WAAW;","names":[]}
1
+ {"version":3,"sources":["../src/scaffold.ts"],"sourcesContent":["import {\n AIRJAM_PROJECT_MCP_FILE,\n createProjectLocalMcpConfig,\n} from \"@air-jam/devtools/mcp-config\";\nimport {\n AIR_JAM_HOSTED_ENVIRONMENTS,\n type AirJamHostedEnvironment,\n} from \"@air-jam/sdk/core\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst packageRoot = path.resolve(\n path.dirname(fileURLToPath(import.meta.url)),\n \"..\",\n);\n\nexport const resolveAirJamManagedAssetsDir = (): string =>\n path.join(packageRoot, \"template-assets\", \"managed\");\n\nexport const resolveAirJamBootstrapAssetsDir = (): string =>\n path.join(packageRoot, \"template-assets\", \"bootstrap\");\n\nexport { AIRJAM_PROJECT_MCP_FILE, createProjectLocalMcpConfig };\n\n/**\n * The hosted Air Jam a new game publishes to: a prerelease scaffolder builds\n * against beta, a release against production.\n */\nexport const resolveScaffoldHostedEnvironment = (\n createAirJamVersion: string,\n): AirJamHostedEnvironment =>\n AIR_JAM_HOSTED_ENVIRONMENTS[createAirJamVersion.includes(\"-\") ? 1 : 0];\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AACP,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAE9B,IAAM,cAAc,KAAK;AAAA,EACvB,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAAA,EAC3C;AACF;AAEO,IAAM,gCAAgC,MAC3C,KAAK,KAAK,aAAa,mBAAmB,SAAS;AAE9C,IAAM,kCAAkC,MAC7C,KAAK,KAAK,aAAa,mBAAmB,WAAW;AAQhD,IAAM,mCAAmC,CAC9C,wBAEA,4BAA4B,oBAAoB,SAAS,GAAG,IAAI,IAAI,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@air-jam/cli",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.11",
4
4
  "engines": {
5
5
  "node": ">=22.15.0"
6
6
  },
@@ -59,8 +59,8 @@
59
59
  "template-assets"
60
60
  ],
61
61
  "dependencies": {
62
- "@air-jam/devtools": "1.0.0-beta.1",
63
- "@air-jam/sdk": "^1.0.0-beta.1",
62
+ "@air-jam/devtools": "1.0.0-beta.11",
63
+ "@air-jam/sdk": "^1.0.0-beta.11",
64
64
  "commander": "^14.0.0",
65
65
  "cross-spawn": "^7.0.6",
66
66
  "fs-extra": "^11.3.0",
@@ -58,6 +58,25 @@ The default order is:
58
58
  3. keep rendering integration separate from pure game rules
59
59
  4. use instancing when repeated objects justify it
60
60
 
61
+ ## Loading and the Reveal
62
+
63
+ In the Arcade and the Studio, the page around a game keeps its own cover up
64
+ until the game's host says it is ready, so players never watch a game assemble
65
+ itself. The host is ready once it has mounted, its fonts have loaded and its
66
+ room is connected. Anything still loading after that holds the reveal with
67
+ `<HoldReveal />` from `@air-jam/sdk`:
68
+
69
+ 1. render it in every Suspense fallback on the host, including the route-level
70
+ fallback around a lazy host view: `<Suspense fallback={<HoldReveal />}>`
71
+ 2. put a Suspense boundary with that fallback around R3F content that loads
72
+ models or textures (`useGLTF`, `useTexture`), so the scene appears whole
73
+ 3. render it conditionally for any other loading the host waits on:
74
+ `{!ready && <HoldReveal />}`
75
+
76
+ A fallback can draw its own placeholder and include `<HoldReveal />` inside it.
77
+ The reveal happens once; holding again later changes nothing, and outside a
78
+ host it does nothing.
79
+
61
80
  ## Air Jam Lane Rules
62
81
 
63
82
  Keep the framework lanes separate:
@@ -644,7 +644,7 @@ These exports are gone; use the replacement.
644
644
  | `usePlayers()` | `useAirJamHost((s) => s.players)` |
645
645
  | `isActiveMatchPhase`, `isEndedMatchPhase`, `isStandardMatchPhase`, `standardMatchPhases` | compare the phase directly; `toShellMatchPhase` stays |
646
646
  | `AirJamErrorBoundary`, `PlatformSettingsBoundary` | nothing: `createAirJamApp` and the session runtimes mount both |
647
- | `getEffectiveAudioVolume`, `useAudioCategoryVolume`, `mergeRoomPlatformSettingsSnapshot` | `useMusicVolume`, `usePlatformAudioSettings` |
647
+ | `getEffectiveAudioVolume`, `useAudioCategoryVolume`, `mergeRoomPlatformSettingsSnapshot` | `useMusicVolume`, `useAirJamSurfaceSettings` |
648
648
  | `parseAirJamGameMetadata` | `airJamGameMetadataSchema.safeParse` |
649
649
  | `RoomCode`, `RunMode`, `SignalPayload`, `SignalType`, `ControllerStatePayload`, `ControllerUpdatePlayerProfileAck`, `AirJamActionAccepted`, `AirJamActionRejected` from `@air-jam/sdk` | the same types from `@air-jam/sdk/protocol` |
650
650
  | `isInternalActionName`, `resolveControllerJoinSource`, `JoinUrlStatus` from `@air-jam/sdk/core` | internal; `JoinUrlStatus` comes from `@air-jam/sdk` |
@@ -231,6 +231,20 @@ const playerCount = host.players.length;
231
231
  const player = host.players.find((p) => p.id === targetId);
232
232
  ```
233
233
 
234
+ ### Player Colours
235
+
236
+ Each player starts with a colour the room picks. When the game decides a
237
+ player's colour (a team, a stand, a car), it says so, and every device shows
238
+ the player that way: the screen's player bar and controller windows, the
239
+ player's own phone, and `player.color` in the game and its controllers.
240
+
241
+ ```tsx
242
+ host.setPlayerColor(playerId, team === "red" ? "#ef4444" : "#3b82f6");
243
+ ```
244
+
245
+ Colours are hex, `#rrggbb`. Draw players from `player.color` so the game
246
+ and Air Jam never disagree.
247
+
234
248
  ## Controller Presentation State
235
249
 
236
250
  The host publishes a small presentation for the phones: whether the game is
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.0.0-beta.1",
3
+ "packageVersion": "1.0.0-beta.11",
4
4
  "requiredComponents": [
5
5
  "ArcadeModeDiagram",
6
6
  "Callout",
@@ -160,7 +160,7 @@
160
160
  "lastVerifiedVersion": "1.0.0"
161
161
  },
162
162
  "size": 31449,
163
- "sha256": "0f628c675d9e97c99fab83e7f6c18eb463ec7b119be3ebb10b96f49a7516cc9b"
163
+ "sha256": "d0119901e5fb76ecb7025b5545f85b92799c88a95a2ed1e653469aa652d4204e"
164
164
  },
165
165
  {
166
166
  "source": "how-it-works/architecture/page.mdx",
@@ -209,8 +209,8 @@
209
209
  "sinceVersion": "1.0.0",
210
210
  "lastVerifiedVersion": "1.0.0"
211
211
  },
212
- "size": 9900,
213
- "sha256": "e1614e20cae976801f62b4b3bb0d32cde7bbeaadf2c85d37003119ba24247399"
212
+ "size": 10401,
213
+ "sha256": "e208ed62879f97019532dac7a114fdb6228c423e31119ef7abac999ad3eb21e6"
214
214
  },
215
215
  {
216
216
  "source": "sdk/hooks/page.mdx",
@@ -235,8 +235,8 @@
235
235
  "sinceVersion": "1.0.0",
236
236
  "lastVerifiedVersion": "1.0.0"
237
237
  },
238
- "size": 16071,
239
- "sha256": "c51772e56a8bb7c0de86abfd168f9ac8999ebfe8135845e14a5eeedd848d6620"
238
+ "size": 16164,
239
+ "sha256": "5e0aab6853856002d20e4048eaffb8da79388ed67d6314551f95ac066b02f4e3"
240
240
  },
241
241
  {
242
242
  "source": "sdk/ui-components/page.mdx",
@@ -263,8 +263,8 @@
263
263
  "sinceVersion": "1.0.0",
264
264
  "lastVerifiedVersion": "1.0.0"
265
265
  },
266
- "size": 7067,
267
- "sha256": "5b37d507cedb61ca4dbeaa058e908efb3423a1cce9a69e4d9252c27bb167ab3a"
266
+ "size": 6558,
267
+ "sha256": "753ad280b852bef1f6b883c4b11039fe32529f5b982bc26f61f91a85d139c079"
268
268
  },
269
269
  {
270
270
  "source": "sdk/input-system/page.mdx",
@@ -418,8 +418,8 @@
418
418
  "sinceVersion": "1.0.0",
419
419
  "lastVerifiedVersion": "1.0.0"
420
420
  },
421
- "size": 2990,
422
- "sha256": "5157e30df164ec5bc9c0d23dc6877711be7117075f844ce7643ae853cb0ca73b"
421
+ "size": 3950,
422
+ "sha256": "df3d2b8954b8dbb5683a734dbcf7aac6318f3e5495269ab9e6ad109203ec3e0d"
423
423
  },
424
424
  {
425
425
  "source": "for-agents/supported-agents/page.mdx",
@@ -468,8 +468,8 @@
468
468
  "sinceVersion": "1.0.0",
469
469
  "lastVerifiedVersion": "1.0.0"
470
470
  },
471
- "size": 6232,
472
- "sha256": "fc775f90ade332234211a9009b00c543b02b0b63a60414000588ae73e14a3a8f"
471
+ "size": 6819,
472
+ "sha256": "e4184871a36717a96d4558eebcf7e07ea8dd5bd6cafc8e7cfa2e6ef155f5c8fd"
473
473
  },
474
474
  {
475
475
  "source": "sdk/assets-and-theme/page.mdx",
@@ -89,7 +89,8 @@ const HostView = () => {
89
89
  // Return values
90
90
  const {
91
91
  roomId, // "ABCD" - The room code
92
- joinUrl, // Full URL for controllers to join
92
+ joinUrl, // Phone join URL; empty when topology has no phone reach
93
+ localControllerUrl, // On-screen controllers on this computer only
93
94
  joinUrlStatus, // "loading" | "ready" | "unavailable"
94
95
  connectionStatus, // "connected" | "connecting" | "reconnecting" | "disconnected" | "idle"
95
96
  players, // Array of AirJamPlayer, including phones that are away
@@ -25,7 +25,9 @@ export const pongSettings = defineAirJamSettings({
25
25
  max: 720,
26
26
  step: 10,
27
27
  live: true,
28
- description: "Ball speed in pixels per second.",
28
+ label: "Ball speed",
29
+ unit: "px/s",
30
+ description: "How fast the ball crosses the court.",
29
31
  }),
30
32
  });
31
33
  export type PongSettings = AirJamSettingsValues<typeof pongSettings>;
@@ -40,7 +42,16 @@ Keys are lower camel case. `setting.number` requires `default`, `min` and
40
42
  Steps are multiples of zero. `setting.boolean` requires a boolean `default`.
41
43
  `setting.choice` takes a nonempty string tuple in `options` and a `default`
42
44
  from that tuple; its value type is the union of those strings.
43
- Every kind accepts `description` and `live`, which defaults to false.
45
+ Every kind accepts `label`, `description` and `live`, which defaults to false;
46
+ numbers also accept a `unit` shown after the value.
47
+
48
+ The Air Jam platform draws every declared setting in its settings dialog under
49
+ the game's name, on the big screen and on phones, with no settings code in the
50
+ game: a switch for a boolean, segments for a few choices or steps, and a slider
51
+ with its value for a range. A setting that is not `live` waits for the game to
52
+ restart. The screen remembers the values per game and launches the game with
53
+ them next time; a remembered value the game no longer accepts reads as its
54
+ default.
44
55
  `defineAirJamSettings` validates defaults immediately. The description returned
45
56
  by `airjam.inspect_game` includes these descriptors in `declaration.settings`.
46
57
 
@@ -7,7 +7,6 @@ import {
7
7
  SurfaceViewport,
8
8
  PlayerAvatar,
9
9
  RoomQrCode,
10
- VolumeControls,
11
10
  Button,
12
11
  Slider,
13
12
  } from "@air-jam/sdk/ui";
@@ -17,7 +16,7 @@ import {
17
16
 
18
17
  ### `RoomQrCode`
19
18
 
20
- Render a room join QR code from any URL string.
19
+ Render a phone join QR code from `host.joinUrl`. An absent or loopback URL shows a short explanation instead of a QR code.
21
20
 
22
21
  ```tsx
23
22
  import { RoomQrCode } from "@air-jam/sdk/ui";
@@ -26,10 +25,6 @@ import { useAirJamHost } from "@air-jam/sdk";
26
25
  const LobbyQr = () => {
27
26
  const host = useAirJamHost();
28
27
 
29
- if (host.joinUrlStatus !== "ready") {
30
- return null;
31
- }
32
-
33
28
  return (
34
29
  <RoomQrCode
35
30
  value={host.joinUrl}
@@ -41,11 +36,11 @@ const LobbyQr = () => {
41
36
  };
42
37
  ```
43
38
 
44
- If you are rendering before the join URL has been resolved, prefer gating with `host.joinUrlStatus === "ready"` and show your own loading state until then.
39
+ You can show your own loading state while `host.joinUrlStatus === "loading"`. Pass the unavailable value through to `RoomQrCode` so it can explain why phones cannot join.
45
40
 
46
41
  Props:
47
42
 
48
- - `value: string` (required)
43
+ - `value: string | null | undefined` (required)
49
44
  - `size?: number` default `180`
50
45
  - `padding?: number` default `1`
51
46
  - `foregroundColor?: string` default `#111111`
@@ -137,31 +132,6 @@ Avoid:
137
132
 
138
133
  ---
139
134
 
140
- ### `VolumeControls`
141
-
142
- Ready-made control block for master/music/sfx sliders bound to the shared platform settings runtime.
143
-
144
- ```tsx
145
- import { VolumeControls } from "@air-jam/sdk/ui";
146
-
147
- <VolumeControls className="w-full max-w-xs" compact />;
148
- ```
149
-
150
- Mount it below `PlatformSettingsRuntime` when you want slider changes to persist in Arcade and inherit into embedded games.
151
-
152
- Props:
153
-
154
- - `className?: string`
155
- - `compact?: boolean`
156
-
157
- Use it for:
158
-
159
- - in-game settings overlays
160
- - pause/settings drawers
161
- - Arcade- or platform-owned settings panels
162
-
163
- ---
164
-
165
135
  ## Phone Controls
166
136
 
167
137
  `ControlButton`, `AxisButton` and `Stick` bind phone UI to the game's declared
@@ -33,8 +33,8 @@
33
33
  {
34
34
  "path": "docs/airjam/composition-shell-contract.md",
35
35
  "kind": "docs-local",
36
- "size": 2666,
37
- "sha256": "91bf49cb98f3b94cabd145d960a9562786e73c029b3955904ef45a8f8bf71a06"
36
+ "size": 2891,
37
+ "sha256": "b67412d3fb3563ea3b20fc32fceaaa25759752b611fe05864c1b938eec4d23cc"
38
38
  },
39
39
  {
40
40
  "path": "docs/airjam/debug-and-testing.md",
@@ -93,8 +93,8 @@
93
93
  {
94
94
  "path": "docs/airjam/generated/host-system.md",
95
95
  "kind": "docs-generated",
96
- "size": 9945,
97
- "sha256": "c85a8d05570fbc71cbd7cf5771e75a2f8415b4eb034462a45c30db3ca97ced31"
96
+ "size": 10446,
97
+ "sha256": "aeb22ddc9e296f2035bb5a7de1cc9cb91a2d77b178e11eb4b311b4b12b7dfae7"
98
98
  },
99
99
  {
100
100
  "path": "docs/airjam/generated/input-system.md",
@@ -112,7 +112,7 @@
112
112
  "path": "docs/airjam/generated/migrating-legacy-games.md",
113
113
  "kind": "docs-generated",
114
114
  "size": 31510,
115
- "sha256": "63b66676c7578d37635e542f45149cd67dcc42229c1bf9364280ae76583586ec"
115
+ "sha256": "372390766ea2b59606bbc1d727b2a115aaa9e3c3c232cf9d588b69e7abdfb7ed"
116
116
  },
117
117
  {
118
118
  "path": "docs/airjam/generated/networked-state.md",
@@ -135,20 +135,20 @@
135
135
  {
136
136
  "path": "docs/airjam/generated/sdk-hooks.md",
137
137
  "kind": "docs-generated",
138
- "size": 16136,
139
- "sha256": "d1182705433599ab958619c1c6607bf2cd353184fb14e715042589d7ad9c9358"
138
+ "size": 16229,
139
+ "sha256": "275112a40a608a51588158931d9fb9b2496001ff4ba3b822d99f40ab0daa6bfb"
140
140
  },
141
141
  {
142
142
  "path": "docs/airjam/generated/settings.md",
143
143
  "kind": "docs-generated",
144
- "size": 6382,
145
- "sha256": "7bc2d29c42826085640a503601d6a2b42c9b2c7bdfc38908d58cd82b1ccf5c47"
144
+ "size": 6969,
145
+ "sha256": "4efa779c48aa0701be630bb71a6bce1703525b670e84d0344c3c6376ceca9009"
146
146
  },
147
147
  {
148
148
  "path": "docs/airjam/generated/state-and-rendering.md",
149
149
  "kind": "docs-generated",
150
- "size": 3176,
151
- "sha256": "c9e52a44c5f865db217a5bb538d0ee64b82ef342c78bc85acc830c488e3c8198"
150
+ "size": 4136,
151
+ "sha256": "d62521b4bab84c3292b780255b72ab559fcdd7652ef431909e71db72d7735bf0"
152
152
  },
153
153
  {
154
154
  "path": "docs/airjam/generated/supported-agents.md",
@@ -159,8 +159,8 @@
159
159
  {
160
160
  "path": "docs/airjam/generated/ui-components.md",
161
161
  "kind": "docs-generated",
162
- "size": 7169,
163
- "sha256": "87a6e133af6d6ea32b09edd8a731293c4dd99fcbbe8b42c5a6bb79eaa9cdf9f1"
162
+ "size": 6660,
163
+ "sha256": "deb0b2a40901dd29e40bd8c7aa6bbf8e447e09385b84e476cce098e5ce1c5cfc"
164
164
  },
165
165
  {
166
166
  "path": "docs/airjam/generated/unified-dev-logs.md",
@@ -183,8 +183,8 @@
183
183
  {
184
184
  "path": "docs/airjam/preview-controllers.md",
185
185
  "kind": "docs-local",
186
- "size": 4813,
187
- "sha256": "0844ba6b2ebd62250affeae6f3b1c6eabb439d1a8f77145916705b45198f0d16"
186
+ "size": 4812,
187
+ "sha256": "24f60c5fd41d25b12cdcef99d64a995b89e4266ee6b4378d56a8057e9386b5bc"
188
188
  },
189
189
  {
190
190
  "path": "docs/airjam/r3f-3d-scene.md",
@@ -205,5 +205,5 @@
205
205
  "sha256": "0eaa064c38b4568c200fbf5cadb96f16c7c738a29469c4c955fb1ac5f8077edf"
206
206
  }
207
207
  ],
208
- "contentDigest": "3805c938cca3e8cbdbe75dbe6262703bcc69a34fcfc7f14238a12de06f4be19b"
208
+ "contentDigest": "1b94bd0d23a2f150549248c3071031a4be52d8c5f4213e39d7fcda0363abc63a"
209
209
  }
@@ -19,6 +19,10 @@ The host lobby should expose:
19
19
  5. open join URL action
20
20
  6. primary start/play action
21
21
 
22
+ `JoinUrlField`, `JoinUrlControls` and `JoinQrOverlay` take `status={host.joinUrlStatus}`.
23
+ Keep the neutral loading state until phone reach resolves. When it is unavailable,
24
+ show the SDK explanation without an address or QR.
25
+
22
26
  The theme, layout, typography, and art direction stay game-owned.
23
27
 
24
28
  ## Required Controller Contract
@@ -222,6 +222,20 @@ const playerCount = host.players.length;
222
222
  const player = host.players.find((p) => p.id === targetId);
223
223
  ```
224
224
 
225
+ ### Player Colours
226
+
227
+ Each player starts with a colour the room picks. When the game decides a
228
+ player's colour (a team, a stand, a car), it says so, and every device shows
229
+ the player that way: the screen's player bar and controller windows, the
230
+ player's own phone, and `player.color` in the game and its controllers.
231
+
232
+ ```tsx
233
+ host.setPlayerColor(playerId, team === "red" ? "#ef4444" : "#3b82f6");
234
+ ```
235
+
236
+ Colours are hex, `#rrggbb`. Draw players from `player.color` so the game
237
+ and Air Jam never disagree.
238
+
225
239
  ## Controller Presentation State
226
240
 
227
241
  The host publishes a small presentation for the phones: whether the game is
@@ -645,7 +645,7 @@ These exports are gone; use the replacement.
645
645
  | `usePlayers()` | `useAirJamHost((s) => s.players)` |
646
646
  | `isActiveMatchPhase`, `isEndedMatchPhase`, `isStandardMatchPhase`, `standardMatchPhases` | compare the phase directly; `toShellMatchPhase` stays |
647
647
  | `AirJamErrorBoundary`, `PlatformSettingsBoundary` | nothing: `createAirJamApp` and the session runtimes mount both |
648
- | `getEffectiveAudioVolume`, `useAudioCategoryVolume`, `mergeRoomPlatformSettingsSnapshot` | `useMusicVolume`, `usePlatformAudioSettings` |
648
+ | `getEffectiveAudioVolume`, `useAudioCategoryVolume`, `mergeRoomPlatformSettingsSnapshot` | `useMusicVolume`, `useAirJamSurfaceSettings` |
649
649
  | `parseAirJamGameMetadata` | `airJamGameMetadataSchema.safeParse` |
650
650
  | `RoomCode`, `RunMode`, `SignalPayload`, `SignalType`, `ControllerStatePayload`, `ControllerUpdatePlayerProfileAck`, `AirJamActionAccepted`, `AirJamActionRejected` from `@air-jam/sdk` | the same types from `@air-jam/sdk/protocol` |
651
651
  | `isInternalActionName`, `resolveControllerJoinSource`, `JoinUrlStatus` from `@air-jam/sdk/core` | internal; `JoinUrlStatus` comes from `@air-jam/sdk` |
@@ -88,7 +88,8 @@ const HostView = () => {
88
88
  // Return values
89
89
  const {
90
90
  roomId, // "ABCD" - The room code
91
- joinUrl, // Full URL for controllers to join
91
+ joinUrl, // Phone join URL; empty when topology has no phone reach
92
+ localControllerUrl, // On-screen controllers on this computer only
92
93
  joinUrlStatus, // "loading" | "ready" | "unavailable"
93
94
  connectionStatus, // "connected" | "connecting" | "reconnecting" | "disconnected" | "idle"
94
95
  players, // Array of AirJamPlayer, including phones that are away
@@ -28,7 +28,9 @@ export const pongSettings = defineAirJamSettings({
28
28
  max: 720,
29
29
  step: 10,
30
30
  live: true,
31
- description: "Ball speed in pixels per second.",
31
+ label: "Ball speed",
32
+ unit: "px/s",
33
+ description: "How fast the ball crosses the court.",
32
34
  }),
33
35
  });
34
36
  export type PongSettings = AirJamSettingsValues<typeof pongSettings>;
@@ -43,7 +45,16 @@ Keys are lower camel case. `setting.number` requires `default`, `min` and
43
45
  Steps are multiples of zero. `setting.boolean` requires a boolean `default`.
44
46
  `setting.choice` takes a nonempty string tuple in `options` and a `default`
45
47
  from that tuple; its value type is the union of those strings.
46
- Every kind accepts `description` and `live`, which defaults to false.
48
+ Every kind accepts `label`, `description` and `live`, which defaults to false;
49
+ numbers also accept a `unit` shown after the value.
50
+
51
+ The Air Jam platform draws every declared setting in its settings dialog under
52
+ the game's name, on the big screen and on phones, with no settings code in the
53
+ game: a switch for a boolean, segments for a few choices or steps, and a slider
54
+ with its value for a range. A setting that is not `live` waits for the game to
55
+ restart. The screen remembers the values per game and launches the game with
56
+ them next time; a remembered value the game no longer accepts reads as its
57
+ default.
47
58
  `defineAirJamSettings` validates defaults immediately. The description returned
48
59
  by `airjam.inspect_game` includes these descriptors in `declaration.settings`.
49
60
 
@@ -61,6 +61,25 @@ The default order is:
61
61
  3. keep rendering integration separate from pure game rules
62
62
  4. use instancing when repeated objects justify it
63
63
 
64
+ ## Loading and the Reveal
65
+
66
+ In the Arcade and the Studio, the page around a game keeps its own cover up
67
+ until the game's host says it is ready, so players never watch a game assemble
68
+ itself. The host is ready once it has mounted, its fonts have loaded and its
69
+ room is connected. Anything still loading after that holds the reveal with
70
+ `<HoldReveal />` from `@air-jam/sdk`:
71
+
72
+ 1. render it in every Suspense fallback on the host, including the route-level
73
+ fallback around a lazy host view: `<Suspense fallback={<HoldReveal />}>`
74
+ 2. put a Suspense boundary with that fallback around R3F content that loads
75
+ models or textures (`useGLTF`, `useTexture`), so the scene appears whole
76
+ 3. render it conditionally for any other loading the host waits on:
77
+ `{!ready && <HoldReveal />}`
78
+
79
+ A fallback can draw its own placeholder and include `<HoldReveal />` inside it.
80
+ The reveal happens once; holding again later changes nothing, and outside a
81
+ host it does nothing.
82
+
64
83
  ## Air Jam Lane Rules
65
84
 
66
85
  Keep the framework lanes separate:
@@ -10,7 +10,6 @@ import {
10
10
  SurfaceViewport,
11
11
  PlayerAvatar,
12
12
  RoomQrCode,
13
- VolumeControls,
14
13
  Button,
15
14
  Slider,
16
15
  } from "@air-jam/sdk/ui";
@@ -18,7 +17,7 @@ import {
18
17
 
19
18
  ### `RoomQrCode`
20
19
 
21
- Render a room join QR code from any URL string.
20
+ Render a phone join QR code from `host.joinUrl`. An absent or loopback URL shows a short explanation instead of a QR code.
22
21
 
23
22
  ```tsx
24
23
  import { RoomQrCode } from "@air-jam/sdk/ui";
@@ -27,10 +26,6 @@ import { useAirJamHost } from "@air-jam/sdk";
27
26
  const LobbyQr = () => {
28
27
  const host = useAirJamHost();
29
28
 
30
- if (host.joinUrlStatus !== "ready") {
31
- return null;
32
- }
33
-
34
29
  return (
35
30
  <RoomQrCode
36
31
  value={host.joinUrl}
@@ -42,11 +37,11 @@ const LobbyQr = () => {
42
37
  };
43
38
  ```
44
39
 
45
- If you are rendering before the join URL has been resolved, prefer gating with `host.joinUrlStatus === "ready"` and show your own loading state until then.
40
+ You can show your own loading state while `host.joinUrlStatus === "loading"`. Pass the unavailable value through to `RoomQrCode` so it can explain why phones cannot join.
46
41
 
47
42
  Props:
48
43
 
49
- - `value: string` (required)
44
+ - `value: string | null | undefined` (required)
50
45
  - `size?: number` default `180`
51
46
  - `padding?: number` default `1`
52
47
  - `foregroundColor?: string` default `#111111`
@@ -138,31 +133,6 @@ Avoid:
138
133
 
139
134
  ---
140
135
 
141
- ### `VolumeControls`
142
-
143
- Ready-made control block for master/music/sfx sliders bound to the shared platform settings runtime.
144
-
145
- ```tsx
146
- import { VolumeControls } from "@air-jam/sdk/ui";
147
-
148
- <VolumeControls className="w-full max-w-xs" compact />;
149
- ```
150
-
151
- Mount it below `PlatformSettingsRuntime` when you want slider changes to persist in Arcade and inherit into embedded games.
152
-
153
- Props:
154
-
155
- - `className?: string`
156
- - `compact?: boolean`
157
-
158
- Use it for:
159
-
160
- - in-game settings overlays
161
- - pause/settings drawers
162
- - Arcade- or platform-owned settings panels
163
-
164
- ---
165
-
166
136
  ## Phone Controls
167
137
 
168
138
  `ControlButton`, `AxisButton` and `Stick` bind phone UI to the game's declared
@@ -75,7 +75,7 @@ The preview workspace supports:
75
75
  4. minimize and close controls
76
76
  5. per-window portrait or landscape rotation from the title bar for games without joystick input
77
77
 
78
- 6. shared active-opacity control for preview windows through platform settings
78
+ 6. active-window opacity from the room's on-screen controller opacity setting
79
79
  7. a room controller roster with source-aware `Kick` controls for manual local recovery
80
80
  8. a `Reset room` escape hatch that creates a fresh empty room and reloads the local host page so gameplay state and controller state both reset cleanly
81
81