@air-jam/cli 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +273 -2
- package/bin/airjam.mjs +66 -0
- package/dist/ai-pack.d.ts +44 -0
- package/dist/ai-pack.js +15 -0
- package/dist/ai-pack.js.map +1 -0
- package/dist/auth-profile.d.ts +5 -0
- package/dist/auth-profile.js +7 -0
- package/dist/auth-profile.js.map +1 -0
- package/dist/auth-sessions.d.ts +5 -0
- package/dist/auth-sessions.js +7 -0
- package/dist/auth-sessions.js.map +1 -0
- package/dist/chunk-7D4AYBAV.js +64 -0
- package/dist/chunk-7D4AYBAV.js.map +1 -0
- package/dist/chunk-J5MAU4QZ.js +102 -0
- package/dist/chunk-J5MAU4QZ.js.map +1 -0
- package/dist/chunk-LH7UO57C.js +23 -0
- package/dist/chunk-LH7UO57C.js.map +1 -0
- package/dist/chunk-N7AI7HZK.js +529 -0
- package/dist/chunk-N7AI7HZK.js.map +1 -0
- package/dist/chunk-PKTLVQXZ.js +82 -0
- package/dist/chunk-PKTLVQXZ.js.map +1 -0
- package/dist/chunk-SQE4NPZP.js +31 -0
- package/dist/chunk-SQE4NPZP.js.map +1 -0
- package/dist/chunk-U6V3HEBB.js +939 -0
- package/dist/chunk-U6V3HEBB.js.map +1 -0
- package/dist/chunk-VEHNFPEO.js +224 -0
- package/dist/chunk-VEHNFPEO.js.map +1 -0
- package/dist/development.d.ts +102 -0
- package/dist/development.js +33 -0
- package/dist/development.js.map +1 -0
- package/dist/documentation.d.ts +27 -0
- package/dist/documentation.js +7 -0
- package/dist/documentation.js.map +1 -0
- package/dist/game-analytics.d.ts +5 -0
- package/dist/game-analytics.js +7 -0
- package/dist/game-analytics.js.map +1 -0
- package/dist/game-app-id.d.ts +5 -0
- package/dist/game-app-id.js +7 -0
- package/dist/game-app-id.js.map +1 -0
- package/dist/game-media.d.ts +5 -0
- package/dist/game-media.js +7 -0
- package/dist/game-media.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2468 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold.d.ts +6 -0
- package/dist/scaffold.js +20 -0
- package/dist/scaffold.js.map +1 -0
- package/package.json +82 -3
- package/runtime/local-network.d.mts +6 -0
- package/runtime/local-network.mjs +9 -0
- package/runtime/public-assets.mjs +62 -0
- package/runtime/source-fence.mjs +182 -0
- package/runtime/vite-config.d.mts +43 -0
- package/runtime/vite-config.mjs +134 -0
- package/runtime/vite-dev.mjs +18 -0
- package/runtime/vite-https.d.mts +11 -0
- package/runtime/vite-https.mjs +40 -0
- package/template-assets/bootstrap/.claude/launch.json +12 -0
- package/template-assets/bootstrap/AGENTS.md +290 -0
- package/template-assets/bootstrap/CLAUDE.md +55 -0
- package/template-assets/bootstrap/_gitignore +6 -0
- package/template-assets/bootstrap/skills/airjam-docs-workflow/SKILL.md +49 -0
- package/template-assets/bootstrap/skills/airjam-mcp/SKILL.md +100 -0
- package/template-assets/bootstrap/skills/canvas-2d-gameplay/SKILL.md +47 -0
- package/template-assets/bootstrap/skills/controller-ui/SKILL.md +71 -0
- package/template-assets/bootstrap/skills/debug-and-test/SKILL.md +72 -0
- package/template-assets/bootstrap/skills/game-architecture/SKILL.md +102 -0
- package/template-assets/bootstrap/skills/game-state-and-rendering/SKILL.md +44 -0
- package/template-assets/bootstrap/skills/host-surface/SKILL.md +52 -0
- package/template-assets/bootstrap/skills/index.md +36 -0
- package/template-assets/bootstrap/skills/prefab-authoring/SKILL.md +58 -0
- package/template-assets/bootstrap/skills/r3f-3d-scene/SKILL.md +61 -0
- package/template-assets/documentation/for-agents/controller-ui/page.mdx +99 -0
- package/template-assets/documentation/for-agents/page.mdx +120 -0
- package/template-assets/documentation/for-agents/project-structure/page.mdx +170 -0
- package/template-assets/documentation/for-agents/state-and-rendering/page.mdx +77 -0
- package/template-assets/documentation/for-agents/supported-agents/page.mdx +18 -0
- package/template-assets/documentation/getting-started/debugging/page.mdx +164 -0
- package/template-assets/documentation/getting-started/dev-logs/page.mdx +169 -0
- package/template-assets/documentation/getting-started/game-ideas/page.mdx +114 -0
- package/template-assets/documentation/getting-started/introduction/page.mdx +200 -0
- package/template-assets/documentation/getting-started/migrating-legacy-games/page.mdx +673 -0
- package/template-assets/documentation/getting-started/quick-start/page.mdx +310 -0
- package/template-assets/documentation/how-it-works/architecture/page.mdx +230 -0
- package/template-assets/documentation/how-it-works/host-system/page.mdx +270 -0
- package/template-assets/documentation/manifest.json +500 -0
- package/template-assets/documentation/sdk/assets-and-theme/page.mdx +185 -0
- package/template-assets/documentation/sdk/hooks/page.mdx +435 -0
- package/template-assets/documentation/sdk/input-system/page.mdx +240 -0
- package/template-assets/documentation/sdk/networked-state/page.mdx +295 -0
- package/template-assets/documentation/sdk/settings/page.mdx +155 -0
- package/template-assets/documentation/sdk/ui-components/page.mdx +268 -0
- package/template-assets/managed/.airjam/ai-pack.json +209 -0
- package/template-assets/managed/docs/airjam/agent-gold-path.md +115 -0
- package/template-assets/managed/docs/airjam/agent-mcp.md +179 -0
- package/template-assets/managed/docs/airjam/canvas-2d-gameplay.md +82 -0
- package/template-assets/managed/docs/airjam/composition-shell-contract.md +87 -0
- package/template-assets/managed/docs/airjam/debug-and-testing.md +104 -0
- package/template-assets/managed/docs/airjam/development-loop.md +51 -0
- package/template-assets/managed/docs/airjam/docs-index.md +64 -0
- package/template-assets/managed/docs/airjam/generated/architecture.md +223 -0
- package/template-assets/managed/docs/airjam/generated/assets-and-theme.md +188 -0
- package/template-assets/managed/docs/airjam/generated/controller-ui.md +102 -0
- package/template-assets/managed/docs/airjam/generated/debugging-and-logs.md +165 -0
- package/template-assets/managed/docs/airjam/generated/for-agents.md +123 -0
- package/template-assets/managed/docs/airjam/generated/game-ideas.md +107 -0
- package/template-assets/managed/docs/airjam/generated/host-system.md +261 -0
- package/template-assets/managed/docs/airjam/generated/input-system.md +241 -0
- package/template-assets/managed/docs/airjam/generated/introduction.md +195 -0
- package/template-assets/managed/docs/airjam/generated/migrating-legacy-games.md +674 -0
- package/template-assets/managed/docs/airjam/generated/networked-state.md +298 -0
- package/template-assets/managed/docs/airjam/generated/project-structure.md +171 -0
- package/template-assets/managed/docs/airjam/generated/quick-start.md +311 -0
- package/template-assets/managed/docs/airjam/generated/sdk-hooks.md +430 -0
- package/template-assets/managed/docs/airjam/generated/settings.md +158 -0
- package/template-assets/managed/docs/airjam/generated/state-and-rendering.md +80 -0
- package/template-assets/managed/docs/airjam/generated/supported-agents.md +21 -0
- package/template-assets/managed/docs/airjam/generated/ui-components.md +265 -0
- package/template-assets/managed/docs/airjam/generated/unified-dev-logs.md +170 -0
- package/template-assets/managed/docs/airjam/iconography.md +55 -0
- package/template-assets/managed/docs/airjam/prefab-authoring.md +212 -0
- package/template-assets/managed/docs/airjam/preview-controllers.md +129 -0
- package/template-assets/managed/docs/airjam/r3f-3d-scene.md +163 -0
- package/template-assets/managed/docs/airjam/state-lanes-cookbook.md +101 -0
- package/template-assets/managed/docs/airjam/visual-system.md +103 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packageVersion": "1.0.0-beta.1",
|
|
4
|
+
"requiredComponents": [
|
|
5
|
+
"ArcadeModeDiagram",
|
|
6
|
+
"Callout",
|
|
7
|
+
"HowItWorksDiagram",
|
|
8
|
+
"SdkArchitectureDiagram",
|
|
9
|
+
"StandaloneHostDiagram",
|
|
10
|
+
"SystemOverviewDiagram"
|
|
11
|
+
],
|
|
12
|
+
"documents": [
|
|
13
|
+
{
|
|
14
|
+
"source": "getting-started/introduction/page.mdx",
|
|
15
|
+
"page": {
|
|
16
|
+
"title": "Introduction",
|
|
17
|
+
"href": "/docs/getting-started/introduction",
|
|
18
|
+
"description": "Overview of Air Jam and core concepts.",
|
|
19
|
+
"section": "Getting Started",
|
|
20
|
+
"icon": "info",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"getting started",
|
|
23
|
+
"overview",
|
|
24
|
+
"multiplayer",
|
|
25
|
+
"qr code",
|
|
26
|
+
"controller"
|
|
27
|
+
],
|
|
28
|
+
"docType": "concept",
|
|
29
|
+
"order": 0,
|
|
30
|
+
"stability": "evolving",
|
|
31
|
+
"audience": "user",
|
|
32
|
+
"sinceVersion": "1.0.0",
|
|
33
|
+
"lastVerifiedVersion": "1.0.0"
|
|
34
|
+
},
|
|
35
|
+
"size": 5950,
|
|
36
|
+
"sha256": "0c50a583f44bc4881e24ff686406ed9404edecadfd2167c2620c42d3dc38716a"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"source": "getting-started/quick-start/page.mdx",
|
|
40
|
+
"page": {
|
|
41
|
+
"title": "Quick Start",
|
|
42
|
+
"href": "/docs/getting-started/quick-start",
|
|
43
|
+
"description": "Set up and launch your first host.",
|
|
44
|
+
"section": "Getting Started",
|
|
45
|
+
"icon": "rocket",
|
|
46
|
+
"keywords": [
|
|
47
|
+
"install",
|
|
48
|
+
"setup",
|
|
49
|
+
"host",
|
|
50
|
+
"provider",
|
|
51
|
+
"first game"
|
|
52
|
+
],
|
|
53
|
+
"docType": "guide",
|
|
54
|
+
"order": 1,
|
|
55
|
+
"stability": "evolving",
|
|
56
|
+
"audience": "user",
|
|
57
|
+
"sinceVersion": "1.0.0",
|
|
58
|
+
"lastVerifiedVersion": "1.0.0"
|
|
59
|
+
},
|
|
60
|
+
"size": 12630,
|
|
61
|
+
"sha256": "2b7aef326531556880e26815295fa6e9bc55519bb1519c3a16583af979c257be"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"source": "getting-started/debugging/page.mdx",
|
|
65
|
+
"page": {
|
|
66
|
+
"title": "Debugging and Logs",
|
|
67
|
+
"href": "/docs/getting-started/debugging",
|
|
68
|
+
"description": "Where to look when local Air Jam development is not behaving as expected.",
|
|
69
|
+
"section": "Getting Started",
|
|
70
|
+
"icon": "zap",
|
|
71
|
+
"keywords": [
|
|
72
|
+
"debugging",
|
|
73
|
+
"logs",
|
|
74
|
+
"diagnostics",
|
|
75
|
+
"troubleshooting",
|
|
76
|
+
"dev"
|
|
77
|
+
],
|
|
78
|
+
"docType": "guide",
|
|
79
|
+
"order": 2,
|
|
80
|
+
"stability": "evolving",
|
|
81
|
+
"audience": "user",
|
|
82
|
+
"sinceVersion": "1.0.0",
|
|
83
|
+
"lastVerifiedVersion": "1.0.0"
|
|
84
|
+
},
|
|
85
|
+
"size": 4570,
|
|
86
|
+
"sha256": "dfd35a6c8698a650a116fc059c7376025a96a4f53791d4913a7b152bd51235f0"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"source": "getting-started/dev-logs/page.mdx",
|
|
90
|
+
"page": {
|
|
91
|
+
"title": "Unified Dev Logs",
|
|
92
|
+
"href": "/docs/getting-started/dev-logs",
|
|
93
|
+
"description": "How to use Air Jam's canonical local observability stream for server, host, controller, and runtime debugging.",
|
|
94
|
+
"section": "Getting Started",
|
|
95
|
+
"icon": "network",
|
|
96
|
+
"keywords": [
|
|
97
|
+
"dev logs",
|
|
98
|
+
"observability",
|
|
99
|
+
"traceId",
|
|
100
|
+
"debugging",
|
|
101
|
+
"controller",
|
|
102
|
+
"host",
|
|
103
|
+
"server"
|
|
104
|
+
],
|
|
105
|
+
"docType": "guide",
|
|
106
|
+
"order": 3,
|
|
107
|
+
"stability": "evolving",
|
|
108
|
+
"audience": "user",
|
|
109
|
+
"sinceVersion": "1.0.0",
|
|
110
|
+
"lastVerifiedVersion": "1.0.0"
|
|
111
|
+
},
|
|
112
|
+
"size": 5462,
|
|
113
|
+
"sha256": "73ac4e368e6e9f621bbef5687d6c46eccddaefe65c27cf18ac2b2fe90e0c91c6"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"source": "getting-started/game-ideas/page.mdx",
|
|
117
|
+
"page": {
|
|
118
|
+
"title": "Game Ideas",
|
|
119
|
+
"href": "/docs/getting-started/game-ideas",
|
|
120
|
+
"description": "Inspiration and patterns for multiplayer game concepts.",
|
|
121
|
+
"section": "Getting Started",
|
|
122
|
+
"icon": "lightbulb",
|
|
123
|
+
"keywords": [
|
|
124
|
+
"ideas",
|
|
125
|
+
"examples",
|
|
126
|
+
"patterns",
|
|
127
|
+
"game design"
|
|
128
|
+
],
|
|
129
|
+
"docType": "guide",
|
|
130
|
+
"order": 4,
|
|
131
|
+
"stability": "evolving",
|
|
132
|
+
"audience": "user",
|
|
133
|
+
"sinceVersion": "1.0.0",
|
|
134
|
+
"lastVerifiedVersion": "1.0.0"
|
|
135
|
+
},
|
|
136
|
+
"size": 3056,
|
|
137
|
+
"sha256": "c1fec0dc440c492202fb41242a078cbd732b00b622776b66c0f084d13df3fff4"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"source": "getting-started/migrating-legacy-games/page.mdx",
|
|
141
|
+
"page": {
|
|
142
|
+
"title": "Migrating Legacy Games",
|
|
143
|
+
"href": "/docs/getting-started/migrating-legacy-games",
|
|
144
|
+
"description": "How to move older Air Jam games onto the current v1 app shape cleanly.",
|
|
145
|
+
"section": "Getting Started",
|
|
146
|
+
"icon": "layers",
|
|
147
|
+
"keywords": [
|
|
148
|
+
"migration",
|
|
149
|
+
"upgrade",
|
|
150
|
+
"legacy",
|
|
151
|
+
"AirJamProvider",
|
|
152
|
+
"createAirJamApp",
|
|
153
|
+
"createAirJamStore"
|
|
154
|
+
],
|
|
155
|
+
"docType": "migration",
|
|
156
|
+
"order": 5,
|
|
157
|
+
"stability": "evolving",
|
|
158
|
+
"audience": "user",
|
|
159
|
+
"sinceVersion": "1.0.0",
|
|
160
|
+
"lastVerifiedVersion": "1.0.0"
|
|
161
|
+
},
|
|
162
|
+
"size": 31449,
|
|
163
|
+
"sha256": "0f628c675d9e97c99fab83e7f6c18eb463ec7b119be3ebb10b96f49a7516cc9b"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"source": "how-it-works/architecture/page.mdx",
|
|
167
|
+
"page": {
|
|
168
|
+
"title": "Architecture",
|
|
169
|
+
"href": "/docs/how-it-works/architecture",
|
|
170
|
+
"description": "System architecture and service responsibilities.",
|
|
171
|
+
"section": "How it Works",
|
|
172
|
+
"icon": "layers",
|
|
173
|
+
"keywords": [
|
|
174
|
+
"architecture",
|
|
175
|
+
"system",
|
|
176
|
+
"server",
|
|
177
|
+
"sdk",
|
|
178
|
+
"platform"
|
|
179
|
+
],
|
|
180
|
+
"docType": "concept",
|
|
181
|
+
"order": 0,
|
|
182
|
+
"stability": "evolving",
|
|
183
|
+
"audience": "user",
|
|
184
|
+
"sinceVersion": "1.0.0",
|
|
185
|
+
"lastVerifiedVersion": "1.0.0"
|
|
186
|
+
},
|
|
187
|
+
"size": 12175,
|
|
188
|
+
"sha256": "a01c6d66c6a0e94ceb1f4db8cb76ef31117158618c8e6d96ccda465d1310f409"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"source": "how-it-works/host-system/page.mdx",
|
|
192
|
+
"page": {
|
|
193
|
+
"title": "Host System",
|
|
194
|
+
"href": "/docs/how-it-works/host-system",
|
|
195
|
+
"description": "Lifecycle of host sessions and player connections.",
|
|
196
|
+
"section": "How it Works",
|
|
197
|
+
"icon": "cpu",
|
|
198
|
+
"keywords": [
|
|
199
|
+
"host",
|
|
200
|
+
"room",
|
|
201
|
+
"players",
|
|
202
|
+
"connection",
|
|
203
|
+
"session"
|
|
204
|
+
],
|
|
205
|
+
"docType": "contract",
|
|
206
|
+
"order": 1,
|
|
207
|
+
"stability": "evolving",
|
|
208
|
+
"audience": "user",
|
|
209
|
+
"sinceVersion": "1.0.0",
|
|
210
|
+
"lastVerifiedVersion": "1.0.0"
|
|
211
|
+
},
|
|
212
|
+
"size": 9900,
|
|
213
|
+
"sha256": "e1614e20cae976801f62b4b3bb0d32cde7bbeaadf2c85d37003119ba24247399"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"source": "sdk/hooks/page.mdx",
|
|
217
|
+
"page": {
|
|
218
|
+
"title": "Hooks",
|
|
219
|
+
"href": "/docs/sdk/hooks",
|
|
220
|
+
"description": "React hooks API reference for host and controller state.",
|
|
221
|
+
"section": "SDK",
|
|
222
|
+
"icon": "code",
|
|
223
|
+
"keywords": [
|
|
224
|
+
"hooks",
|
|
225
|
+
"api",
|
|
226
|
+
"reference",
|
|
227
|
+
"react",
|
|
228
|
+
"host",
|
|
229
|
+
"controller"
|
|
230
|
+
],
|
|
231
|
+
"docType": "reference",
|
|
232
|
+
"order": 0,
|
|
233
|
+
"stability": "evolving",
|
|
234
|
+
"audience": "user",
|
|
235
|
+
"sinceVersion": "1.0.0",
|
|
236
|
+
"lastVerifiedVersion": "1.0.0"
|
|
237
|
+
},
|
|
238
|
+
"size": 16071,
|
|
239
|
+
"sha256": "c51772e56a8bb7c0de86abfd168f9ac8999ebfe8135845e14a5eeedd848d6620"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"source": "sdk/ui-components/page.mdx",
|
|
243
|
+
"page": {
|
|
244
|
+
"title": "UI Components",
|
|
245
|
+
"href": "/docs/sdk/ui-components",
|
|
246
|
+
"description": "Canonical reusable UI components from @air-jam/sdk/ui with usage examples.",
|
|
247
|
+
"section": "SDK",
|
|
248
|
+
"icon": "code",
|
|
249
|
+
"keywords": [
|
|
250
|
+
"ui",
|
|
251
|
+
"components",
|
|
252
|
+
"qr code",
|
|
253
|
+
"avatar",
|
|
254
|
+
"orientation",
|
|
255
|
+
"volume",
|
|
256
|
+
"button",
|
|
257
|
+
"slider"
|
|
258
|
+
],
|
|
259
|
+
"docType": "reference",
|
|
260
|
+
"order": 1,
|
|
261
|
+
"stability": "evolving",
|
|
262
|
+
"audience": "user",
|
|
263
|
+
"sinceVersion": "1.0.0",
|
|
264
|
+
"lastVerifiedVersion": "1.0.0"
|
|
265
|
+
},
|
|
266
|
+
"size": 7067,
|
|
267
|
+
"sha256": "5b37d507cedb61ca4dbeaa058e908efb3423a1cce9a69e4d9252c27bb167ab3a"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"source": "sdk/input-system/page.mdx",
|
|
271
|
+
"page": {
|
|
272
|
+
"title": "Input System",
|
|
273
|
+
"href": "/docs/sdk/input-system",
|
|
274
|
+
"description": "Declared buttons, axes and sticks, phone controls, and input logs for replays.",
|
|
275
|
+
"section": "SDK",
|
|
276
|
+
"icon": "zap",
|
|
277
|
+
"keywords": [
|
|
278
|
+
"input",
|
|
279
|
+
"controls",
|
|
280
|
+
"button",
|
|
281
|
+
"stick",
|
|
282
|
+
"replay"
|
|
283
|
+
],
|
|
284
|
+
"docType": "contract",
|
|
285
|
+
"order": 2,
|
|
286
|
+
"stability": "evolving",
|
|
287
|
+
"audience": "user",
|
|
288
|
+
"sinceVersion": "1.0.0",
|
|
289
|
+
"lastVerifiedVersion": "1.0.0"
|
|
290
|
+
},
|
|
291
|
+
"size": 10346,
|
|
292
|
+
"sha256": "4d9e088cc3cc8f0d847436d03329336e1625c8f968d1e4b7f908661b889e44bd"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"source": "sdk/networked-state/page.mdx",
|
|
296
|
+
"page": {
|
|
297
|
+
"title": "Networked State",
|
|
298
|
+
"href": "/docs/sdk/networked-state",
|
|
299
|
+
"description": "Synchronizing shared state between host and controllers.",
|
|
300
|
+
"section": "SDK",
|
|
301
|
+
"icon": "network",
|
|
302
|
+
"keywords": [
|
|
303
|
+
"networked state",
|
|
304
|
+
"sync",
|
|
305
|
+
"zustand",
|
|
306
|
+
"store",
|
|
307
|
+
"broadcast"
|
|
308
|
+
],
|
|
309
|
+
"docType": "reference",
|
|
310
|
+
"order": 3,
|
|
311
|
+
"stability": "evolving",
|
|
312
|
+
"audience": "user",
|
|
313
|
+
"sinceVersion": "1.0.0",
|
|
314
|
+
"lastVerifiedVersion": "1.0.0"
|
|
315
|
+
},
|
|
316
|
+
"size": 10742,
|
|
317
|
+
"sha256": "c9246ca1ebdf1ec1e55809cbc685813cc5814ee25f7adb3d739eb865ec4f11ef"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"source": "for-agents/page.mdx",
|
|
321
|
+
"page": {
|
|
322
|
+
"title": "For Agents",
|
|
323
|
+
"href": "/docs/for-agents",
|
|
324
|
+
"description": "Fast-entry index for LLM agents and automated tooling.",
|
|
325
|
+
"section": "Agent Docs",
|
|
326
|
+
"icon": "bot",
|
|
327
|
+
"keywords": [
|
|
328
|
+
"llm",
|
|
329
|
+
"agents",
|
|
330
|
+
"automation",
|
|
331
|
+
"index",
|
|
332
|
+
"machine readable"
|
|
333
|
+
],
|
|
334
|
+
"docType": "agent",
|
|
335
|
+
"order": 0,
|
|
336
|
+
"stability": "evolving",
|
|
337
|
+
"audience": "agent",
|
|
338
|
+
"sinceVersion": "1.0.0",
|
|
339
|
+
"lastVerifiedVersion": "1.0.0"
|
|
340
|
+
},
|
|
341
|
+
"size": 5262,
|
|
342
|
+
"sha256": "0de36a14b1048ed51eb0f85315f3b808113d0468adc65a73e2fc3eb949f60b6b"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"source": "for-agents/project-structure/page.mdx",
|
|
346
|
+
"page": {
|
|
347
|
+
"title": "Project Structure",
|
|
348
|
+
"href": "/docs/for-agents/project-structure",
|
|
349
|
+
"description": "Recommended file and boundary model for clean, testable Air Jam games.",
|
|
350
|
+
"section": "Agent Docs",
|
|
351
|
+
"icon": "layers",
|
|
352
|
+
"keywords": [
|
|
353
|
+
"project structure",
|
|
354
|
+
"architecture",
|
|
355
|
+
"host",
|
|
356
|
+
"controller",
|
|
357
|
+
"domain",
|
|
358
|
+
"engine",
|
|
359
|
+
"adapters"
|
|
360
|
+
],
|
|
361
|
+
"docType": "agent",
|
|
362
|
+
"order": 1,
|
|
363
|
+
"stability": "evolving",
|
|
364
|
+
"audience": "agent",
|
|
365
|
+
"sinceVersion": "1.0.0",
|
|
366
|
+
"lastVerifiedVersion": "1.0.0"
|
|
367
|
+
},
|
|
368
|
+
"size": 4255,
|
|
369
|
+
"sha256": "b4327a4716fbe7363b52e5c2816f1048236bb4dbd0053d60c99c5e309ca48ced"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"source": "for-agents/controller-ui/page.mdx",
|
|
373
|
+
"page": {
|
|
374
|
+
"title": "Controller UI",
|
|
375
|
+
"href": "/docs/for-agents/controller-ui",
|
|
376
|
+
"description": "Touch-first rules for building controller interfaces that feel like game controls instead of generic web apps.",
|
|
377
|
+
"section": "Agent Docs",
|
|
378
|
+
"icon": "zap",
|
|
379
|
+
"keywords": [
|
|
380
|
+
"controller ui",
|
|
381
|
+
"touch",
|
|
382
|
+
"mobile",
|
|
383
|
+
"controls",
|
|
384
|
+
"layout",
|
|
385
|
+
"gamepad"
|
|
386
|
+
],
|
|
387
|
+
"docType": "agent",
|
|
388
|
+
"order": 2,
|
|
389
|
+
"stability": "evolving",
|
|
390
|
+
"audience": "agent",
|
|
391
|
+
"sinceVersion": "1.0.0",
|
|
392
|
+
"lastVerifiedVersion": "1.0.0"
|
|
393
|
+
},
|
|
394
|
+
"size": 4548,
|
|
395
|
+
"sha256": "bc4c39fe9dd3b0256c1d8fb785affb70024d6338d358c986b362e611f2488bbf"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"source": "for-agents/state-and-rendering/page.mdx",
|
|
399
|
+
"page": {
|
|
400
|
+
"title": "State and Rendering",
|
|
401
|
+
"href": "/docs/for-agents/state-and-rendering",
|
|
402
|
+
"description": "State ownership and rendering rules for React, Zustand, R3F, and per-frame gameplay code.",
|
|
403
|
+
"section": "Agent Docs",
|
|
404
|
+
"icon": "cpu",
|
|
405
|
+
"keywords": [
|
|
406
|
+
"state",
|
|
407
|
+
"rendering",
|
|
408
|
+
"zustand",
|
|
409
|
+
"react",
|
|
410
|
+
"r3f",
|
|
411
|
+
"refs",
|
|
412
|
+
"performance"
|
|
413
|
+
],
|
|
414
|
+
"docType": "agent",
|
|
415
|
+
"order": 3,
|
|
416
|
+
"stability": "evolving",
|
|
417
|
+
"audience": "agent",
|
|
418
|
+
"sinceVersion": "1.0.0",
|
|
419
|
+
"lastVerifiedVersion": "1.0.0"
|
|
420
|
+
},
|
|
421
|
+
"size": 2990,
|
|
422
|
+
"sha256": "5157e30df164ec5bc9c0d23dc6877711be7117075f844ce7643ae853cb0ca73b"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"source": "for-agents/supported-agents/page.mdx",
|
|
426
|
+
"page": {
|
|
427
|
+
"title": "Supported Agents",
|
|
428
|
+
"href": "/docs/for-agents/supported-agents",
|
|
429
|
+
"description": "Which coding agents are tested with Air Jam's CLI and MCP.",
|
|
430
|
+
"section": "Agent Docs",
|
|
431
|
+
"icon": "bot",
|
|
432
|
+
"keywords": [
|
|
433
|
+
"agents",
|
|
434
|
+
"clients",
|
|
435
|
+
"codex",
|
|
436
|
+
"claude",
|
|
437
|
+
"mcp",
|
|
438
|
+
"supported"
|
|
439
|
+
],
|
|
440
|
+
"docType": "agent",
|
|
441
|
+
"order": 4,
|
|
442
|
+
"stability": "evolving",
|
|
443
|
+
"audience": "agent",
|
|
444
|
+
"sinceVersion": "1.0.0",
|
|
445
|
+
"lastVerifiedVersion": "1.0.0"
|
|
446
|
+
},
|
|
447
|
+
"size": 1313,
|
|
448
|
+
"sha256": "c8a48279e9ce4853571b7ea6f2129baf700abc948e98764b71385b58ac3b9d83"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"source": "sdk/settings/page.mdx",
|
|
452
|
+
"page": {
|
|
453
|
+
"title": "Game Settings",
|
|
454
|
+
"href": "/docs/sdk/settings",
|
|
455
|
+
"description": "Declare tunable values, update a live host, and replay every change.",
|
|
456
|
+
"section": "SDK",
|
|
457
|
+
"icon": "zap",
|
|
458
|
+
"keywords": [
|
|
459
|
+
"settings",
|
|
460
|
+
"tuning",
|
|
461
|
+
"revision",
|
|
462
|
+
"replay"
|
|
463
|
+
],
|
|
464
|
+
"docType": "contract",
|
|
465
|
+
"order": 4,
|
|
466
|
+
"stability": "evolving",
|
|
467
|
+
"audience": "user",
|
|
468
|
+
"sinceVersion": "1.0.0",
|
|
469
|
+
"lastVerifiedVersion": "1.0.0"
|
|
470
|
+
},
|
|
471
|
+
"size": 6232,
|
|
472
|
+
"sha256": "fc775f90ade332234211a9009b00c543b02b0b63a60414000588ae73e14a3a8f"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"source": "sdk/assets-and-theme/page.mdx",
|
|
476
|
+
"page": {
|
|
477
|
+
"title": "Game Assets and Theme",
|
|
478
|
+
"href": "/docs/sdk/assets-and-theme",
|
|
479
|
+
"description": "Declare loaded files, surface-specific sounds, colours and fonts in one game declaration.",
|
|
480
|
+
"section": "SDK",
|
|
481
|
+
"icon": "zap",
|
|
482
|
+
"keywords": [
|
|
483
|
+
"assets",
|
|
484
|
+
"sounds",
|
|
485
|
+
"images",
|
|
486
|
+
"theme",
|
|
487
|
+
"fonts"
|
|
488
|
+
],
|
|
489
|
+
"docType": "contract",
|
|
490
|
+
"order": 5,
|
|
491
|
+
"stability": "evolving",
|
|
492
|
+
"audience": "user",
|
|
493
|
+
"sinceVersion": "1.0.0",
|
|
494
|
+
"lastVerifiedVersion": "1.0.0"
|
|
495
|
+
},
|
|
496
|
+
"size": 7451,
|
|
497
|
+
"sha256": "27b15521bc343bce3b0be3796d98d735963d95d01f1717ca5127a4327968093c"
|
|
498
|
+
}
|
|
499
|
+
]
|
|
500
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Game Assets and Theme
|
|
2
|
+
|
|
3
|
+
Declare a game's sounds, images, other loaded files, colours and fonts in its
|
|
4
|
+
React-free game declaration. Tools read them through `airjam.inspect_game` in
|
|
5
|
+
`declaration.assets` and `declaration.theme`.
|
|
6
|
+
|
|
7
|
+
## Declare loaded files
|
|
8
|
+
|
|
9
|
+
Keep the assets in a leaf module so rendering and audio code can import them
|
|
10
|
+
without importing the config back again.
|
|
11
|
+
|
|
12
|
+
```ts filename="src/game/assets.ts"
|
|
13
|
+
import { defineAirJamAssets } from "@air-jam/sdk/core";
|
|
14
|
+
|
|
15
|
+
export const gameAssets = defineAirJamAssets({
|
|
16
|
+
sounds: {
|
|
17
|
+
hit: { src: ["/sounds/hit.wav"], volume: 0.55 },
|
|
18
|
+
music: {
|
|
19
|
+
src: ["/music/theme.mp3"],
|
|
20
|
+
category: "music",
|
|
21
|
+
html5: true,
|
|
22
|
+
surface: "host",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
images: { player: { src: "/images/player.png" } },
|
|
26
|
+
files: { animation: { src: "/animations/fire.json" } },
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Pass it as `defineAirJamGame({ assets: gameAssets, ... })`. Every source is a
|
|
31
|
+
served path under the game's `public/` directory: it starts with `/` and has no
|
|
32
|
+
parent segments, query or hash. A sound takes a nonempty `src` array and optional
|
|
33
|
+
`volume` (0 to 1), `loop`, `html5`, `sprite` and `category` (`music` or `sfx`).
|
|
34
|
+
A sprite maps its name to `[offsetMilliseconds, durationMilliseconds]`.
|
|
35
|
+
`surface` selects `host` or `controller`; omitting it makes the sound available
|
|
36
|
+
on both. Images and files each take `{ src }`.
|
|
37
|
+
|
|
38
|
+
The React binding mounts audio for each surface automatically. Remove your
|
|
39
|
+
own `<AudioRuntime>` wrappers. Existing `useAudio` calls and `MusicPlaylist`
|
|
40
|
+
components use the binding's runtime. Host-only music never loads on a phone.
|
|
41
|
+
Read image and file paths from the object, for example
|
|
42
|
+
`gameAssets.images.player.src`, rather than repeating URL strings.
|
|
43
|
+
|
|
44
|
+
Inspection checks every declared source exists and fails with
|
|
45
|
+
`AJ_ASSET_MISSING`, naming the game, entry and missing path. This checks file
|
|
46
|
+
presence, not whether code loads an undeclared URL. Arcade cover, thumbnail and
|
|
47
|
+
preview media remain outside this declaration.
|
|
48
|
+
|
|
49
|
+
## Declare colours and fonts
|
|
50
|
+
|
|
51
|
+
```ts filename="src/game/theme.ts"
|
|
52
|
+
import { defineAirJamTheme } from "@air-jam/sdk/core";
|
|
53
|
+
|
|
54
|
+
export const gameTheme = defineAirJamTheme({
|
|
55
|
+
colors: { background: "#050816", team1: "#f97316", team2: "#38bdf8" },
|
|
56
|
+
fonts: { display: '"Avenir Next", "Trebuchet MS", sans-serif' },
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Pass it as `defineAirJamGame({ theme: gameTheme, ... })`. Keys are lower camel
|
|
61
|
+
case. Colours use hex, `rgb()`, `rgba()`, `hsl()` or `oklch()`; fonts are CSS
|
|
62
|
+
font-family lists. Font files still load through your existing CSS imports or
|
|
63
|
+
declared file paths.
|
|
64
|
+
|
|
65
|
+
The binding renders a `<style>` with each surface on its first render. It
|
|
66
|
+
exposes `--airjam-color-background`, `--airjam-color-team1` and
|
|
67
|
+
`--airjam-font-display`; camel case keys become kebab case. No generation step
|
|
68
|
+
or effect is needed. Map the variables to existing Tailwind names:
|
|
69
|
+
|
|
70
|
+
```css filename="src/index.css"
|
|
71
|
+
@import "tailwindcss";
|
|
72
|
+
|
|
73
|
+
@theme inline {
|
|
74
|
+
--color-game-bg: var(--airjam-color-background);
|
|
75
|
+
--color-game-orange: var(--airjam-color-team1);
|
|
76
|
+
--font-game: var(--airjam-font-display);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Existing classes such as `bg-game-bg` keep their names. Canvas and 3D code read
|
|
81
|
+
`gameTheme.colors.team1` and `gameTheme.fonts.display` directly. Remove the
|
|
82
|
+
literals they replace. Shadows, gradients and layout remain handwritten CSS.
|
|
83
|
+
|
|
84
|
+
Both fields are optional; an omitted field is described as empty maps.
|
|
85
|
+
The declaration graph must remain free of React, the DOM and CSS imports.
|
|
86
|
+
|
|
87
|
+
## Isolated assets and states
|
|
88
|
+
|
|
89
|
+
Prefabs are the catalog identity. Declare `space` and, for animated assets, named
|
|
90
|
+
`states`. `space` is optional: it defaults to `"3d"` when `preview.camera` is set,
|
|
91
|
+
otherwise `"2d"`. A rendered `PrefabDefinition` requires `render`; a renderer-free
|
|
92
|
+
`PrefabDeclaration` omits it. Omitting states creates one static state (`static`). State time is in
|
|
93
|
+
seconds; the SDK owns playback and seeking, while the game draws that exact time.
|
|
94
|
+
A state without `seconds` is a static pose. `loop: true` wraps a timed state;
|
|
95
|
+
otherwise it pauses at the end.
|
|
96
|
+
|
|
97
|
+
```ts filename="src/airjam.config.ts"
|
|
98
|
+
import { defineAirJamGame } from "@air-jam/sdk/core";
|
|
99
|
+
import { createPrefabCatalog, definePrefab } from "@air-jam/sdk/prefabs";
|
|
100
|
+
import { z } from "zod";
|
|
101
|
+
|
|
102
|
+
export const dotProps = z.object({ radius: z.number().positive() });
|
|
103
|
+
export const dot = definePrefab({
|
|
104
|
+
id: "dot",
|
|
105
|
+
label: "Dot",
|
|
106
|
+
category: "effect",
|
|
107
|
+
description: "Pulsing circle",
|
|
108
|
+
tags: ["effect"],
|
|
109
|
+
space: "2d",
|
|
110
|
+
configSchema: dotProps,
|
|
111
|
+
defaultProps: { radius: 40 },
|
|
112
|
+
states: [{ id: "pulse", label: "Pulse", seconds: 1, loop: true }],
|
|
113
|
+
});
|
|
114
|
+
// Add to your existing definition, retaining its metadata and other declarations:
|
|
115
|
+
export const game = defineAirJamGame({
|
|
116
|
+
metadata,
|
|
117
|
+
prefabs: createPrefabCatalog([dot]),
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Keep this declaration module free of React and renderer imports. In the host
|
|
122
|
+
application, the stage selects the renderer for the declared prefab:
|
|
123
|
+
|
|
124
|
+
```tsx filename="src/prefab-stage.tsx"
|
|
125
|
+
import {
|
|
126
|
+
createAirJamApp,
|
|
127
|
+
drawAgentCanvas,
|
|
128
|
+
useHostAgentCapture,
|
|
129
|
+
usePrefabInspection,
|
|
130
|
+
} from "@air-jam/sdk";
|
|
131
|
+
import { resolvePrefab2DTransform } from "@air-jam/sdk/prefabs";
|
|
132
|
+
import { useLayoutEffect, useRef } from "react";
|
|
133
|
+
import { dot, dotProps, game } from "./airjam.config";
|
|
134
|
+
|
|
135
|
+
function Stage() {
|
|
136
|
+
const canvas = useRef<HTMLCanvasElement>(null);
|
|
137
|
+
const { prefab, props, time, view } = usePrefabInspection();
|
|
138
|
+
if (prefab.id !== dot.id) throw new Error(`Unknown prefab: ${prefab.id}`);
|
|
139
|
+
const { radius } = dotProps.parse(props);
|
|
140
|
+
useHostAgentCapture((image, options) =>
|
|
141
|
+
drawAgentCanvas(canvas.current, image, options),
|
|
142
|
+
);
|
|
143
|
+
useLayoutEffect(() => {
|
|
144
|
+
const context = canvas.current?.getContext("2d");
|
|
145
|
+
if (!context) return;
|
|
146
|
+
const { scale, translate } = resolvePrefab2DTransform(view, 512);
|
|
147
|
+
context.resetTransform();
|
|
148
|
+
context.clearRect(0, 0, 512, 512);
|
|
149
|
+
context.translate(256 + translate[0], 256 + translate[1]);
|
|
150
|
+
context.scale(scale, scale);
|
|
151
|
+
context.beginPath();
|
|
152
|
+
context.arc(
|
|
153
|
+
0,
|
|
154
|
+
0,
|
|
155
|
+
radius * (1 + 0.2 * Math.sin(time * Math.PI * 2)),
|
|
156
|
+
0,
|
|
157
|
+
Math.PI * 2,
|
|
158
|
+
);
|
|
159
|
+
context.fillStyle = "#ff6a35";
|
|
160
|
+
context.fill();
|
|
161
|
+
}, [radius, time, view]);
|
|
162
|
+
return <canvas ref={canvas} width={512} height={512} />;
|
|
163
|
+
}
|
|
164
|
+
const app = createAirJamApp(game);
|
|
165
|
+
// In the existing host route (LiveGame is your game's live component):
|
|
166
|
+
<app.Host prefabStage={Stage}>
|
|
167
|
+
<LiveGame />
|
|
168
|
+
</app.Host>;
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
For R3F, use `resolvePrefabOrbitCamera(prefab.preview?.camera, view)` and apply its
|
|
172
|
+
`position`, `target` and `fov` to the game's camera. Capture through
|
|
173
|
+
`useHostAgentCapture`: render the R3F scene immediately before copying `gl.domElement`
|
|
174
|
+
with `drawAgentCanvas`, because WebGL drawing buffers need not survive a frame.
|
|
175
|
+
The helper has no Three dependency. Zoom 1 keeps default framing; yaw/pitch use
|
|
176
|
+
degrees relative to the preview camera. Pan uses fractions of view height, right/up
|
|
177
|
+
positive. The 2D helper returns pixel translation and scale around default framing;
|
|
178
|
+
yaw and pitch have no effect in 2D.
|
|
179
|
+
|
|
180
|
+
Open `?airjamInspect=1&prefab=dot&state=pulse&time=0.3` for a paused isolated frame.
|
|
181
|
+
Stages read parsed default props, state, time, playing and view from
|
|
182
|
+
`usePrefabInspection()`. They must draw only that prefab, without reading live room
|
|
183
|
+
stores, starting physics or advancing their own animation clock. The SDK reports
|
|
184
|
+
missing catalogs, missing stages and rendering errors. `@air-jam/sdk/prefab-inspection`
|
|
185
|
+
exports the validated parent client for lists, selection and batch canvas captures.
|