@air-jam/cli 0.9.3 → 1.0.0-beta.10
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 +128 -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-LH7UO57C.js +23 -0
- package/dist/chunk-LH7UO57C.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-A4V2N4LX.js → chunk-U6V3HEBB.js} +6 -5
- 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 +4 -0
- package/dist/development.js +1 -1
- 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.js +688 -404
- package/dist/index.js.map +1 -1
- package/dist/scaffold.d.ts +8 -1
- package/dist/scaffold.js +6 -1
- package/dist/scaffold.js.map +1 -1
- package/package.json +8 -4
- package/runtime/local-network.d.mts +4 -6
- package/runtime/public-assets.mjs +62 -0
- package/runtime/source-fence.mjs +182 -0
- package/runtime/vite-config.d.mts +2 -1
- package/runtime/vite-config.mjs +6 -2
- package/runtime/vite-dev.mjs +18 -0
- package/runtime/vite-https.mjs +2 -3
- package/template-assets/bootstrap/AGENTS.md +56 -14
- package/template-assets/bootstrap/CLAUDE.md +0 -8
- package/template-assets/bootstrap/skills/airjam-mcp/SKILL.md +44 -0
- package/template-assets/bootstrap/skills/controller-ui/SKILL.md +2 -0
- package/template-assets/bootstrap/skills/game-architecture/SKILL.md +47 -3
- package/template-assets/bootstrap/skills/index.md +1 -1
- package/template-assets/bootstrap/skills/prefab-authoring/SKILL.md +10 -0
- package/template-assets/bootstrap/skills/r3f-3d-scene/SKILL.md +10 -0
- package/template-assets/documentation/for-agents/controller-ui/page.mdx +41 -2
- package/template-assets/documentation/for-agents/page.mdx +24 -2
- package/template-assets/documentation/for-agents/project-structure/page.mdx +0 -2
- package/template-assets/documentation/for-agents/state-and-rendering/page.mdx +19 -2
- package/template-assets/documentation/for-agents/supported-agents/page.mdx +18 -0
- package/template-assets/documentation/getting-started/debugging/page.mdx +7 -8
- package/template-assets/documentation/getting-started/dev-logs/page.mdx +0 -2
- package/template-assets/documentation/getting-started/game-ideas/page.mdx +1 -3
- package/template-assets/documentation/getting-started/introduction/page.mdx +71 -54
- package/template-assets/documentation/getting-started/migrating-legacy-games/page.mdx +308 -62
- package/template-assets/documentation/getting-started/quick-start/page.mdx +56 -79
- package/template-assets/documentation/how-it-works/architecture/page.mdx +91 -50
- package/template-assets/documentation/how-it-works/host-system/page.mdx +112 -109
- package/template-assets/documentation/manifest.json +112 -42
- package/template-assets/documentation/sdk/assets-and-theme/page.mdx +185 -0
- package/template-assets/documentation/sdk/hooks/page.mdx +108 -172
- package/template-assets/documentation/sdk/input-system/page.mdx +201 -231
- package/template-assets/documentation/sdk/networked-state/page.mdx +134 -52
- package/template-assets/documentation/sdk/settings/page.mdx +166 -0
- package/template-assets/documentation/sdk/ui-components/page.mdx +38 -27
- package/template-assets/managed/.airjam/ai-pack.json +65 -47
- package/template-assets/managed/docs/airjam/agent-gold-path.md +55 -7
- package/template-assets/managed/docs/airjam/agent-mcp.md +44 -0
- package/template-assets/managed/docs/airjam/composition-shell-contract.md +4 -0
- package/template-assets/managed/docs/airjam/debug-and-testing.md +18 -0
- package/template-assets/managed/docs/airjam/docs-index.md +18 -12
- package/template-assets/managed/docs/airjam/generated/architecture.md +91 -46
- package/template-assets/managed/docs/airjam/generated/assets-and-theme.md +188 -0
- package/template-assets/managed/docs/airjam/generated/controller-ui.md +41 -0
- package/template-assets/managed/docs/airjam/generated/debugging-and-logs.md +7 -6
- package/template-assets/managed/docs/airjam/generated/for-agents.md +24 -0
- package/template-assets/managed/docs/airjam/generated/game-ideas.md +1 -1
- package/template-assets/managed/docs/airjam/generated/host-system.md +112 -102
- package/template-assets/managed/docs/airjam/generated/input-system.md +199 -218
- package/template-assets/managed/docs/airjam/generated/introduction.md +71 -51
- package/template-assets/managed/docs/airjam/generated/migrating-legacy-games.md +308 -60
- package/template-assets/managed/docs/airjam/generated/networked-state.md +134 -50
- package/template-assets/managed/docs/airjam/generated/quick-start.md +56 -79
- package/template-assets/managed/docs/airjam/generated/sdk-hooks.md +108 -167
- package/template-assets/managed/docs/airjam/generated/settings.md +169 -0
- package/template-assets/managed/docs/airjam/generated/state-and-rendering.md +19 -0
- package/template-assets/managed/docs/airjam/generated/supported-agents.md +21 -0
- package/template-assets/managed/docs/airjam/generated/ui-components.md +38 -25
- package/template-assets/managed/docs/airjam/prefab-authoring.md +100 -0
- package/template-assets/managed/docs/airjam/preview-controllers.md +5 -2
- package/template-assets/managed/docs/airjam/r3f-3d-scene.md +66 -0
- package/template-assets/managed/docs/airjam/state-lanes-cookbook.md +15 -20
- package/dist/chunk-A4V2N4LX.js.map +0 -1
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
{
|
|
16
16
|
"path": "docs/airjam/agent-gold-path.md",
|
|
17
17
|
"kind": "docs-local",
|
|
18
|
-
"size":
|
|
19
|
-
"sha256": "
|
|
18
|
+
"size": 8394,
|
|
19
|
+
"sha256": "30cc7eb97cf1177dbb56fed6d5ab1b0723809236b65dfd531ed7bf7de2eaa185"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"path": "docs/airjam/agent-mcp.md",
|
|
23
23
|
"kind": "docs-local",
|
|
24
|
-
"size":
|
|
25
|
-
"sha256": "
|
|
24
|
+
"size": 9889,
|
|
25
|
+
"sha256": "1e712de9c1e758acf5c0d509726b87c39d18446ef22c718d117d6ff431b29e72"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"path": "docs/airjam/canvas-2d-gameplay.md",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
{
|
|
34
34
|
"path": "docs/airjam/composition-shell-contract.md",
|
|
35
35
|
"kind": "docs-local",
|
|
36
|
-
"size":
|
|
37
|
-
"sha256": "
|
|
36
|
+
"size": 2891,
|
|
37
|
+
"sha256": "b67412d3fb3563ea3b20fc32fceaaa25759752b611fe05864c1b938eec4d23cc"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "docs/airjam/debug-and-testing.md",
|
|
41
41
|
"kind": "docs-local",
|
|
42
|
-
"size":
|
|
43
|
-
"sha256": "
|
|
42
|
+
"size": 3997,
|
|
43
|
+
"sha256": "efe08e5221067069d649605ed64ce7544453ddfcd3055b68c30bd07eb63c6afb"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"path": "docs/airjam/development-loop.md",
|
|
@@ -51,68 +51,74 @@
|
|
|
51
51
|
{
|
|
52
52
|
"path": "docs/airjam/docs-index.md",
|
|
53
53
|
"kind": "docs-local",
|
|
54
|
-
"size":
|
|
55
|
-
"sha256": "
|
|
54
|
+
"size": 2716,
|
|
55
|
+
"sha256": "b6c3be3b0aa221adafa4ad8245b5854ab043e8d6d8cd268abd9bb3bbecfbe4a6"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"path": "docs/airjam/generated/architecture.md",
|
|
59
59
|
"kind": "docs-generated",
|
|
60
|
-
"size":
|
|
61
|
-
"sha256": "
|
|
60
|
+
"size": 12249,
|
|
61
|
+
"sha256": "6fd0abd0ddbf07ea7e9ae113ef7792cccdfc43c7b78496759fe1ccfb4df1d4ca"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"path": "docs/airjam/generated/assets-and-theme.md",
|
|
65
|
+
"kind": "docs-generated",
|
|
66
|
+
"size": 7617,
|
|
67
|
+
"sha256": "472c18703bd9a085ba3b0cf5d2726579c7c729070e01894093e49f9f6a5c7e54"
|
|
62
68
|
},
|
|
63
69
|
{
|
|
64
70
|
"path": "docs/airjam/generated/controller-ui.md",
|
|
65
71
|
"kind": "docs-generated",
|
|
66
|
-
"size":
|
|
67
|
-
"sha256": "
|
|
72
|
+
"size": 4722,
|
|
73
|
+
"sha256": "3f2c6ae3f7f012974f5eea1fbb0b136450edc86d5eee829b32bbcce858786dc7"
|
|
68
74
|
},
|
|
69
75
|
{
|
|
70
76
|
"path": "docs/airjam/generated/debugging-and-logs.md",
|
|
71
77
|
"kind": "docs-generated",
|
|
72
|
-
"size":
|
|
73
|
-
"sha256": "
|
|
78
|
+
"size": 4698,
|
|
79
|
+
"sha256": "a5f8e4baf46ba5847db7be750d6cd3e9b207dd3b7243960b30a5e649a7a475b5"
|
|
74
80
|
},
|
|
75
81
|
{
|
|
76
82
|
"path": "docs/airjam/generated/for-agents.md",
|
|
77
83
|
"kind": "docs-generated",
|
|
78
|
-
"size":
|
|
79
|
-
"sha256": "
|
|
84
|
+
"size": 5338,
|
|
85
|
+
"sha256": "9d856e6e5f4e914ec0c5870a6a31e6ba78916a4a12664a52f3d14f1715a96e67"
|
|
80
86
|
},
|
|
81
87
|
{
|
|
82
88
|
"path": "docs/airjam/generated/game-ideas.md",
|
|
83
89
|
"kind": "docs-generated",
|
|
84
|
-
"size":
|
|
85
|
-
"sha256": "
|
|
90
|
+
"size": 3042,
|
|
91
|
+
"sha256": "19560b89a8f6000855bf24add080983349bce78802e846a17f1b56c6e8c3d010"
|
|
86
92
|
},
|
|
87
93
|
{
|
|
88
94
|
"path": "docs/airjam/generated/host-system.md",
|
|
89
95
|
"kind": "docs-generated",
|
|
90
|
-
"size":
|
|
91
|
-
"sha256": "
|
|
96
|
+
"size": 9945,
|
|
97
|
+
"sha256": "c85a8d05570fbc71cbd7cf5771e75a2f8415b4eb034462a45c30db3ca97ced31"
|
|
92
98
|
},
|
|
93
99
|
{
|
|
94
100
|
"path": "docs/airjam/generated/input-system.md",
|
|
95
101
|
"kind": "docs-generated",
|
|
96
|
-
"size":
|
|
97
|
-
"sha256": "
|
|
102
|
+
"size": 10486,
|
|
103
|
+
"sha256": "59076307117a834d830d2c1d7d06d9dd446a4117ccf38883ff9d08adb67e44c4"
|
|
98
104
|
},
|
|
99
105
|
{
|
|
100
106
|
"path": "docs/airjam/generated/introduction.md",
|
|
101
107
|
"kind": "docs-generated",
|
|
102
|
-
"size":
|
|
103
|
-
"sha256": "
|
|
108
|
+
"size": 6004,
|
|
109
|
+
"sha256": "a5330d035f1a2bbc1c51cfe5b9d3ac6efdafc28cda31435b94f64495e962cd48"
|
|
104
110
|
},
|
|
105
111
|
{
|
|
106
112
|
"path": "docs/airjam/generated/migrating-legacy-games.md",
|
|
107
113
|
"kind": "docs-generated",
|
|
108
|
-
"size":
|
|
109
|
-
"sha256": "
|
|
114
|
+
"size": 31510,
|
|
115
|
+
"sha256": "372390766ea2b59606bbc1d727b2a115aaa9e3c3c232cf9d588b69e7abdfb7ed"
|
|
110
116
|
},
|
|
111
117
|
{
|
|
112
118
|
"path": "docs/airjam/generated/networked-state.md",
|
|
113
119
|
"kind": "docs-generated",
|
|
114
|
-
"size":
|
|
115
|
-
"sha256": "
|
|
120
|
+
"size": 10906,
|
|
121
|
+
"sha256": "5280e52df3cf817e925a613b2c375ab55e09df828011a71f3d6e0b402c57d01e"
|
|
116
122
|
},
|
|
117
123
|
{
|
|
118
124
|
"path": "docs/airjam/generated/project-structure.md",
|
|
@@ -123,26 +129,38 @@
|
|
|
123
129
|
{
|
|
124
130
|
"path": "docs/airjam/generated/quick-start.md",
|
|
125
131
|
"kind": "docs-generated",
|
|
126
|
-
"size":
|
|
127
|
-
"sha256": "
|
|
132
|
+
"size": 12777,
|
|
133
|
+
"sha256": "f8cd52e60a4f40e613f692d6d8f60c0817238c1b44b9db35959bc9f4958521d1"
|
|
128
134
|
},
|
|
129
135
|
{
|
|
130
136
|
"path": "docs/airjam/generated/sdk-hooks.md",
|
|
131
137
|
"kind": "docs-generated",
|
|
132
|
-
"size":
|
|
133
|
-
"sha256": "
|
|
138
|
+
"size": 16229,
|
|
139
|
+
"sha256": "275112a40a608a51588158931d9fb9b2496001ff4ba3b822d99f40ab0daa6bfb"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"path": "docs/airjam/generated/settings.md",
|
|
143
|
+
"kind": "docs-generated",
|
|
144
|
+
"size": 6969,
|
|
145
|
+
"sha256": "4efa779c48aa0701be630bb71a6bce1703525b670e84d0344c3c6376ceca9009"
|
|
134
146
|
},
|
|
135
147
|
{
|
|
136
148
|
"path": "docs/airjam/generated/state-and-rendering.md",
|
|
137
149
|
"kind": "docs-generated",
|
|
138
|
-
"size":
|
|
139
|
-
"sha256": "
|
|
150
|
+
"size": 4136,
|
|
151
|
+
"sha256": "d62521b4bab84c3292b780255b72ab559fcdd7652ef431909e71db72d7735bf0"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"path": "docs/airjam/generated/supported-agents.md",
|
|
155
|
+
"kind": "docs-generated",
|
|
156
|
+
"size": 1492,
|
|
157
|
+
"sha256": "2452bf09b3b75ea9c34437e4df8bac6e58813049600c6a2e036cae312705372d"
|
|
140
158
|
},
|
|
141
159
|
{
|
|
142
160
|
"path": "docs/airjam/generated/ui-components.md",
|
|
143
161
|
"kind": "docs-generated",
|
|
144
|
-
"size":
|
|
145
|
-
"sha256": "
|
|
162
|
+
"size": 6660,
|
|
163
|
+
"sha256": "deb0b2a40901dd29e40bd8c7aa6bbf8e447e09385b84e476cce098e5ce1c5cfc"
|
|
146
164
|
},
|
|
147
165
|
{
|
|
148
166
|
"path": "docs/airjam/generated/unified-dev-logs.md",
|
|
@@ -159,26 +177,26 @@
|
|
|
159
177
|
{
|
|
160
178
|
"path": "docs/airjam/prefab-authoring.md",
|
|
161
179
|
"kind": "docs-local",
|
|
162
|
-
"size":
|
|
163
|
-
"sha256": "
|
|
180
|
+
"size": 6916,
|
|
181
|
+
"sha256": "4abedb9d6241011b115503b26c59579340f954a6d4480069f304b4ff857f501a"
|
|
164
182
|
},
|
|
165
183
|
{
|
|
166
184
|
"path": "docs/airjam/preview-controllers.md",
|
|
167
185
|
"kind": "docs-local",
|
|
168
|
-
"size":
|
|
169
|
-
"sha256": "
|
|
186
|
+
"size": 4812,
|
|
187
|
+
"sha256": "24f60c5fd41d25b12cdcef99d64a995b89e4266ee6b4378d56a8057e9386b5bc"
|
|
170
188
|
},
|
|
171
189
|
{
|
|
172
190
|
"path": "docs/airjam/r3f-3d-scene.md",
|
|
173
191
|
"kind": "docs-local",
|
|
174
|
-
"size":
|
|
175
|
-
"sha256": "
|
|
192
|
+
"size": 5610,
|
|
193
|
+
"sha256": "1768ec9fe9279081d978f1ce8e146532f7d3ff50b30fdac8c309ead3f9ac48ae"
|
|
176
194
|
},
|
|
177
195
|
{
|
|
178
196
|
"path": "docs/airjam/state-lanes-cookbook.md",
|
|
179
197
|
"kind": "docs-local",
|
|
180
|
-
"size":
|
|
181
|
-
"sha256": "
|
|
198
|
+
"size": 3476,
|
|
199
|
+
"sha256": "6d7f8550fa5a80cedd94d8ba4bafd93c0ab4e8ef74b500eaaf44fdaa9052b9e8"
|
|
182
200
|
},
|
|
183
201
|
{
|
|
184
202
|
"path": "docs/airjam/visual-system.md",
|
|
@@ -187,5 +205,5 @@
|
|
|
187
205
|
"sha256": "0eaa064c38b4568c200fbf5cadb96f16c7c738a29469c4c955fb1ac5f8077edf"
|
|
188
206
|
}
|
|
189
207
|
],
|
|
190
|
-
"contentDigest": "
|
|
208
|
+
"contentDigest": "153337331e5a84a9cd56a9c56b06d02a0bd26d24df2e074996c05799c69aa4ae"
|
|
191
209
|
}
|
|
@@ -32,7 +32,10 @@ This is the shortest correct workflow for building and testing an Air Jam game.
|
|
|
32
32
|
## Canonical Files
|
|
33
33
|
|
|
34
34
|
`src/airjam.config.ts`
|
|
35
|
-
:
|
|
35
|
+
: Exports `airjam = defineAirJamGame(...)` from `@air-jam/sdk/core`: metadata, stores, simulation, input, bindings, controller path, agent and testing path. The entire graph stays free of React, the SDK root, TSX and CSS.
|
|
36
|
+
|
|
37
|
+
`src/app.tsx`
|
|
38
|
+
: Binds the declaration with `createAirJamApp(airjam, { runtime })` and mounts its Host and Controller.
|
|
36
39
|
|
|
37
40
|
`src/game/contracts/agent.ts`
|
|
38
41
|
: Owns the semantic agent contract. Keep snapshot projection and semantic actions here.
|
|
@@ -43,17 +46,18 @@ This is the shortest correct workflow for building and testing an Air Jam game.
|
|
|
43
46
|
2. `host:*` actions are deterministic semantic host actions. Define them with `agentAction.host(...)` when the game needs precise host staging or reset verbs for testing, visual proof, or controlled setup.
|
|
44
47
|
3. Store action dispatch returns an acknowledgement. Check it when outcome matters.
|
|
45
48
|
4. For `airjam.invoke_game_session_action`, prefer the returned normalized `outcome` over guessing from the raw acknowledgement alone. A missing host acknowledgement with observed committed state change is still a meaningful success signal, not an automatic rejection.
|
|
46
|
-
5. `ctx.actorId` always means the dispatcher. If host code dispatches with `
|
|
47
|
-
6. If host code intentionally needs to run the same semantic player action as controller `X`, use `
|
|
48
|
-
7. If a store action needs a host-only local side effect like audio, sim refs, or one-shot UI effects, use `
|
|
49
|
+
5. `ctx.actorId` always means the dispatcher. If host code dispatches with `gameStore.actions`, then `ctx.actorId` is the host.
|
|
50
|
+
6. If host code intentionally needs to run the same semantic player action as controller `X`, use `gameStore.asPlayer("X")` explicitly.
|
|
51
|
+
7. If a store action needs a host-only local side effect like audio, sim refs, or one-shot UI effects, use `useHostActionListener(gameStore, ...)` instead of replicated queue-and-drain state.
|
|
49
52
|
8. `resultDescription` is documentation for agents and humans about the expected semantic effect. It does not automatically become runtime result data.
|
|
50
53
|
9. If an action must return actual runtime result data, return `acceptAirJamAction(result)` from the store action and read the acknowledgement/result separately.
|
|
51
|
-
10.
|
|
54
|
+
10. Put per-step gameplay in a declared simulation (`defineAirJamSimulation`, declared with `defineAirJamGame({ simulation })`): step it with game time and `random` from its context, declare what agents see with `observe`, and draw it with `useSimulationFrame`. Never hand-roll `requestAnimationFrame` or `setInterval` gameplay loops.
|
|
55
|
+
11. Store actions read time as `ctx.now` (game time), never `Date.now()`. Timers and deadlines are checked by the simulation; phones show values the host writes to the store, such as whole seconds left.
|
|
52
56
|
|
|
53
57
|
## Import Rules
|
|
54
58
|
|
|
55
|
-
1.
|
|
56
|
-
2.
|
|
59
|
+
1. Store definitions and simulations import from `@air-jam/sdk/core`, the framework-free runtime; components and hooks import from `@air-jam/sdk`, its React binding. The core imports no React, so the same game logic runs headless.
|
|
60
|
+
2. Read live replicated state outside rendering with `gameStore.getState()`.
|
|
57
61
|
|
|
58
62
|
## Browser + MCP Pairing
|
|
59
63
|
|
|
@@ -65,3 +69,47 @@ This is the shortest correct workflow for building and testing an Air Jam game.
|
|
|
65
69
|
6. Use visible preview controllers for UI smoke proof with real browser click/drag/release gestures.
|
|
66
70
|
7. Do not synthesize pointer events into controller iframes from parent-page eval; use semantic game actions when reliable gameplay proof matters.
|
|
67
71
|
8. If the agent environment cannot launch a browser, capture the existing room's canonical host and controller views through `airjam.capture_game_session_visuals`; do not start an unrelated browser or room.
|
|
72
|
+
|
|
73
|
+
## One game declaration
|
|
74
|
+
|
|
75
|
+
Read `airjam.inspect_game` for the versioned `declaration`, including
|
|
76
|
+
`declaration.agent`, controls, controller path and metadata. The game's
|
|
77
|
+
`src/airjam.config.ts` exports `airjam = defineAirJamGame(...)` from
|
|
78
|
+
`@air-jam/sdk/core`; agent helpers also come from core. Keep React, the SDK
|
|
79
|
+
root, TSX and CSS out of its graph. `app.tsx` alone binds it with
|
|
80
|
+
`createAirJamApp(airjam, { runtime })`.
|
|
81
|
+
|
|
82
|
+
Capacity comes from `metadata.maxPlayers`. The `testing` path names a module
|
|
83
|
+
exporting `testing = defineAirJamTesting({ player, profiles, visual })` from
|
|
84
|
+
`@air-jam/devtools/testing`. Profiles author scripted policies only; a declared
|
|
85
|
+
player is offered as the reserved `model` policy in every profile. Optional
|
|
86
|
+
`visual.scenarios` uses the game's declared agent. A profile's `setup` brings
|
|
87
|
+
the room to where its test starts; its `handBack` returns the creator's room,
|
|
88
|
+
usually with `return_to_lobby`, once the test ends and before its players
|
|
89
|
+
leave, so the game never plays on without them. Profiles that join play already
|
|
90
|
+
under way hand it back too. Declare `handBack: []` only when the game has no
|
|
91
|
+
phase to leave, such as a shared counter; a missing one is reported as
|
|
92
|
+
`undeclared` in the run record. Do not duplicate identity in template flags or read config source with
|
|
93
|
+
regular expressions.
|
|
94
|
+
|
|
95
|
+
## Declared settings
|
|
96
|
+
|
|
97
|
+
Declare creator tuning values with `defineAirJamSettings` and `setting` from
|
|
98
|
+
`@air-jam/sdk/core`, in the game declaration's `settings` field. Remove the
|
|
99
|
+
constants they replace. Read values in simulation create/step/observe contexts
|
|
100
|
+
and typed action contexts; host rendering uses `useAirJamSettings`. Controllers
|
|
101
|
+
show copies in replicated state. Lobby player choices stay store state.
|
|
102
|
+
|
|
103
|
+
Inspect descriptors in `airjam.inspect_game` → `declaration.settings`.
|
|
104
|
+
Use `airjam.read_game_settings({ gameSessionId })` for live values and revision,
|
|
105
|
+
then `airjam.update_game_settings({ gameSessionId, patch, expectedRevision })`
|
|
106
|
+
under host authority. Only `live: true` values can change; non-live values go
|
|
107
|
+
in `airjam.start_game_run({ settings, ... })` for a fresh room. Stale revisions
|
|
108
|
+
require a fresh read. Input log version 2 records initial values and ordered
|
|
109
|
+
settings updates for replay. See `docs/airjam/generated/settings.md`.
|
|
110
|
+
|
|
111
|
+
Declared assets and theme are read through `airjam.inspect_game` in
|
|
112
|
+
`declaration.assets` and `declaration.theme`. Keep sounds, images and loaded
|
|
113
|
+
files in `defineAirJamAssets`, colours and font families in `defineAirJamTheme`,
|
|
114
|
+
and pass both to `defineAirJamGame`. The React binding owns audio mounts and
|
|
115
|
+
theme CSS variables; games consume the declared objects and never duplicate them.
|
|
@@ -133,3 +133,47 @@ Before finishing meaningful work:
|
|
|
133
133
|
The MCP config is project-local and scaffolded by default.
|
|
134
134
|
|
|
135
135
|
Do not mutate global client configuration unless you explicitly mean to.
|
|
136
|
+
|
|
137
|
+
## One game declaration
|
|
138
|
+
|
|
139
|
+
Read `airjam.inspect_game` for the versioned `declaration`, including
|
|
140
|
+
`declaration.agent`, controls, controller path and metadata. The game's
|
|
141
|
+
`src/airjam.config.ts` exports `airjam = defineAirJamGame(...)` from
|
|
142
|
+
`@air-jam/sdk/core`; agent helpers also come from core. Keep React, the SDK
|
|
143
|
+
root, TSX and CSS out of its graph. `app.tsx` alone binds it with
|
|
144
|
+
`createAirJamApp(airjam, { runtime })`.
|
|
145
|
+
|
|
146
|
+
Capacity comes from `metadata.maxPlayers`. The `testing` path names a module
|
|
147
|
+
exporting `testing = defineAirJamTesting({ player, profiles, visual })` from
|
|
148
|
+
`@air-jam/devtools/testing`. Profiles author scripted policies only; a declared
|
|
149
|
+
player is offered as the reserved `model` policy in every profile. Optional
|
|
150
|
+
`visual.scenarios` uses the game's declared agent. A profile's `setup` brings
|
|
151
|
+
the room to where its test starts; its `handBack` returns the creator's room,
|
|
152
|
+
usually with `return_to_lobby`, once the test ends and before its players
|
|
153
|
+
leave, so the game never plays on without them. Profiles that join play already
|
|
154
|
+
under way hand it back too. Declare `handBack: []` only when the game has no
|
|
155
|
+
phase to leave, such as a shared counter; a missing one is reported as
|
|
156
|
+
`undeclared` in the run record. Do not duplicate identity in template flags or read config source with
|
|
157
|
+
regular expressions.
|
|
158
|
+
|
|
159
|
+
## Declared settings
|
|
160
|
+
|
|
161
|
+
Declare creator tuning values with `defineAirJamSettings` and `setting` from
|
|
162
|
+
`@air-jam/sdk/core`, in the game declaration's `settings` field. Remove the
|
|
163
|
+
constants they replace. Read values in simulation create/step/observe contexts
|
|
164
|
+
and typed action contexts; host rendering uses `useAirJamSettings`. Controllers
|
|
165
|
+
show copies in replicated state. Lobby player choices stay store state.
|
|
166
|
+
|
|
167
|
+
Inspect descriptors in `airjam.inspect_game` → `declaration.settings`.
|
|
168
|
+
Use `airjam.read_game_settings({ gameSessionId })` for live values and revision,
|
|
169
|
+
then `airjam.update_game_settings({ gameSessionId, patch, expectedRevision })`
|
|
170
|
+
under host authority. Only `live: true` values can change; non-live values go
|
|
171
|
+
in `airjam.start_game_run({ settings, ... })` for a fresh room. Stale revisions
|
|
172
|
+
require a fresh read. Input log version 2 records initial values and ordered
|
|
173
|
+
settings updates for replay. See `docs/airjam/generated/settings.md`.
|
|
174
|
+
|
|
175
|
+
Declared assets and theme are read through `airjam.inspect_game` in
|
|
176
|
+
`declaration.assets` and `declaration.theme`. Keep sounds, images and loaded
|
|
177
|
+
files in `defineAirJamAssets`, colours and font families in `defineAirJamTheme`,
|
|
178
|
+
and pass both to `defineAirJamGame`. The React binding owns audio mounts and
|
|
179
|
+
theme CSS variables; games consume the declared objects and never duplicate them.
|
|
@@ -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
|
|
@@ -65,6 +65,24 @@ Use direct file reads or broader filtering when you need:
|
|
|
65
65
|
3. add focused tests when changing real behavior
|
|
66
66
|
4. prefer observable behavior over implementation details
|
|
67
67
|
|
|
68
|
+
## Decision-model Playtesting
|
|
69
|
+
|
|
70
|
+
Declare an `AirJamPlayerContract` from `@air-jam/devtools/testing` with `brief`
|
|
71
|
+
and `turn`. Return `{ state, question, options }` with 1 to 16 named options,
|
|
72
|
+
each carrying `when` and `control`, or `null` when the seat has nothing to do.
|
|
73
|
+
Zero options is invalid. A single sensible move, such as joining a lobby, is
|
|
74
|
+
allowed: the run owner takes that option's control directly with no model call
|
|
75
|
+
or cost. Do not add a fake alternative. Multiple options ask the model to choose.
|
|
76
|
+
The trace keeps the choice and control with the note `Only option; no model
|
|
77
|
+
asked.`; the seat's optional `answers.automatic` count distinguishes these
|
|
78
|
+
automatic answers in the run record.
|
|
79
|
+
|
|
80
|
+
In Studio, `studio_press_phone` taps, holds or types on one named mounted Studio phone
|
|
81
|
+
and returns its private screen in the same call. Coordinates are fractions 0..1 of
|
|
82
|
+
`studio_observe_current_game`'s `surface=phone` image. Tap a field before typing;
|
|
83
|
+
a hold captures while pressed, then releases. Reuse the requestId UUID for retries.
|
|
84
|
+
Guest/real phones and older runtimes return an explicit unavailable reason.
|
|
85
|
+
|
|
68
86
|
## Starter Template Testing Pattern
|
|
69
87
|
|
|
70
88
|
If the project ships the starter testing layout, keep using it:
|
|
@@ -12,18 +12,24 @@ For broader public framework docs, use the hosted docs site after checking these
|
|
|
12
12
|
## Generated Canonical Docs
|
|
13
13
|
|
|
14
14
|
1. [For Agents](./generated/for-agents.md)
|
|
15
|
-
2. [
|
|
16
|
-
3. [
|
|
17
|
-
4. [
|
|
18
|
-
5. [
|
|
19
|
-
6. [
|
|
20
|
-
7. [
|
|
21
|
-
8. [
|
|
22
|
-
9. [
|
|
23
|
-
10. [
|
|
24
|
-
11. [
|
|
25
|
-
12. [
|
|
26
|
-
13. [
|
|
15
|
+
2. [Supported Agents](./generated/supported-agents.md)
|
|
16
|
+
3. [Project Structure](./generated/project-structure.md)
|
|
17
|
+
4. [Controller UI](./generated/controller-ui.md)
|
|
18
|
+
5. [State And Rendering](./generated/state-and-rendering.md)
|
|
19
|
+
6. [Introduction](./generated/introduction.md)
|
|
20
|
+
7. [Quick Start](./generated/quick-start.md)
|
|
21
|
+
8. [Architecture](./generated/architecture.md)
|
|
22
|
+
9. [Host System](./generated/host-system.md)
|
|
23
|
+
10. [SDK Hooks](./generated/sdk-hooks.md)
|
|
24
|
+
11. [UI Components](./generated/ui-components.md)
|
|
25
|
+
12. [Input System](./generated/input-system.md)
|
|
26
|
+
13. [Networked State](./generated/networked-state.md)
|
|
27
|
+
14. [Game Settings](./generated/settings.md)
|
|
28
|
+
15. [Game Assets And Theme](./generated/assets-and-theme.md)
|
|
29
|
+
16. [Debugging And Logs](./generated/debugging-and-logs.md)
|
|
30
|
+
17. [Unified Dev Logs](./generated/unified-dev-logs.md)
|
|
31
|
+
18. [Game Ideas](./generated/game-ideas.md)
|
|
32
|
+
19. [Migrating Legacy Games](./generated/migrating-legacy-games.md)
|
|
27
33
|
|
|
28
34
|
## Local Supplements
|
|
29
35
|
|