@air-jam/cli 0.0.0-stage → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -2
  3. package/bin/airjam.mjs +66 -0
  4. package/dist/ai-pack.d.ts +44 -0
  5. package/dist/ai-pack.js +15 -0
  6. package/dist/ai-pack.js.map +1 -0
  7. package/dist/chunk-A4V2N4LX.js +938 -0
  8. package/dist/chunk-A4V2N4LX.js.map +1 -0
  9. package/dist/chunk-J5MAU4QZ.js +102 -0
  10. package/dist/chunk-J5MAU4QZ.js.map +1 -0
  11. package/dist/chunk-N7AI7HZK.js +529 -0
  12. package/dist/chunk-N7AI7HZK.js.map +1 -0
  13. package/dist/development.d.ts +98 -0
  14. package/dist/development.js +33 -0
  15. package/dist/development.js.map +1 -0
  16. package/dist/documentation.d.ts +27 -0
  17. package/dist/documentation.js +7 -0
  18. package/dist/documentation.js.map +1 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +2184 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/scaffold.d.ts +6 -0
  23. package/dist/scaffold.js +20 -0
  24. package/dist/scaffold.js.map +1 -0
  25. package/package.json +78 -3
  26. package/runtime/local-network.d.mts +8 -0
  27. package/runtime/local-network.mjs +9 -0
  28. package/runtime/vite-config.d.mts +42 -0
  29. package/runtime/vite-config.mjs +130 -0
  30. package/runtime/vite-https.d.mts +11 -0
  31. package/runtime/vite-https.mjs +41 -0
  32. package/template-assets/bootstrap/.claude/launch.json +12 -0
  33. package/template-assets/bootstrap/AGENTS.md +248 -0
  34. package/template-assets/bootstrap/CLAUDE.md +63 -0
  35. package/template-assets/bootstrap/_gitignore +6 -0
  36. package/template-assets/bootstrap/skills/airjam-docs-workflow/SKILL.md +49 -0
  37. package/template-assets/bootstrap/skills/airjam-mcp/SKILL.md +56 -0
  38. package/template-assets/bootstrap/skills/canvas-2d-gameplay/SKILL.md +47 -0
  39. package/template-assets/bootstrap/skills/controller-ui/SKILL.md +69 -0
  40. package/template-assets/bootstrap/skills/debug-and-test/SKILL.md +72 -0
  41. package/template-assets/bootstrap/skills/game-architecture/SKILL.md +58 -0
  42. package/template-assets/bootstrap/skills/game-state-and-rendering/SKILL.md +44 -0
  43. package/template-assets/bootstrap/skills/host-surface/SKILL.md +52 -0
  44. package/template-assets/bootstrap/skills/index.md +36 -0
  45. package/template-assets/bootstrap/skills/prefab-authoring/SKILL.md +48 -0
  46. package/template-assets/bootstrap/skills/r3f-3d-scene/SKILL.md +51 -0
  47. package/template-assets/documentation/for-agents/controller-ui/page.mdx +60 -0
  48. package/template-assets/documentation/for-agents/page.mdx +98 -0
  49. package/template-assets/documentation/for-agents/project-structure/page.mdx +172 -0
  50. package/template-assets/documentation/for-agents/state-and-rendering/page.mdx +79 -0
  51. package/template-assets/documentation/getting-started/debugging/page.mdx +165 -0
  52. package/template-assets/documentation/getting-started/dev-logs/page.mdx +171 -0
  53. package/template-assets/documentation/getting-started/game-ideas/page.mdx +116 -0
  54. package/template-assets/documentation/getting-started/introduction/page.mdx +183 -0
  55. package/template-assets/documentation/getting-started/migrating-legacy-games/page.mdx +427 -0
  56. package/template-assets/documentation/getting-started/quick-start/page.mdx +333 -0
  57. package/template-assets/documentation/how-it-works/architecture/page.mdx +189 -0
  58. package/template-assets/documentation/how-it-works/host-system/page.mdx +267 -0
  59. package/template-assets/documentation/manifest.json +430 -0
  60. package/template-assets/documentation/sdk/hooks/page.mdx +500 -0
  61. package/template-assets/documentation/sdk/input-system/page.mdx +270 -0
  62. package/template-assets/documentation/sdk/networked-state/page.mdx +213 -0
  63. package/template-assets/documentation/sdk/ui-components/page.mdx +227 -0
  64. package/template-assets/managed/.airjam/ai-pack.json +191 -0
  65. package/template-assets/managed/docs/airjam/agent-gold-path.md +67 -0
  66. package/template-assets/managed/docs/airjam/agent-mcp.md +135 -0
  67. package/template-assets/managed/docs/airjam/canvas-2d-gameplay.md +82 -0
  68. package/template-assets/managed/docs/airjam/composition-shell-contract.md +87 -0
  69. package/template-assets/managed/docs/airjam/debug-and-testing.md +86 -0
  70. package/template-assets/managed/docs/airjam/development-loop.md +51 -0
  71. package/template-assets/managed/docs/airjam/docs-index.md +58 -0
  72. package/template-assets/managed/docs/airjam/generated/architecture.md +178 -0
  73. package/template-assets/managed/docs/airjam/generated/controller-ui.md +61 -0
  74. package/template-assets/managed/docs/airjam/generated/debugging-and-logs.md +164 -0
  75. package/template-assets/managed/docs/airjam/generated/for-agents.md +99 -0
  76. package/template-assets/managed/docs/airjam/generated/game-ideas.md +107 -0
  77. package/template-assets/managed/docs/airjam/generated/host-system.md +251 -0
  78. package/template-assets/managed/docs/airjam/generated/input-system.md +260 -0
  79. package/template-assets/managed/docs/airjam/generated/introduction.md +175 -0
  80. package/template-assets/managed/docs/airjam/generated/migrating-legacy-games.md +426 -0
  81. package/template-assets/managed/docs/airjam/generated/networked-state.md +214 -0
  82. package/template-assets/managed/docs/airjam/generated/project-structure.md +171 -0
  83. package/template-assets/managed/docs/airjam/generated/quick-start.md +334 -0
  84. package/template-assets/managed/docs/airjam/generated/sdk-hooks.md +490 -0
  85. package/template-assets/managed/docs/airjam/generated/state-and-rendering.md +80 -0
  86. package/template-assets/managed/docs/airjam/generated/ui-components.md +222 -0
  87. package/template-assets/managed/docs/airjam/generated/unified-dev-logs.md +170 -0
  88. package/template-assets/managed/docs/airjam/iconography.md +55 -0
  89. package/template-assets/managed/docs/airjam/prefab-authoring.md +112 -0
  90. package/template-assets/managed/docs/airjam/preview-controllers.md +126 -0
  91. package/template-assets/managed/docs/airjam/r3f-3d-scene.md +97 -0
  92. package/template-assets/managed/docs/airjam/state-lanes-cookbook.md +106 -0
  93. package/template-assets/managed/docs/airjam/visual-system.md +103 -0
@@ -0,0 +1,172 @@
1
+
2
+
3
+ # Project Structure
4
+
5
+ Air Jam games should not grow as one large React surface.
6
+
7
+ The clean default is a boundary-first structure where host logic, controller logic, pure game rules, and framework integration do not collapse into the same modules.
8
+
9
+ ## Framework Recommendation
10
+
11
+ Move toward a structure like this:
12
+
13
+ ```text
14
+ src/
15
+ host/
16
+ controller/
17
+ game/
18
+ domain/
19
+ engine/
20
+ systems/
21
+ adapters/
22
+ ui/
23
+ debug/
24
+ shared/
25
+ ```
26
+
27
+ The exact folder names can vary slightly, but the boundaries should stay clear.
28
+
29
+ This is a framework-level recommendation about ownership boundaries, not a requirement that every Air Jam game use the exact same filenames.
30
+
31
+ ## Boundary Rules
32
+
33
+ ### `src/host/`
34
+
35
+ Owns host-only composition and shell behavior.
36
+
37
+ Examples:
38
+
39
+ 1. host screens
40
+ 2. room and join presentation
41
+ 3. host-facing overlays
42
+ 4. host runtime composition
43
+
44
+ ### `src/controller/`
45
+
46
+ Owns controller-only composition and touch interactions.
47
+
48
+ Examples:
49
+
50
+ 1. lobby controls
51
+ 2. gameplay controls
52
+ 3. controller status surfaces
53
+ 4. controller-specific UI hooks
54
+
55
+ ### `src/game/domain/`
56
+
57
+ Owns pure gameplay rules, math, and types.
58
+
59
+ Examples:
60
+
61
+ 1. score rules
62
+ 2. win conditions
63
+ 3. team assignment helpers
64
+ 4. deterministic state transitions
65
+
66
+ This layer should stay testable without React or rendering.
67
+
68
+ ### `src/game/engine/`
69
+
70
+ Owns runtime orchestration.
71
+
72
+ Examples:
73
+
74
+ 1. ticking
75
+ 2. lifecycle transitions
76
+ 3. update ordering
77
+ 4. system composition
78
+
79
+ ### `src/game/systems/`
80
+
81
+ Owns focused gameplay systems when the game has enough scope to justify them.
82
+
83
+ Examples:
84
+
85
+ 1. spawning
86
+ 2. combat
87
+ 3. pickups
88
+ 4. abilities
89
+ 5. scoring
90
+
91
+ ### `src/game/adapters/`
92
+
93
+ Owns integration with frameworks and runtime services.
94
+
95
+ Examples:
96
+
97
+ 1. Air Jam SDK integration
98
+ 2. R3F integration
99
+ 3. physics integration
100
+ 4. audio integration
101
+ 5. network and runtime bridges
102
+
103
+ Keep adapters thin. They should connect systems, not become the real game model.
104
+
105
+ ### `src/game/ui/`
106
+
107
+ Owns reusable game-facing UI modules.
108
+
109
+ Examples:
110
+
111
+ 1. score displays
112
+ 2. status strips
113
+ 3. overlays
114
+ 4. icon wrappers
115
+
116
+ ### `tests/`
117
+
118
+ Owns behavior-focused validation for the boundaries above.
119
+
120
+ Examples:
121
+
122
+ 1. `tests/game/domain/` for pure rule tests
123
+ 2. `tests/game/stores/` for pure state-transition tests
124
+ 3. `tests/game/engine/` for focused runtime helper tests
125
+ 4. `tests/game/adapters/` for transport-facing mapping and boundary tests
126
+ 5. `tests/game/ui/` for shared game-facing UI primitives that can be validated without full app shells
127
+
128
+ ## Starter Template Reference
129
+
130
+ The starter Pong template is the current best starter implementation of those boundaries.
131
+
132
+ It is a recommended reference, not a framework API.
133
+
134
+ Its useful starter modules look like:
135
+
136
+ 1. `src/host/index.tsx` for host surface composition
137
+ 2. `src/controller/index.tsx` for controller flow and input cadence
138
+ 3. `src/game/stores/pong-store.ts` for networked store wiring
139
+ 4. `src/game/stores/pong-store-state.ts` for pure state transitions
140
+ 5. `src/game/engine/simulation.ts` for runtime orchestration
141
+ 6. `src/game/engine/runtime-state.ts` for hot mutable runtime values
142
+ 7. `src/game/adapters/controller-signals.ts` for host-to-controller transport-facing mapping
143
+ 8. `src/game/ui/` for reusable game-facing presentation primitives shared by host and controller
144
+ 9. `src/game/prefabs/arena/` for a folder-per-prefab contract with metadata, schema, preview, and runtime composition helper
145
+ 10. `tests/game/` for the starter testing pattern that mirrors those same boundaries
146
+
147
+ If a starter module already demonstrates the boundary you need, extend it instead of introducing a second competing pattern.
148
+ If your game genuinely needs a different folder or module shape, preserve the boundary intent rather than copying Pong mechanically.
149
+
150
+ ### `src/game/debug/`
151
+
152
+ Owns debug helpers and overlays.
153
+
154
+ Keep debug features removable and out of gameplay hot paths.
155
+
156
+ ## Decision Rule
157
+
158
+ When adding code, ask:
159
+
160
+ 1. is this pure game logic
161
+ 2. is this runtime orchestration
162
+ 3. is this framework integration
163
+ 4. is this host-only or controller-only
164
+
165
+ Put the code where the answer is clearest.
166
+
167
+ ## Refactor Rule
168
+
169
+ If a new feature would force host, controller, domain, and rendering concerns into one file, fix the boundary first or split the work into:
170
+
171
+ 1. structural cleanup
172
+ 2. feature implementation
@@ -0,0 +1,79 @@
1
+
2
+
3
+ # State and Rendering
4
+
5
+ Air Jam projects often combine React, Zustand, per-frame gameplay logic, and sometimes R3F or Three.
6
+
7
+ That stack works well only when state ownership is explicit.
8
+
9
+ ## Core State Rules
10
+
11
+ 1. keep authoritative gameplay state separate from local UI state
12
+ 2. avoid one mega store for unrelated concerns
13
+ 3. use narrow selectors when consuming Zustand state
14
+ 4. keep store writes intentional and coarse
15
+ 5. keep per-frame mutable values out of React state when React rendering is not needed
16
+
17
+ These are framework-level rules about ownership and performance.
18
+ They do not require one exact store or engine file layout.
19
+
20
+ ## React Rules
21
+
22
+ 1. do not run simulation through React rerenders
23
+ 2. keep business logic out of presentational components
24
+ 3. use refs for hot mutable runtime values
25
+ 4. keep component boundaries small and purposeful
26
+
27
+ ## Starter Template Reference
28
+
29
+ The starter Pong template demonstrates one good starter implementation of the state/rendering split:
30
+
31
+ 1. `src/game/stores/pong-store.ts` owns Air Jam store wiring
32
+ 2. `src/game/stores/pong-store-state.ts` owns pure state transitions
33
+ 3. `src/game/engine/runtime-state.ts` owns per-frame mutable values
34
+ 4. `src/game/engine/simulation.ts` owns update ordering and orchestration
35
+ 5. `src/game/ui/` owns reusable game-facing presentation that host and controller surfaces can share
36
+
37
+ That split is a recommended starter pattern, not a mandatory framework contract.
38
+ If the game needs a different module layout, preserve the same ownership boundaries rather than copying the filenames literally.
39
+
40
+ ## Starter Testing Pattern
41
+
42
+ The starter template also mirrors those boundaries in tests:
43
+
44
+ 1. `tests/game/domain/` for pure gameplay rules
45
+ 2. `tests/game/stores/` for pure state transitions
46
+ 3. `tests/game/engine/` for focused runtime helpers
47
+ 4. `tests/game/adapters/` for transport-facing mapping
48
+ 5. `tests/game/ui/` for shared game-facing UI modules that do not require full host/controller shells
49
+
50
+ The default order is:
51
+
52
+ 1. test pure logic first
53
+ 2. test thin adapter boundaries second
54
+ 3. add heavier runtime or browser-facing coverage only where the integration boundary actually matters
55
+
56
+ ## R3F and Three Rules
57
+
58
+ 1. avoid rerendering scene components on every frame
59
+ 2. mutate refs in frame loops when visual updates do not require React state
60
+ 3. keep rendering integration separate from pure game rules
61
+ 4. use instancing when repeated objects justify it
62
+
63
+ ## Air Jam Lane Rules
64
+
65
+ Keep the framework lanes separate:
66
+
67
+ 1. input lane for high-frequency player control input
68
+ 2. replicated state lane for replayable shared truth
69
+ 3. signal lane for coarse UX and system events
70
+
71
+ Do not use replicated store actions as a substitute for per-frame input handling.
72
+
73
+ ## Common Pitfalls
74
+
75
+ 1. putting gameplay logic directly in render components
76
+ 2. using React state as the simulation engine
77
+ 3. selecting whole stores across many components
78
+ 4. mixing debug state into hot runtime paths
79
+ 5. solving every state problem with more component state
@@ -0,0 +1,165 @@
1
+
2
+
3
+ # Debugging and Logs
4
+
5
+ When local Air Jam development breaks, the fastest fix is usually knowing which surface is failing:
6
+
7
+ 1. game host
8
+ 2. controller
9
+ 3. local Air Jam server
10
+ 4. Arcade embed/runtime wiring
11
+
12
+ This page explains the practical debugging loop.
13
+
14
+ ## The Canonical Stream
15
+
16
+ Before you start jumping between browser tabs and terminals, remember that Air Jam has one canonical local dev stream:
17
+
18
+ - [.airjam/logs/dev-latest.ndjson](/docs/getting-started/dev-logs)
19
+
20
+ That stream is the intended first place to inspect issues that cross:
21
+
22
+ 1. server lifecycle
23
+ 2. host runtime
24
+ 3. controller runtime
25
+ 4. embedded runtime edges
26
+
27
+ Read the dedicated guide here:
28
+
29
+ 1. [Unified Dev Logs](/docs/getting-started/dev-logs)
30
+
31
+ ## 1. Start With The Canonical Local Loop
32
+
33
+ For scaffolded games, the default local command is:
34
+
35
+ ```bash
36
+ pnpm run dev
37
+ ```
38
+
39
+ That gives you the most useful first signal:
40
+
41
+ 1. server logs in the same terminal
42
+ 2. Vite host output
43
+ 3. QR/join flow using the same local runtime shape the template expects
44
+
45
+ If that terminal is not healthy, fix it before debugging the controller UI.
46
+
47
+ ## 2. Check The Local Server First
48
+
49
+ The local server should answer:
50
+
51
+ [http://localhost:4000/health](http://localhost:4000/health)
52
+
53
+ If `/health` is down:
54
+
55
+ 1. your local runtime server is not running
56
+ 2. the game will not create or join rooms
57
+ 3. controller QR flow will fail no matter what the UI shows
58
+
59
+ ## 3. Know Which Console To Inspect
60
+
61
+ Use the right browser console for the right problem:
62
+
63
+ 1. **Host tab** for room creation, host bootstrap, input consumption, and gameplay errors
64
+ 2. **Controller tab/phone remote inspector** for join failures, input publishing, haptics, and controller UI state
65
+ 3. **Server terminal** for room lifecycle, socket disconnects, auth/bootstrap problems, and routing issues
66
+
67
+ Do not debug everything from only one surface.
68
+
69
+ ## 4. Common Failure Buckets
70
+
71
+ ### Host boots but no room appears
72
+
73
+ Check:
74
+
75
+ 1. server terminal is running
76
+ 2. host browser console has no bootstrap/config errors
77
+ 3. `VITE_AIR_JAM_SERVER_URL` is correct for your environment
78
+ 4. production/static deploy has a valid `VITE_AIR_JAM_APP_ID`
79
+
80
+ ### Controller cannot join
81
+
82
+ Check:
83
+
84
+ 1. QR or join URL contains the right room code
85
+ 2. host and controller are talking to the same server origin
86
+ 3. SPA rewrites are enabled for `/controller?room=XXXX`
87
+ 4. phone can actually reach the host URL you are showing
88
+
89
+ If local phone testing is the issue, use:
90
+
91
+ ```bash
92
+ pnpm run dev -- --secure
93
+ ```
94
+
95
+ ### Input arrives late or not at all
96
+
97
+ Check:
98
+
99
+ 1. controller is publishing input via `useControllerTick` + `useInputWriter`
100
+ 2. host is reading input via `getInput` or `useGetInput`
101
+ 3. you are not trying to send per-frame input through store actions
102
+ 4. the input schema still matches the payload shape
103
+
104
+ ### Store actions do nothing
105
+
106
+ Check:
107
+
108
+ 1. actions are dispatched via `useActions()`
109
+ 2. payloads are plain serializable objects
110
+ 3. your controller is connected before dispatching
111
+ 4. identity-dependent actions use `ctx.actorId` on the host side
112
+
113
+ ### Arcade embed works in standalone but breaks in platform
114
+
115
+ Check:
116
+
117
+ 1. game code is not parsing Arcade runtime params directly
118
+ 2. gameplay state lives in the game's own store, not in local iframe lifecycle state
119
+ 3. you are treating the bridge as transport only, not as app-state truth
120
+
121
+ ## 5. Use SDK Diagnostics In Development
122
+
123
+ Air Jam exposes structured diagnostics for common misuse paths:
124
+
125
+ ```tsx
126
+ import { onAirJamDiagnostic, setAirJamDiagnosticsEnabled } from "@air-jam/sdk";
127
+
128
+ setAirJamDiagnosticsEnabled(true);
129
+
130
+ const unsubscribe = onAirJamDiagnostic((diagnostic) => {
131
+ console.log(diagnostic.code, diagnostic.message, diagnostic.details);
132
+ });
133
+ ```
134
+
135
+ This is especially useful for:
136
+
137
+ 1. missing provider/session scope
138
+ 2. invalid input payload shape
139
+ 3. state-action dispatch before session readiness
140
+ 4. runtime config mistakes
141
+
142
+ ## 6. Use The Reference Games As Sanity Checks
143
+
144
+ If you are unsure whether the framework or your game is the problem, compare your approach against:
145
+
146
+ 1. `pong` for the small canonical starter path
147
+ 2. `air-capture` for the heavier reference-app path
148
+
149
+ If your code disagrees with both patterns, your code is probably the outlier.
150
+
151
+ ## 7. Query The Unified Stream
152
+
153
+ Scaffolded games should use:
154
+
155
+ ```bash
156
+ pnpm exec air-jam-server logs
157
+ ```
158
+
159
+ Inside the Air Jam monorepo, the equivalent maintainer command is:
160
+
161
+ ```bash
162
+ pnpm run repo -- workspace logs
163
+ ```
164
+
165
+ Both commands read the same canonical local observability model.
@@ -0,0 +1,171 @@
1
+
2
+
3
+ # Unified Dev Logs
4
+
5
+ Air Jam has one canonical local observability stream for development:
6
+
7
+ - server logs
8
+ - host runtime logs
9
+ - controller runtime logs
10
+ - embedded runtime diagnostics
11
+ - local dev-runner tool output such as Vite and other child-process failures
12
+
13
+ That stream exists so you do not have to debug each surface in isolation.
14
+
15
+ ## Canonical File
16
+
17
+ The canonical file is:
18
+
19
+ ```text
20
+ .airjam/logs/dev-latest.ndjson
21
+ ```
22
+
23
+ This file is:
24
+
25
+ 1. local-first
26
+ 2. append-only for the current server run
27
+ 3. reset when the Air Jam server process starts
28
+
29
+ That means it is the right place to inspect:
30
+
31
+ 1. room lifecycle
32
+ 2. host bootstrap and reconnect
33
+ 3. controller join and disconnect flow
34
+ 4. browser/runtime diagnostics that were mirrored back to the server
35
+
36
+ ## What Writes Into It
37
+
38
+ During normal Air Jam development:
39
+
40
+ 1. the Air Jam server writes structured server events into the file
41
+ 2. the SDK browser log sink mirrors host and controller browser/runtime logs into the same file
42
+ 3. the standard dev runners mirror local child-process output into the same file as `workspace` events
43
+
44
+ If you use the standard Air Jam server and standard SDK session providers in development, this happens automatically.
45
+
46
+ No extra logging setup should be required for the normal path.
47
+
48
+ ## When It Resets
49
+
50
+ The file resets when the Air Jam server process starts.
51
+
52
+ That gives you a clean current-session stream by default.
53
+
54
+ One nuance matters:
55
+
56
+ If your dev workflow reuses an already-running local server process, the file will not reset until that server actually restarts.
57
+
58
+ ## Read It Two Ways
59
+
60
+ ### 1. Preferred: CLI Querying
61
+
62
+ Use the published server CLI first.
63
+
64
+ Examples:
65
+
66
+ ```bash
67
+ pnpm exec air-jam-server logs --view=signal
68
+ pnpm exec air-jam-server logs
69
+ pnpm exec air-jam-server logs --follow
70
+ pnpm exec air-jam-server logs --trace=host_abc123
71
+ pnpm exec air-jam-server logs --source=browser --level=warn
72
+ pnpm exec air-jam-server logs --view=signal --room=ROOM1
73
+ pnpm exec air-jam-server logs --source=workspace --process=platform --view=signal
74
+ ```
75
+
76
+ The intended Air Jam workflow is:
77
+
78
+ 1. start with `pnpm exec air-jam-server logs --view=signal`
79
+ 2. narrow to the failing trace, room, controller, runtime, or process
80
+ 3. only add custom logging if the stream still does not explain the issue
81
+
82
+ ### 2. Fallback: Read The File Directly
83
+
84
+ Direct file reads are also valid.
85
+
86
+ That is useful when:
87
+
88
+ 1. the repo does not yet expose the convenience CLI
89
+ 2. you are using your own tooling
90
+ 3. an LLM or script wants the raw NDJSON stream
91
+
92
+ ## Best Filters
93
+
94
+ The most useful filters are:
95
+
96
+ 1. `traceId` for one host session story
97
+ 2. `roomId` for one multiplayer room
98
+ 3. `controllerId` for one player/controller path
99
+ 4. `event` for one lifecycle edge
100
+ 5. `runtimeKind` and `runtimeEpoch` for embedded bridge/runtime issues
101
+ 6. `processName` via `--process` for one local dev process such as `platform`, `server`, or the active game
102
+
103
+ In practice, the fastest loop is usually:
104
+
105
+ 1. reproduce the issue
106
+ 2. find the relevant `traceId`, `roomId`, or `controllerId`
107
+ 3. inspect the rest of the stream through that lens
108
+
109
+ ## Which Identifier To Reach For First
110
+
111
+ Use the narrowest identifier that matches the failure:
112
+
113
+ 1. use `traceId` when the problem is mainly one host session story:
114
+ host bootstrap, reconnect, room ownership, launch flow
115
+ 2. use `roomId` when multiple surfaces are involved in one room and you want the whole multiplayer story
116
+ 3. use `controllerId` when one player path is failing:
117
+ join, disconnect, input, action RPC, targeted controller feedback
118
+ 4. use `runtimeKind` and `runtimeEpoch` when debugging embedded bridge/runtime activation problems
119
+ 5. use `event` when you already know the lifecycle edge you are hunting
120
+
121
+ If you are unsure, start with `roomId` or `traceId` and then narrow further.
122
+
123
+ ## Signal View Vs Raw NDJSON
124
+
125
+ Use `--view=signal` when:
126
+
127
+ 1. you want the fastest first read of the session
128
+ 2. you care about lifecycle edges, accepted/rejected outcomes, and high-signal runtime events
129
+ 3. you want to suppress low-value framework/browser console noise
130
+
131
+ Read raw NDJSON or use broader CLI filters when:
132
+
133
+ 1. you need exact append order
134
+ 2. you need the full event payloads and metadata
135
+ 3. you suspect the hidden plumbing events are part of the problem
136
+ 4. you are doing deeper agent/script analysis over the stream
137
+
138
+ The practical rule is:
139
+
140
+ 1. start with `pnpm exec air-jam-server logs --view=signal`
141
+ 2. narrow with `--trace`, `--room`, `--controller`, `--runtime`, `--process`, or `--source`
142
+ 3. fall back to raw NDJSON only when the signal view is still insufficient
143
+
144
+ ## Recommended Debug Order
145
+
146
+ When something breaks:
147
+
148
+ 1. inspect the canonical dev log stream first
149
+ 2. use SDK diagnostics second
150
+ 3. add temporary custom logs only if the canonical stream still leaves a gap
151
+
152
+ Do not default to scattered `console.log` calls across host, controller, and server code.
153
+
154
+ Air Jam is specifically designed to avoid that debugging style.
155
+
156
+ ## Important Exceptions
157
+
158
+ The automatic unified stream depends on the standard development path.
159
+
160
+ You should not assume full automatic coverage when:
161
+
162
+ 1. running `--web-only` without a local Air Jam server
163
+ 2. disabling the collector explicitly
164
+ 3. replacing the standard server/runtime path with custom infrastructure
165
+ 4. bypassing the standard dev runner and launching tools outside the Air Jam scripts
166
+
167
+ ## Related Docs
168
+
169
+ 1. [Debugging and Logs](/docs/getting-started/debugging)
170
+ 2. [For Agents](/docs/for-agents)
171
+ 3. [Host System](/docs/how-it-works/host-system)
@@ -0,0 +1,116 @@
1
+
2
+
3
+ # Game Ideas for Air Jam
4
+
5
+ A collection of game concepts that leverage Air Jam's unique architecture: **High-Frequency Input Streams** (Socket.IO) + **Reliable Shared State** (AirJam Store).
6
+
7
+ ---
8
+
9
+ ## Tier 1: Arcade Classics (Easy)
10
+
11
+ ### Neon Tanks
12
+
13
+ - Top-down arena shooter (4-8 players)
14
+ - Dual stick controls: movement + turret aiming
15
+ - Tap to fire
16
+ - **Key Feature:** Demonstrates dual stick capability on touchscreen
17
+
18
+ ### Super Sumo Balls
19
+
20
+ - Rolling balls on tilting platform
21
+ - Use phone gyroscope/accelerometer to tilt
22
+ - Haptic feedback on collisions
23
+ - **Key Feature:** Phone sensors + haptic signals
24
+
25
+ ---
26
+
27
+ ## Tier 2: Party & Social Games (Medium)
28
+
29
+ ### The Traitor (Among Us style)
30
+
31
+ - 8 players: 6 crew, 2 traitors
32
+ - Hidden roles shown only on phone
33
+ - Task minigames on controller
34
+ - Voting UI on phone
35
+ - **Key Feature:** Secret information per player (killer app for phone controllers)
36
+
37
+ ### Sketchy Business (Pictionary style)
38
+
39
+ - Draw prompts on phone canvas
40
+ - Drawings appear on TV
41
+ - **Key Feature:** Touchscreen as natural drawing pad
42
+
43
+ ### Quiz Show Royale
44
+
45
+ - Fastest finger first trivia
46
+ - Personalized feedback (green/red + vibration)
47
+ - **Key Feature:** Input timestamping for speed
48
+
49
+ ---
50
+
51
+ ## Tier 3: Co-op Chaos (Medium-Hard)
52
+
53
+ ### Starship Bridge Simulator
54
+
55
+ - 4 players with different roles
56
+ - Each player gets different UI on phone
57
+ - Asymmetrical gameplay
58
+ - **Key Feature:** Different React components per controller
59
+
60
+ ### Ghost Hunter
61
+
62
+ - 1 vs 3 asymmetrical gameplay
63
+ - Ghost sees minimap on phone only
64
+ - Hunters use joysticks on TV
65
+ - **Key Feature:** Private screen advantage
66
+
67
+ ---
68
+
69
+ ## Tier 4: Strategy & Card Games (Hard)
70
+
71
+ ### Poker Night / Blackjack
72
+
73
+ - Private cards on phone
74
+ - Betting UI on phone
75
+ - Public table on TV
76
+ - **Key Feature:** Hidden information per player
77
+
78
+ ### Artillery Wars (Worms style)
79
+
80
+ - Turn-based tank battle
81
+ - Aiming interface on phone (angle/power sliders)
82
+ - Weapon selection on phone
83
+ - **Key Feature:** Complex menus on touchscreen
84
+
85
+ ---
86
+
87
+ ## Tier 5: Experimental (Advanced)
88
+
89
+ ### The Crowd Pixel (r/place style)
90
+
91
+ - 50+ players
92
+ - Each controls a pixel/cursor
93
+ - Collaborative painting
94
+ - **Key Feature:** Tests scalability
95
+
96
+ ### Minority Report UI
97
+
98
+ - Phone as trackpad
99
+ - Gesture controls
100
+ - **Key Feature:** Phone as input device
101
+
102
+ ---
103
+
104
+ ## Key Mechanics Enabled
105
+
106
+ ```
107
+ | Mechanic | Example | Technical Feature |
108
+ |-------------------|-------------------|-----------------------------------------|
109
+ | Secret Roles | Mafia / Traitor | `useSharedState` (filter by `playerId`) |
110
+ | Private Inventory | RPG / Poker | Shared Store + React UI on Phone |
111
+ | Motion Steering | Racing / Rolling | Device Accelerometer → Input Stream |
112
+ | Fastest Finger | Quiz Show | Input Latching (Timestamps) |
113
+ | Physical Feedback | Fighting / Action | `host.sendSignal("HAPTIC")` |
114
+ | Drawing | Pictionary | Canvas API + Data Packet |
115
+ | Asymmetry | Ghost Hunter | Different Views per Role |
116
+ ```