@hopple/sdk 1.0.0-next.1 → 1.0.0-next.12

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.
@@ -1,954 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$comment": "Generated from sdk/manifest/src/manifest.ts by `npm run schema -w sdk/manifest`. Do not edit.",
4
- "title": "Hopple project config",
5
- "$ref": "#/definitions/HoppleConfig",
6
- "definitions": {
7
- "HoppleConfig": {
8
- "type": "object",
9
- "properties": {
10
- "$schema": {
11
- "type": "string",
12
- "description": "Where an editor finds this file's schema, in a JSON config. Read by nothing else.",
13
- "markdownDescription": "Where an editor finds this file's schema, in a JSON config. Read by nothing else."
14
- },
15
- "build": {
16
- "type": "string",
17
- "description": "The command that builds the game, run in the config's directory before `hopple dev`, `check` and `publish` use it, so none of them sees a stale build. Leave it out for a game with nothing to build.",
18
- "markdownDescription": "The command that builds the game, run in the config's directory before\n`hopple dev`, `check` and `publish` use it, so none of them sees a stale\nbuild. Leave it out for a game with nothing to build.",
19
- "pattern": "\\S",
20
- "errorMessage": "must be the command that builds the game, like \"npm run build\""
21
- },
22
- "page": {
23
- "type": "string",
24
- "description": "The built page, relative to the config. The directory it is in is published, with the page as its `index.html`; a page beside its config is published alone, so it has to hold the whole game.",
25
- "markdownDescription": "The built page, relative to the config. The directory it is in is\npublished, with the page as its `index.html`; a page beside its config is\npublished alone, so it has to hold the whole game.",
26
- "pattern": "\\.[Hh][Tt][Mm][Ll]?$",
27
- "errorMessage": "must be the built .html file, like \"dist/index.html\""
28
- },
29
- "manifest": {
30
- "$ref": "#/definitions/ProjectManifest",
31
- "description": "What the game is. Uploaded beside the page, and read by every host before the game runs.",
32
- "markdownDescription": "What the game is. Uploaded beside the page, and read by every host before the game runs."
33
- }
34
- },
35
- "required": [
36
- "page",
37
- "manifest"
38
- ],
39
- "additionalProperties": false,
40
- "description": "A game project's hopple config: `hopple.config.ts`, `hopple.config.js` or `hopple.config.json`, beside the project's `package.json`.\n\nEverything the `hopple` command line needs to know about a project, in one place: how to build the game, which built file is the game, and the manifest that says what the game is. Only the manifest leaves the machine, uploaded beside the page as `game.manifest.json`. A TypeScript or JavaScript config default-exports one of these; a JSON config is one.\n\n```ts import type { HoppleConfig } from '@hopple/sdk';\n\nexport default { build: 'npm run build', page: 'dist/index.html', manifest: { id: 'my-game', version: '0.1.0', title: 'My Game', orientation: 'portrait', audio: null }, } satisfies HoppleConfig; ```",
41
- "markdownDescription": "A game project's hopple config: `hopple.config.ts`, `hopple.config.js` or\n`hopple.config.json`, beside the project's `package.json`.\n\nEverything the `hopple` command line needs to know about a project, in one\nplace: how to build the game, which built file is the game, and the manifest\nthat says what the game is. Only the manifest leaves the machine, uploaded\nbeside the page as `game.manifest.json`. A TypeScript or JavaScript config\ndefault-exports one of these; a JSON config is one.\n\n```ts\nimport type { HoppleConfig } from '@hopple/sdk';\n\nexport default {\n build: 'npm run build',\n page: 'dist/index.html',\n manifest: { id: 'my-game', version: '0.1.0', title: 'My Game', orientation: 'portrait', audio: null },\n} satisfies HoppleConfig;\n```"
42
- },
43
- "ProjectManifest": {
44
- "type": "object",
45
- "additionalProperties": false,
46
- "properties": {
47
- "api": {
48
- "$ref": "#/definitions/ApiVersion"
49
- },
50
- "id": {
51
- "type": "string",
52
- "description": "Stable across versions, and unique among its publisher's games: it is the second half of the address the game is published at, `owner/id`, and the name every new version is filed under. Lowercase, url-safe, and no two hyphens in a row, because it ends up in urls and storage keys.",
53
- "markdownDescription": "Stable across versions, and unique among its publisher's games: it is the\nsecond half of the address the game is published at, `owner/id`, and the\nname every new version is filed under. Lowercase, url-safe, and no two\nhyphens in a row, because it ends up in urls and storage keys.",
54
- "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
55
- "maxLength": 64,
56
- "errorMessage": "must be lowercase letters, digits and hyphens"
57
- },
58
- "owner": {
59
- "type": "string",
60
- "description": "The handle of the account the game is published under: the first half of `owner/id`. Absent, it is whoever publishes it. Present, only that account and the game's collaborators may publish it.",
61
- "markdownDescription": "The handle of the account the game is published under: the first half of\n`owner/id`. Absent, it is whoever publishes it. Present, only that account\nand the game's collaborators may publish it.",
62
- "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
63
- "maxLength": 64,
64
- "errorMessage": "must be a handle: lowercase letters, digits and hyphens"
65
- },
66
- "version": {
67
- "type": "string",
68
- "description": "The game's own version, `MAJOR.MINOR.PATCH`. Ours to read, never to parse for meaning.",
69
- "markdownDescription": "The game's own version, `MAJOR.MINOR.PATCH`. Ours to read, never to parse for meaning.",
70
- "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$",
71
- "errorMessage": "must look like 1.0.0"
72
- },
73
- "title": {
74
- "type": "string",
75
- "pattern": "\\S",
76
- "maxLength": 60,
77
- "errorMessage": "must not be blank"
78
- },
79
- "description": {
80
- "type": "string",
81
- "description": "A sentence or two about the game, shown beside its title.",
82
- "markdownDescription": "A sentence or two about the game, shown beside its title.",
83
- "pattern": "\\S",
84
- "maxLength": 500,
85
- "errorMessage": "must not be blank"
86
- },
87
- "cover": {
88
- "type": "string",
89
- "description": "A picture of the game, shown wherever a link to it is pasted — a chat, a post, a message.\n\nThe path of a PNG, JPEG or WebP file, relative to the config the manifest is in, and at most `COVER_MAX_BYTES`. `hopple publish` uploads it beside the game. 1200 × 630 is the shape every platform shows whole; without one, a link shows Hopple's own card.",
90
- "markdownDescription": "A picture of the game, shown wherever a link to it is pasted — a chat, a\npost, a message.\n\nThe path of a PNG, JPEG or WebP file, relative to the config the manifest\nis in, and at most `COVER_MAX_BYTES`. `hopple publish` uploads it beside\nthe game. 1200 × 630 is the shape every platform shows whole; without one,\na link shows Hopple's own card.",
91
- "pattern": "^(?!/)(?!.*\\.\\.)[A-Za-z0-9._/-]+\\.(?:png|jpe?g|webp)$",
92
- "maxLength": 200,
93
- "errorMessage": "must be the path of a .png, .jpg or .webp file beside the config, like \"cover.png\""
94
- },
95
- "orientation": {
96
- "$ref": "#/definitions/Orientation"
97
- },
98
- "layout": {
99
- "$ref": "#/definitions/LayoutDeclaration",
100
- "description": "How the game wants the host's furniture handled. See `InsetMode`.",
101
- "markdownDescription": "How the game wants the host's furniture handled. See `InsetMode`."
102
- },
103
- "analytics": {
104
- "$ref": "#/definitions/AnalyticsDeclaration",
105
- "description": "The custom events this game sends. See `AnalyticsDeclaration`.",
106
- "markdownDescription": "The custom events this game sends. See `AnalyticsDeclaration`."
107
- },
108
- "save": {
109
- "$ref": "#/definitions/SaveDeclaration",
110
- "description": "That this game keeps state, and roughly how much. See `SaveDeclaration`.",
111
- "markdownDescription": "That this game keeps state, and roughly how much. See `SaveDeclaration`."
112
- },
113
- "score": {
114
- "$ref": "#/definitions/ScoreDeclaration",
115
- "description": "The boards this game keeps a score on. See `ScoreDeclaration`.",
116
- "markdownDescription": "The boards this game keeps a score on. See `ScoreDeclaration`."
117
- },
118
- "achievements": {
119
- "$ref": "#/definitions/AchievementDeclaration",
120
- "description": "What a player can be shown to have done. See `AchievementDeclaration`.",
121
- "markdownDescription": "What a player can be shown to have done. See `AchievementDeclaration`."
122
- },
123
- "input": {
124
- "$ref": "#/definitions/InputDeclaration",
125
- "description": "How this game is played, and what it draws to be played with. See `InputDeclaration`.",
126
- "markdownDescription": "How this game is played, and what it draws to be played with. See `InputDeclaration`."
127
- },
128
- "players": {
129
- "$ref": "#/definitions/PlayersDeclaration",
130
- "description": "How many play on one device. See `PlayersDeclaration`.",
131
- "markdownDescription": "How many play on one device. See `PlayersDeclaration`."
132
- },
133
- "audio": {
134
- "anyOf": [
135
- {
136
- "$ref": "#/definitions/AudioDeclaration"
137
- },
138
- {
139
- "type": "null"
140
- }
141
- ],
142
- "description": "What this game makes noise with, one channel at a time, or `null` for a game that makes none. See `AudioDeclaration`.",
143
- "markdownDescription": "What this game makes noise with, one channel at a time, or `null` for a\ngame that makes none. See `AudioDeclaration`."
144
- },
145
- "previews": {
146
- "$ref": "#/definitions/PreviewsDeclaration",
147
- "description": "The previews this game is written against, each at its revision. See `PreviewsDeclaration`.",
148
- "markdownDescription": "The previews this game is written against, each at its revision. See\n`PreviewsDeclaration`."
149
- }
150
- },
151
- "required": [
152
- "audio",
153
- "id",
154
- "orientation",
155
- "title",
156
- "version"
157
- ],
158
- "description": "The manifest as a project's config holds it: `api` may be left out, for the CLI to fill from the installed `@hopple/sdk`.",
159
- "markdownDescription": "The manifest as a project's config holds it: `api` may be left out, for the\nCLI to fill from the installed `@hopple/sdk`."
160
- },
161
- "ApiVersion": {
162
- "type": "string",
163
- "description": "The API a game is written against: `M.m`, a major and the least minor it needs, or `next`, the pre-releases of the next stable release.",
164
- "markdownDescription": "The API a game is written against: `M.m`, a major and the least minor it\nneeds, or `next`, the pre-releases of the next stable release.",
165
- "pattern": "^(?:(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)|next)$",
166
- "errorMessage": "must be the API the game is written against, like \"1.0\", or \"next\""
167
- },
168
- "Orientation": {
169
- "type": "string",
170
- "enum": [
171
- "portrait",
172
- "landscape",
173
- "any"
174
- ],
175
- "description": "How the game wants to be held. The host decides what to do about it.",
176
- "markdownDescription": "How the game wants to be held. The host decides what to do about it."
177
- },
178
- "LayoutDeclaration": {
179
- "type": "object",
180
- "properties": {
181
- "insets": {
182
- "$ref": "#/definitions/InsetMode"
183
- }
184
- },
185
- "required": [
186
- "insets"
187
- ],
188
- "additionalProperties": false,
189
- "description": "What a game declares about layout. Absent means every default.",
190
- "markdownDescription": "What a game declares about layout. Absent means every default."
191
- },
192
- "InsetMode": {
193
- "type": "string",
194
- "enum": [
195
- "draw-under",
196
- "reserve"
197
- ],
198
- "description": "Whether the host may put its own furniture over the game's frame.\n\nThe one layout question that has to be answered before the bundle runs, which is why it is declared here rather than asked at runtime: the host sizes the frame before there is a game to ask. A game that says nothing gets `reserve`, so a rail never lands on the buttons of something written before rails existed.",
199
- "markdownDescription": "Whether the host may put its own furniture over the game's frame.\n\nThe one layout question that has to be answered before the bundle runs, which\nis why it is declared here rather than asked at runtime: the host sizes the\nframe before there is a game to ask. A game that says nothing gets `reserve`,\nso a rail never lands on the buttons of something written before rails\nexisted."
200
- },
201
- "AnalyticsDeclaration": {
202
- "type": "object",
203
- "properties": {
204
- "events": {
205
- "type": "object",
206
- "additionalProperties": {
207
- "$ref": "#/definitions/AnalyticsShape"
208
- },
209
- "description": "Every event the game may send, by name.\n\nNames starting `hopple.` are the host's own records and not a game's to use. The grammar is the wire's too: `@hopple/protocol` enforces the same one, and a test keeps the two in step. At most 64 events: the wire never sees a declaration, so nothing enforces this at runtime and nothing has to.",
210
- "markdownDescription": "Every event the game may send, by name.\n\nNames starting `hopple.` are the host's own records and not a game's to\nuse. The grammar is the wire's too: `@hopple/protocol` enforces the same\none, and a test keeps the two in step. At most 64 events: the wire never\nsees a declaration, so nothing enforces this at runtime and nothing has to.",
211
- "maxProperties": 64,
212
- "propertyNames": {
213
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
214
- "maxLength": 48,
215
- "not": {
216
- "pattern": "^hopple\\."
217
- },
218
- "errorMessage": "must be lowercase letters, digits, dots, hyphens and underscores, and must not start with \"hopple.\", which the host uses"
219
- }
220
- }
221
- },
222
- "required": [
223
- "events"
224
- ],
225
- "additionalProperties": false,
226
- "description": "The custom events a game sends, and what each one carries.\n\n**The first key here whose reader is not the host.** `layout.insets` is declared because a frame has to be sized before there is a game to ask; nothing about analytics has to be answered before the bundle runs. What earns this its place is cardinality: names and columns invented at runtime make a pipe nobody can build a table for, and the party that has to build that table — the publish CLI, the server, a creator dashboard — is exactly the party that already reads the manifest and never talks to a game.\n\n**Every prop is optional and nothing is required**, which is what keeps the declaration cheap enough to be worth asking for: forgetting one costs a column rather than the event. The additive rule carries over unchanged — add events, add props, never retype one — and that is the whole of what a per-event table needs to survive the game's next version.",
227
- "markdownDescription": "The custom events a game sends, and what each one carries.\n\n**The first key here whose reader is not the host.** `layout.insets` is\ndeclared because a frame has to be sized before there is a game to ask;\nnothing about analytics has to be answered before the bundle runs. What earns\nthis its place is cardinality: names and columns invented at runtime make a\npipe nobody can build a table for, and the party that has to build that table\n— the publish CLI, the server, a creator dashboard — is exactly the party that\nalready reads the manifest and never talks to a game.\n\n**Every prop is optional and nothing is required**, which is what keeps the\ndeclaration cheap enough to be worth asking for: forgetting one costs a column\nrather than the event. The additive rule carries over unchanged — add events,\nadd props, never retype one — and that is the whole of what a per-event table\nneeds to survive the game's next version."
228
- },
229
- "AnalyticsShape": {
230
- "type": "object",
231
- "additionalProperties": {
232
- "$ref": "#/definitions/AnalyticsType"
233
- },
234
- "description": "One event's props. Every one optional: see `AnalyticsDeclaration`.\n\nProp names follow the grammar event names do, which `@hopple/protocol` enforces on the wire too; a test keeps the two in step.",
235
- "markdownDescription": "One event's props. Every one optional: see `AnalyticsDeclaration`.\n\nProp names follow the grammar event names do, which `@hopple/protocol`\nenforces on the wire too; a test keeps the two in step.",
236
- "maxProperties": 8,
237
- "propertyNames": {
238
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
239
- "maxLength": 24,
240
- "errorMessage": "must be a prop name of lowercase letters, digits, dots, hyphens and underscores"
241
- }
242
- },
243
- "AnalyticsType": {
244
- "type": "string",
245
- "enum": [
246
- "string",
247
- "number",
248
- "boolean"
249
- ],
250
- "description": "What a prop may hold, as one word. The three the wire carries, and no more.",
251
- "markdownDescription": "What a prop may hold, as one word. The three the wire carries, and no more."
252
- },
253
- "SaveDeclaration": {
254
- "type": "object",
255
- "properties": {
256
- "bytes": {
257
- "type": "integer",
258
- "description": "At most 1 MiB. Not the same question as what a host will take — that is the host's and is settled at the handshake. This is only what is worth writing down: a declaration in the megabytes is a game that has misunderstood what this is for, and finding that out at publish time is cheaper than at a player's.",
259
- "markdownDescription": "At most 1 MiB. Not the same question as what a host will take — that is\nthe host's and is settled at the handshake. This is only what is worth\nwriting down: a declaration in the megabytes is a game that has\nmisunderstood what this is for, and finding that out at publish time is\ncheaper than at a player's.",
260
- "exclusiveMinimum": 0,
261
- "maximum": 1048576
262
- }
263
- },
264
- "required": [
265
- "bytes"
266
- ],
267
- "additionalProperties": false,
268
- "description": "What a game expects to keep, in bytes.\n\n**The manifest's own test is whether the host must know before the bundle runs**, and here it must: a host that prefetches a save from a server has to know which games have one before there is a game to ask, and a publish pipeline that provisions storage has to know before a player exists.\n\nThe budget the game expects, not a grant. A host answers with its own cap at the handshake, and a game with no key here may still call the API — it just gets nothing prefetched, which is the honest reading of not having said so.",
269
- "markdownDescription": "What a game expects to keep, in bytes.\n\n**The manifest's own test is whether the host must know before the bundle\nruns**, and here it must: a host that prefetches a save from a server has to\nknow which games have one before there is a game to ask, and a publish\npipeline that provisions storage has to know before a player exists.\n\nThe budget the game expects, not a grant. A host answers with its own cap at\nthe handshake, and a game with no key here may still call the API — it just\ngets nothing prefetched, which is the honest reading of not having said so."
270
- },
271
- "ScoreDeclaration": {
272
- "type": "object",
273
- "properties": {
274
- "boards": {
275
- "type": "object",
276
- "additionalProperties": {
277
- "$ref": "#/definitions/ScoreBoard"
278
- },
279
- "description": "The boards, by id. At least one: a `score` key with no boards is a game that meant to declare one and did not, and reading it as \"no boards\" would hand it a scoreboard tab with nothing behind it. The id grammar is the wire's too, and a test keeps the two in step.",
280
- "markdownDescription": "The boards, by id. At least one: a `score` key with no boards is a game\nthat meant to declare one and did not, and reading it as \"no boards\" would\nhand it a scoreboard tab with nothing behind it. The id grammar is the\nwire's too, and a test keeps the two in step.",
281
- "minProperties": 1,
282
- "maxProperties": 16,
283
- "propertyNames": {
284
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
285
- "maxLength": 48,
286
- "errorMessage": "must be lowercase letters, digits, dots, hyphens and underscores"
287
- }
288
- }
289
- },
290
- "required": [
291
- "boards"
292
- ],
293
- "additionalProperties": false,
294
- "description": "The boards this game keeps a score on.\n\n**A map from the first version, even for a game that wants one board.** The board id travels in `score.submit`, which is frozen game-side code, and a single-board key would have to *change meaning* to grow a second one — the one thing the additive rule forbids. A map costs a game with one board the few characters of naming it, and costs a game with four nothing at all.\n\n**Read by the host and by the server**, which is what earns it a key rather than a runtime call: a client draws a game's board in a sheet over a feed without ever having run that game, and the server has to know how a board sorts before it can answer a query about one.",
295
- "markdownDescription": "The boards this game keeps a score on.\n\n**A map from the first version, even for a game that wants one board.** The\nboard id travels in `score.submit`, which is frozen game-side code, and a\nsingle-board key would have to *change meaning* to grow a second one — the\none thing the additive rule forbids. A map costs a game with one board the\nfew characters of naming it, and costs a game with four nothing at all.\n\n**Read by the host and by the server**, which is what earns it a key rather\nthan a runtime call: a client draws a game's board in a sheet over a feed\nwithout ever having run that game, and the server has to know how a board\nsorts before it can answer a query about one."
296
- },
297
- "ScoreBoard": {
298
- "type": "object",
299
- "properties": {
300
- "title": {
301
- "type": "string",
302
- "description": "What to call it in front of a player.",
303
- "markdownDescription": "What to call it in front of a player.",
304
- "pattern": "\\S",
305
- "maxLength": 40,
306
- "errorMessage": "must not be blank"
307
- },
308
- "direction": {
309
- "$ref": "#/definitions/ScoreDirection"
310
- },
311
- "format": {
312
- "$ref": "#/definitions/ScoreFormat",
313
- "description": "See `ScoreFormat`. Absent means `integer`.",
314
- "markdownDescription": "See `ScoreFormat`. Absent means `integer`."
315
- }
316
- },
317
- "required": [
318
- "title",
319
- "direction"
320
- ],
321
- "additionalProperties": false
322
- },
323
- "ScoreDirection": {
324
- "type": "string",
325
- "enum": [
326
- "asc",
327
- "desc"
328
- ],
329
- "description": "Which way a board sorts — the one thing about a score that cannot be guessed.\n\n`desc` is the ordinary leaderboard, where more is better. `asc` is a time, a stroke count, a number of moves. Nothing downstream can infer this from the values it holds, and a client that guessed would render a time board upside down, so it is required rather than defaulted.",
330
- "markdownDescription": "Which way a board sorts — the one thing about a score that cannot be guessed.\n\n`desc` is the ordinary leaderboard, where more is better. `asc` is a time, a\nstroke count, a number of moves. Nothing downstream can infer this from the\nvalues it holds, and a client that guessed would render a time board upside\ndown, so it is required rather than defaulted."
331
- },
332
- "ScoreFormat": {
333
- "type": "string",
334
- "enum": [
335
- "integer",
336
- "decimal",
337
- "duration-ms"
338
- ],
339
- "description": "How to draw the number.\n\nA client renders a board for a game it has never run, so it cannot ask the game what `224310` means. `integer` is a count, `decimal` a measurement, `duration-ms` a time to be written as minutes and seconds. Absent is `integer`, which is what most boards are.",
340
- "markdownDescription": "How to draw the number.\n\nA client renders a board for a game it has never run, so it cannot ask the\ngame what `224310` means. `integer` is a count, `decimal` a measurement,\n`duration-ms` a time to be written as minutes and seconds. Absent is\n`integer`, which is what most boards are."
341
- },
342
- "AchievementDeclaration": {
343
- "type": "object",
344
- "properties": {
345
- "list": {
346
- "type": "object",
347
- "additionalProperties": {
348
- "$ref": "#/definitions/Achievement"
349
- },
350
- "description": "The achievements, by id. At least one: an `achievements` key with nothing in it is a game that meant to declare one and did not. The id grammar is the wire's too, and a test keeps the two in step.",
351
- "markdownDescription": "The achievements, by id. At least one: an `achievements` key with nothing\nin it is a game that meant to declare one and did not. The id grammar is\nthe wire's too, and a test keeps the two in step.",
352
- "minProperties": 1,
353
- "maxProperties": 128,
354
- "propertyNames": {
355
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
356
- "maxLength": 48,
357
- "errorMessage": "must be lowercase letters, digits, dots, hyphens and underscores"
358
- }
359
- }
360
- },
361
- "required": [
362
- "list"
363
- ],
364
- "additionalProperties": false,
365
- "description": "The achievements this game keeps for a player.\n\n**A map, for the reason `score.boards` is one**: the id travels in `achievement.unlock`, which is frozen game-side code, so the shape has to hold a second entry without anything changing meaning.\n\n**Read by the host, by the client and by the server, and by none of them from the game.** The site draws this panel for a game sitting in the feed that has never been run; the server refuses an id no publisher declared. That is what earns a manifest key rather than a runtime call — the same test `score` passed.",
366
- "markdownDescription": "The achievements this game keeps for a player.\n\n**A map, for the reason `score.boards` is one**: the id travels in\n`achievement.unlock`, which is frozen game-side code, so the shape has to\nhold a second entry without anything changing meaning.\n\n**Read by the host, by the client and by the server, and by none of them from\nthe game.** The site draws this panel for a game sitting in the feed that has\nnever been run; the server refuses an id no publisher declared. That is what\nearns a manifest key rather than a runtime call — the same test `score`\npassed."
367
- },
368
- "Achievement": {
369
- "type": "object",
370
- "properties": {
371
- "title": {
372
- "type": "string",
373
- "description": "What to call it in front of a player.",
374
- "markdownDescription": "What to call it in front of a player.",
375
- "pattern": "\\S",
376
- "maxLength": 40,
377
- "errorMessage": "must not be blank"
378
- },
379
- "detail": {
380
- "type": "string",
381
- "description": "One line under the title, saying what it takes.",
382
- "markdownDescription": "One line under the title, saying what it takes.",
383
- "pattern": "\\S",
384
- "maxLength": 120,
385
- "errorMessage": "must not be blank"
386
- },
387
- "icon": {
388
- "type": "string",
389
- "description": "A short glyph to draw beside it — an emoji, usually. Eight characters is enough for an emoji with a modifier on it.",
390
- "markdownDescription": "A short glyph to draw beside it — an emoji, usually. Eight characters is\nenough for an emoji with a modifier on it.",
391
- "pattern": "\\S",
392
- "maxLength": 8,
393
- "errorMessage": "must not be blank"
394
- },
395
- "secret": {
396
- "type": "boolean",
397
- "description": "Whether the words are withheld until it is unlocked. See above.",
398
- "markdownDescription": "Whether the words are withheld until it is unlocked. See above."
399
- },
400
- "progress": {
401
- "$ref": "#/definitions/AchievementProgress",
402
- "description": "Present makes this measured rather than flagged. See `AchievementProgress`.",
403
- "markdownDescription": "Present makes this measured rather than flagged. See `AchievementProgress`."
404
- }
405
- },
406
- "required": [
407
- "title"
408
- ],
409
- "additionalProperties": false,
410
- "description": "One thing a player can be shown to have done.\n\n**Two kinds, told apart by one key.** Without `progress` this is a flag: it happens once, and saying so twice is the same fact twice. With `progress` it is measured — a count, a distance, a best time — reported as the game goes and unlocked when the value reaches the target.\n\n**`secret` withholds the words, never the row.** A secret achievement is listed while it is locked, so a player can see there is one left, with its title and detail held back until it is theirs. Hiding the row itself would make the list's length change under the player, which reads as a bug rather than as a surprise. It is a courtesy of the panel and not a secret kept from the machine: the manifest ships beside the bundle and is public, so anybody who wants the words already has them.",
411
- "markdownDescription": "One thing a player can be shown to have done.\n\n**Two kinds, told apart by one key.** Without `progress` this is a flag: it\nhappens once, and saying so twice is the same fact twice. With `progress` it\nis measured — a count, a distance, a best time — reported as the game goes\nand unlocked when the value reaches the target.\n\n**`secret` withholds the words, never the row.** A secret achievement is\nlisted while it is locked, so a player can see there is one left, with its\ntitle and detail held back until it is theirs. Hiding the row itself would\nmake the list's length change under the player, which reads as a bug rather\nthan as a surprise. It is a courtesy of the panel and not a secret kept from\nthe machine: the manifest ships beside the bundle and is public, so anybody\nwho wants the words already has them."
412
- },
413
- "AchievementProgress": {
414
- "type": "object",
415
- "properties": {
416
- "target": {
417
- "type": "number",
418
- "description": "The value that unlocks it. Reaching it is the whole of being unlocked.\n\nBounded by `Number.MAX_SAFE_INTEGER`, for the reason `SCORE_VALUE_MAX` is: past there a whole number stops round-tripping through JSON and through a 64-bit column, and progress toward a target nobody can reproduce is progress nobody can draw.",
419
- "markdownDescription": "The value that unlocks it. Reaching it is the whole of being unlocked.\n\nBounded by `Number.MAX_SAFE_INTEGER`, for the reason `SCORE_VALUE_MAX` is:\npast there a whole number stops round-tripping through JSON and through a\n64-bit column, and progress toward a target nobody can reproduce is\nprogress nobody can draw.",
420
- "minimum": -9007199254740991,
421
- "maximum": 9007199254740991
422
- },
423
- "direction": {
424
- "$ref": "#/definitions/ScoreDirection",
425
- "description": "Which way is better. Absent is `desc`: more is better.",
426
- "markdownDescription": "Which way is better. Absent is `desc`: more is better."
427
- },
428
- "format": {
429
- "$ref": "#/definitions/ScoreFormat",
430
- "description": "How to draw the value. Absent is `integer`.",
431
- "markdownDescription": "How to draw the value. Absent is `integer`."
432
- },
433
- "tiers": {
434
- "type": "array",
435
- "items": {
436
- "$ref": "#/definitions/AchievementTier"
437
- },
438
- "description": "Named milestones on the way, ordered toward the target.",
439
- "markdownDescription": "Named milestones on the way, ordered toward the target.",
440
- "maxItems": 8
441
- }
442
- },
443
- "required": [
444
- "target"
445
- ],
446
- "additionalProperties": false,
447
- "description": "What makes an achievement measured rather than flagged.\n\n**`direction` is the one thing that cannot be guessed**, exactly as it cannot be guessed for a board. `desc` — the default, and what most achievements are — counts up to the target: *break 100 blocks*. `asc` counts down to it:\n*finish under two minutes*, where the value kept is the player's best time and a smaller one beats a larger. A panel that assumed bigger-is-better would draw a stopwatch achievement as though every slow run were progress.\n\n**`format` is how to draw the number**, for the reason a board needs one: whoever renders this has never run the game and cannot ask it what `112400` means.\n\nBoth are `ScoreDirection` and `ScoreFormat` rather than types of their own. \"Which way is better\" and \"how is this number written\" are the same two questions wherever they are asked, and a second spelling of each is two vocabularies to keep in step and one bug when they drift.",
448
- "markdownDescription": "What makes an achievement measured rather than flagged.\n\n**`direction` is the one thing that cannot be guessed**, exactly as it cannot\nbe guessed for a board. `desc` — the default, and what most achievements are\n— counts up to the target: *break 100 blocks*. `asc` counts down to it:\n*finish under two minutes*, where the value kept is the player's best time\nand a smaller one beats a larger. A panel that assumed bigger-is-better would\ndraw a stopwatch achievement as though every slow run were progress.\n\n**`format` is how to draw the number**, for the reason a board needs one:\nwhoever renders this has never run the game and cannot ask it what `112400`\nmeans.\n\nBoth are `ScoreDirection` and `ScoreFormat` rather than types of their own.\n\"Which way is better\" and \"how is this number written\" are the same two\nquestions wherever they are asked, and a second spelling of each is two\nvocabularies to keep in step and one bug when they drift."
449
- },
450
- "AchievementTier": {
451
- "type": "object",
452
- "properties": {
453
- "at": {
454
- "type": "number",
455
- "description": "The reported value this tier is reached at, on the near side of the target.",
456
- "markdownDescription": "The reported value this tier is reached at, on the near side of the target.",
457
- "minimum": -9007199254740991,
458
- "maximum": 9007199254740991
459
- },
460
- "title": {
461
- "type": "string",
462
- "description": "What to call the player who has reached it.",
463
- "markdownDescription": "What to call the player who has reached it.",
464
- "pattern": "\\S",
465
- "maxLength": 40,
466
- "errorMessage": "must not be blank"
467
- },
468
- "icon": {
469
- "type": "string",
470
- "description": "A glyph for this tier, where it wants its own.",
471
- "markdownDescription": "A glyph for this tier, where it wants its own.",
472
- "pattern": "\\S",
473
- "maxLength": 8,
474
- "errorMessage": "must not be blank"
475
- }
476
- },
477
- "required": [
478
- "at",
479
- "title"
480
- ],
481
- "additionalProperties": false,
482
- "description": "One named step on the way to a measured achievement's target.\n\n**A tier is a label, never a second achievement.** The achievement is unlocked at its `target` and nowhere else; a tier is what a panel calls the player between here and there — *Silver, 50 of 100*. Modelling each tier as its own id would be three rows in every board that draws them and three unlocks a game has to remember to send, where this is one number reported once and read three ways.",
483
- "markdownDescription": "One named step on the way to a measured achievement's target.\n\n**A tier is a label, never a second achievement.** The achievement is\nunlocked at its `target` and nowhere else; a tier is what a panel calls the\nplayer between here and there — *Silver, 50 of 100*. Modelling each tier as\nits own id would be three rows in every board that draws them and three\nunlocks a game has to remember to send, where this is one number reported\nonce and read three ways."
484
- },
485
- "InputDeclaration": {
486
- "type": "object",
487
- "properties": {
488
- "supported": {
489
- "type": "array",
490
- "items": {
491
- "$ref": "#/definitions/InputDeviceSet"
492
- },
493
- "description": "The sets of hardware this game can be played with: any one set, every member of which must be present.\n\nA flat list of alternatives rather than a tree of `any` and `all`. Every real answer is a handful of alternatives, and this one renders straight into\n*needs a keyboard and a mouse* without anybody having written a solver.\n\n**The publisher's claim, taken at its word**, exactly as `orientation` is: nothing here checks it against the bindings. It cannot be checked. A game is free to read the platform directly — raw key events, an accelerometer, a microphone — and that is a stated allowance rather than an oversight, so what a game *binds* never implies what it can be played with.",
494
- "markdownDescription": "The sets of hardware this game can be played with: any one set, every\nmember of which must be present.\n\nA flat list of alternatives rather than a tree of `any` and `all`. Every\nreal answer is a handful of alternatives, and this one renders straight into\n*needs a keyboard and a mouse* without anybody having written a solver.\n\n**The publisher's claim, taken at its word**, exactly as `orientation` is:\nnothing here checks it against the bindings. It cannot be checked. A game is\nfree to read the platform directly — raw key events, an accelerometer, a\nmicrophone — and that is a stated allowance rather than an oversight, so\nwhat a game *binds* never implies what it can be played with.",
495
- "minItems": 1,
496
- "maxItems": 8
497
- },
498
- "actions": {
499
- "type": "object",
500
- "additionalProperties": {
501
- "$ref": "#/definitions/InputAction"
502
- },
503
- "description": "The actions, by id.",
504
- "markdownDescription": "The actions, by id.",
505
- "maxProperties": 64,
506
- "propertyNames": {
507
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
508
- "maxLength": 48,
509
- "errorMessage": "must be lowercase letters, digits, dots, hyphens and underscores"
510
- }
511
- },
512
- "controls": {
513
- "type": "object",
514
- "additionalProperties": {
515
- "$ref": "#/definitions/ControlLayout"
516
- },
517
- "description": "Named arrangements of on-screen controls. See `ControlLayout`.",
518
- "markdownDescription": "Named arrangements of on-screen controls. See `ControlLayout`.",
519
- "maxProperties": 8,
520
- "propertyNames": {
521
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
522
- "maxLength": 48,
523
- "errorMessage": "must be a layout name of lowercase letters, digits, dots, hyphens and underscores"
524
- }
525
- },
526
- "player": {
527
- "$ref": "#/definitions/PlayerInputDeclaration",
528
- "description": "What each local player does, beside `actions`, which are everybody's. See `PlayerInputDeclaration`.",
529
- "markdownDescription": "What each local player does, beside `actions`, which are everybody's. See\n`PlayerInputDeclaration`."
530
- }
531
- },
532
- "additionalProperties": false,
533
- "description": "What a game says about how it is played.\n\n**It passes the manifest's test twice.** The host must know before the bundle runs — whether on-screen controls apply at all, and what a remapping screen offers, are settled before there is a game to ask — and it is read by parties that never run the game: a feed deciding whether to show a keyboard-only game to somebody holding a phone, and a remapping screen opened from outside a run.\n\nAction, control and layout ids follow the grammar the wire does, and a test keeps the two in step.",
534
- "markdownDescription": "What a game says about how it is played.\n\n**It passes the manifest's test twice.** The host must know before the bundle\nruns — whether on-screen controls apply at all, and what a remapping screen\noffers, are settled before there is a game to ask — and it is read by parties\nthat never run the game: a feed deciding whether to show a keyboard-only game\nto somebody holding a phone, and a remapping screen opened from outside a run.\n\nAction, control and layout ids follow the grammar the wire does, and a test\nkeeps the two in step."
535
- },
536
- "InputDeviceSet": {
537
- "type": "array",
538
- "items": {
539
- "$ref": "#/definitions/InputDevice"
540
- },
541
- "description": "One set of devices that together are enough to play.",
542
- "markdownDescription": "One set of devices that together are enough to play.",
543
- "minItems": 1,
544
- "maxItems": 8
545
- },
546
- "InputDevice": {
547
- "type": "string",
548
- "enum": [
549
- "keyboard",
550
- "mouse",
551
- "touch",
552
- "gamepad"
553
- ],
554
- "description": "A device a game can be played with, as one word.\n\nHardware rather than API surface: `mouse` and `touch` are separate words even though a game reads both through one pointer, because what a *client* does with this is decide whether to put a game in front of somebody who has no way to play it.",
555
- "markdownDescription": "A device a game can be played with, as one word.\n\nHardware rather than API surface: `mouse` and `touch` are separate words even\nthough a game reads both through one pointer, because what a *client* does\nwith this is decide whether to put a game in front of somebody who has no way\nto play it."
556
- },
557
- "InputAction": {
558
- "type": "object",
559
- "properties": {
560
- "bind": {
561
- "$ref": "#/definitions/InputBindings",
562
- "description": "What presses it. See `InputBinding` for the vocabulary.",
563
- "markdownDescription": "What presses it. See `InputBinding` for the vocabulary."
564
- },
565
- "title": {
566
- "type": "string",
567
- "description": "What to call it in front of a player, in a remapping screen.",
568
- "markdownDescription": "What to call it in front of a player, in a remapping screen.",
569
- "pattern": "\\S",
570
- "maxLength": 40,
571
- "errorMessage": "must not be blank"
572
- },
573
- "label": {
574
- "type": "string",
575
- "description": "What to draw on an on-screen button: a glyph, or a letter.",
576
- "markdownDescription": "What to draw on an on-screen button: a glyph, or a letter.",
577
- "pattern": "\\S",
578
- "maxLength": 8,
579
- "errorMessage": "must not be blank"
580
- }
581
- },
582
- "required": [
583
- "bind"
584
- ],
585
- "additionalProperties": false,
586
- "description": "One thing a player does, named by the game and bound to whatever produces it.\n\n**An action is a button and never an axis.** A key, a face button on a pad, a pointer button and an on-screen button all press the same action, because from the game's side they are the same event. A thumbstick is not one of those and is read through its own API — folding the two together would put a range on every binding that mostly does not have one, and would leave a game unable to say whether it meant the press or the lean.\n\n**An object rather than a bare list of bindings**, from the first version, because two strings are wanted the moment anybody draws this: a `title` for the remapping screen, which shows actions to a player and cannot show `move.left`, and a `label` for the face of an on-screen button. Growing a list into an object later would change what an action's value *is*, which is the one move the additive rule forbids. Only the object is accepted, even for an action that needs neither string: one way to write an action is one way to read it.",
587
- "markdownDescription": "One thing a player does, named by the game and bound to whatever produces it.\n\n**An action is a button and never an axis.** A key, a face button on a pad, a\npointer button and an on-screen button all press the same action, because\nfrom the game's side they are the same event. A thumbstick is not one of\nthose and is read through its own API — folding the two together would put a\nrange on every binding that mostly does not have one, and would leave a game\nunable to say whether it meant the press or the lean.\n\n**An object rather than a bare list of bindings**, from the first version,\nbecause two strings are wanted the moment anybody draws this: a `title` for\nthe remapping screen, which shows actions to a player and cannot show\n`move.left`, and a `label` for the face of an on-screen button. Growing a\nlist into an object later would change what an action's value *is*, which is\nthe one move the additive rule forbids. Only the object is accepted, even for\nan action that needs neither string: one way to write an action is one way to\nread it."
588
- },
589
- "InputBindings": {
590
- "type": "array",
591
- "items": {
592
- "$ref": "#/definitions/InputBinding"
593
- },
594
- "description": "What presses an action: at least one binding, and at most 8.",
595
- "markdownDescription": "What presses an action: at least one binding, and at most 8.",
596
- "minItems": 1,
597
- "maxItems": 8
598
- },
599
- "InputBinding": {
600
- "type": "string",
601
- "description": "A name for something that can *press* an action.\n\n`key.<code>` names a physical key by `KeyboardEvent.code` — **the code and never the character**. `KeyA` is the key where A sits on a US keyboard and stays that key on AZERTY, where it types Q, so a game that binds movement to codes has WASD under the same four fingers everywhere. `Escape` is the host's: it leaves fullscreen and pointer lock, which are invisible from inside the frame, and a game that bound it would lose that fight quietly on every press.\n\n`pad.south` is the south of either cluster: the face button on one pad and the d-pad's down on another, which is what makes one binding cover both. Compass words for both clusters, with no `pad.dpad.down` alias beside `pad.left.south` — a vocabulary that can never shrink should not start out doubled. A thumbstick is not one of these; see `InputStick`.",
602
- "markdownDescription": "A name for something that can *press* an action.\n\n`key.<code>` names a physical key by `KeyboardEvent.code` — **the code and\nnever the character**. `KeyA` is the key where A sits on a US keyboard and\nstays that key on AZERTY, where it types Q, so a game that binds movement to\ncodes has WASD under the same four fingers everywhere. `Escape` is the host's:\nit leaves fullscreen and pointer lock, which are invisible from inside the\nframe, and a game that bound it would lose that fight quietly on every press.\n\n`pad.south` is the south of either cluster: the face button on one pad and the\nd-pad's down on another, which is what makes one binding cover both. Compass\nwords for both clusters, with no `pad.dpad.down` alias beside\n`pad.left.south` — a vocabulary that can never shrink should not start out\ndoubled. A thumbstick is not one of these; see `InputStick`.",
603
- "pattern": "^(?:key\\.(?!Escape$)(?=.{1,48}$)[A-Za-z][A-Za-z0-9]*|pointer\\.(?:primary|secondary)|mouse\\.(?:left|middle|right)|touch\\.tap|controls\\.(?=.{1,48}$)[a-z0-9]+(?:[_-][a-z0-9]+)*|pad\\.(?:north|south|east|west|start|select)|pad\\.(?:left|right)\\.(?:north|south|east|west|bumper|trigger))$",
604
- "errorMessage": "is not a binding this SDK knows (a thumbstick is read rather than bound, and Escape is the host's key)"
605
- },
606
- "ControlLayout": {
607
- "type": "object",
608
- "properties": {
609
- "left": {
610
- "$ref": "#/definitions/ControlZoneSlots"
611
- },
612
- "right": {
613
- "$ref": "#/definitions/ControlZoneSlots"
614
- },
615
- "full": {
616
- "$ref": "#/definitions/ControlZoneSlots"
617
- }
618
- },
619
- "additionalProperties": false,
620
- "description": "One named arrangement of on-screen controls.\n\nA game may declare several and switch between them — a menu wants different controls from play, and a driving section different ones again — which is why they are named rather than there being one. A zone nobody knows is a layout from a newer minor, which a host reads leniently, so whoever draws it simply has nowhere to put it.",
621
- "markdownDescription": "One named arrangement of on-screen controls.\n\nA game may declare several and switch between them — a menu wants different\ncontrols from play, and a driving section different ones again — which is why\nthey are named rather than there being one. A zone nobody knows is a layout\nfrom a newer minor, which a host reads leniently, so whoever draws it simply\nhas nowhere to put it."
622
- },
623
- "ControlZoneSlots": {
624
- "type": "object",
625
- "additionalProperties": {
626
- "$ref": "#/definitions/ControlSlot"
627
- },
628
- "description": "The controls in one zone of a layout, by id.",
629
- "markdownDescription": "The controls in one zone of a layout, by id.",
630
- "maxProperties": 8,
631
- "propertyNames": {
632
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
633
- "maxLength": 48,
634
- "errorMessage": "must be a control id of lowercase letters, digits, dots, hyphens and underscores"
635
- }
636
- },
637
- "ControlSlot": {
638
- "type": "object",
639
- "properties": {
640
- "type": {
641
- "type": "string",
642
- "enum": [
643
- "buttons",
644
- "thumbstick"
645
- ]
646
- },
647
- "buttons": {
648
- "type": "array",
649
- "items": {
650
- "type": "string"
651
- },
652
- "description": "`buttons` only: the actions this control presses, in drawing order.",
653
- "markdownDescription": "`buttons` only: the actions this control presses, in drawing order.",
654
- "minItems": 1,
655
- "maxItems": 8
656
- },
657
- "shape": {
658
- "$ref": "#/definitions/ControlShape",
659
- "description": "`buttons` only. See `ControlShape`. Absent is `column`.",
660
- "markdownDescription": "`buttons` only. See `ControlShape`. Absent is `column`."
661
- },
662
- "as": {
663
- "anyOf": [
664
- {
665
- "$ref": "#/definitions/InputStick"
666
- },
667
- {
668
- "type": "object",
669
- "additionalProperties": {
670
- "$ref": "#/definitions/InputBinding"
671
- }
672
- }
673
- ],
674
- "description": "What this control stands in for on a standard pad.\n\nOn a thumbstick it is the stick id a game reads — `pad.left.stick` — so one `onStick` sees the physical stick and this one alike. Left out, the stick is only itself, which a game reads as `controls.<id>`. On a group of buttons it is a map from action to standard button, optional and rarely wanted: a game whose bindings already name `pad.south` needs nothing here, and this is for one that also wants the low-level path to see the press.",
675
- "markdownDescription": "What this control stands in for on a standard pad.\n\nOn a thumbstick it is the stick id a game reads — `pad.left.stick` — so one\n`onStick` sees the physical stick and this one alike. Left out, the stick is\nonly itself, which a game reads as `controls.<id>`. On a group of buttons it\nis a map from action to standard button, optional and rarely wanted: a game\nwhose bindings already name `pad.south` needs nothing here, and this is for\none that also wants the low-level path to see the press."
676
- },
677
- "axis": {
678
- "$ref": "#/definitions/ControlAxis",
679
- "description": "`thumbstick` only. See `ControlAxis`. Absent, the stick moves both ways.",
680
- "markdownDescription": "`thumbstick` only. See `ControlAxis`. Absent, the stick moves both ways."
681
- }
682
- },
683
- "required": [
684
- "type"
685
- ],
686
- "additionalProperties": false,
687
- "description": "One on-screen control: a group of buttons, or a thumbstick.\n\n**A button slot names an action; a stick slot names a stick.** The asymmetry is the hardware's. On-screen buttons have no fixed count or position — three across, five down, four in a diamond — so there is no standard control to unify them with, and the action is the only stable name they have. Thumbsticks come in twos and everybody agrees which is which, so a virtual one says which it stands for and a game reads the physical stick and this one through one id.\n\nThere is no d-pad here. A d-pad is four buttons wherever it exists — four entries on the wire from a real pad, four keys on a keyboard — so a layout that wants one declares four buttons and binds them like anything else.",
688
- "markdownDescription": "One on-screen control: a group of buttons, or a thumbstick.\n\n**A button slot names an action; a stick slot names a stick.** The asymmetry\nis the hardware's. On-screen buttons have no fixed count or position — three\nacross, five down, four in a diamond — so there is no standard control to\nunify them with, and the action is the only stable name they have. Thumbsticks\ncome in twos and everybody agrees which is which, so a virtual one says which\nit stands for and a game reads the physical stick and this one through one id.\n\nThere is no d-pad here. A d-pad is four buttons wherever it exists — four\nentries on the wire from a real pad, four keys on a keyboard — so a layout\nthat wants one declares four buttons and binds them like anything else.",
689
- "if": {
690
- "properties": {
691
- "type": {
692
- "const": "buttons"
693
- }
694
- },
695
- "required": [
696
- "type"
697
- ]
698
- },
699
- "then": {
700
- "required": [
701
- "buttons"
702
- ],
703
- "properties": {
704
- "as": {
705
- "type": "object",
706
- "additionalProperties": {
707
- "$ref": "#/definitions/InputBinding"
708
- }
709
- },
710
- "axis": {
711
- "not": {},
712
- "errorMessage": "is only for a thumbstick"
713
- }
714
- }
715
- },
716
- "else": {
717
- "properties": {
718
- "as": {
719
- "$ref": "#/definitions/InputStick"
720
- }
721
- }
722
- }
723
- },
724
- "ControlShape": {
725
- "type": "string",
726
- "enum": [
727
- "row",
728
- "column",
729
- "diamond",
730
- "cluster"
731
- ],
732
- "description": "How a group of on-screen buttons is arranged.\n\nArrangement only, with the count doing the rest, so three across and five down need no words of their own. **A shape nobody recognises is drawn as a `column`** — the same escape `Obstruction.reserved` is. Whoever renders these may be older than the game that declared them, and a control that fails to appear is a game that cannot be played at all. It is still refused at publish, where saying so is cheap.",
733
- "markdownDescription": "How a group of on-screen buttons is arranged.\n\nArrangement only, with the count doing the rest, so three across and five\ndown need no words of their own. **A shape nobody recognises is drawn as a\n`column`** — the same escape `Obstruction.reserved` is. Whoever renders these\nmay be older than the game that declared them, and a control that fails to\nappear is a game that cannot be played at all. It is still refused at\npublish, where saying so is cheap."
734
- },
735
- "InputStick": {
736
- "type": "string",
737
- "description": "A name for a thumbstick — something a game reads, never binds.",
738
- "markdownDescription": "A name for a thumbstick — something a game reads, never binds.",
739
- "pattern": "^(?:controls\\.(?=.{1,48}$)[a-z0-9]+(?:[_-][a-z0-9]+)*|pad\\.stick|pad\\.(?:left|right)\\.stick)$",
740
- "errorMessage": "must name a thumbstick, such as pad.left.stick"
741
- },
742
- "ControlAxis": {
743
- "type": "string",
744
- "enum": [
745
- "x",
746
- "y"
747
- ],
748
- "description": "The one direction an on-screen thumbstick moves in: `x` across, `y` up and down.\n\nFor a game that steers along one line — a runner sliding left and right, a paddle — where a stick that also leans up and down is a thumb wandering off the line it means. The drawn stick becomes a track along that axis and always reports the other one as 0. **Only the drawn stick:** a real pad's stick still reports both, so a game reads the axis it wants from either.\n\nWhoever draws the controls may be older than the game, and draw a stick that moves both ways. The SDK zeroes the other axis whatever the renderer reports, so the game hears one axis either way.",
749
- "markdownDescription": "The one direction an on-screen thumbstick moves in: `x` across, `y` up and\ndown.\n\nFor a game that steers along one line — a runner sliding left and right, a\npaddle — where a stick that also leans up and down is a thumb wandering off\nthe line it means. The drawn stick becomes a track along that axis and always\nreports the other one as 0. **Only the drawn stick:** a real pad's stick still\nreports both, so a game reads the axis it wants from either.\n\nWhoever draws the controls may be older than the game, and draw a stick that\nmoves both ways. The SDK zeroes the other axis whatever the renderer reports,\nso the game hears one axis either way."
750
- },
751
- "PlayerInputDeclaration": {
752
- "type": "object",
753
- "properties": {
754
- "actions": {
755
- "type": "object",
756
- "additionalProperties": {
757
- "$ref": "#/definitions/PlayerInputAction"
758
- },
759
- "description": "The actions each player has, by id: never an id `actions` declares too.",
760
- "markdownDescription": "The actions each player has, by id: never an id `actions` declares too.",
761
- "maxProperties": 32,
762
- "propertyNames": {
763
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
764
- "maxLength": 48,
765
- "errorMessage": "must be lowercase letters, digits, dots, hyphens and underscores"
766
- }
767
- },
768
- "keyboard": {
769
- "type": "array",
770
- "items": {
771
- "$ref": "#/definitions/KeyboardSet"
772
- },
773
- "description": "The parts of the keyboard players play with, one player each, in the order they are offered. A player alone hears every one of them. Left out, the keyboard presses no player's action.",
774
- "markdownDescription": "The parts of the keyboard players play with, one player each, in the\norder they are offered. A player alone hears every one of them. Left out,\nthe keyboard presses no player's action.",
775
- "minItems": 1,
776
- "maxItems": 4
777
- }
778
- },
779
- "required": [
780
- "actions"
781
- ],
782
- "additionalProperties": false,
783
- "description": "What each local player does, and how they share the keyboard.\n\n**One set of actions for every player.** Each local player has their own copy, pressed by the pad they hold, the part of the keyboard they play with, or the on-screen controls. A pad's buttons are the same for every pad, so any number of pads just works; the keyboard is split into sets, one player each, so the number of sets is how many can share it.",
784
- "markdownDescription": "What each local player does, and how they share the keyboard.\n\n**One set of actions for every player.** Each local player has their own\ncopy, pressed by the pad they hold, the part of the keyboard they play with,\nor the on-screen controls. A pad's buttons are the same for every pad, so any\nnumber of pads just works; the keyboard is split into sets, one player each,\nso the number of sets is how many can share it."
785
- },
786
- "PlayerInputAction": {
787
- "type": "object",
788
- "properties": {
789
- "bind": {
790
- "type": "array",
791
- "items": {
792
- "$ref": "#/definitions/PlayerBinding"
793
- },
794
- "description": "What presses it on a pad, the same for every pad, and on the screen. Leave it out for an action pressed only on the keyboard.",
795
- "markdownDescription": "What presses it on a pad, the same for every pad, and on the screen.\nLeave it out for an action pressed only on the keyboard.",
796
- "minItems": 1,
797
- "maxItems": 8
798
- },
799
- "title": {
800
- "type": "string",
801
- "description": "What to call it in front of a player, in a remapping screen.",
802
- "markdownDescription": "What to call it in front of a player, in a remapping screen.",
803
- "pattern": "\\S",
804
- "maxLength": 40,
805
- "errorMessage": "must not be blank"
806
- },
807
- "label": {
808
- "type": "string",
809
- "description": "What to draw on an on-screen button: a glyph, or a letter.",
810
- "markdownDescription": "What to draw on an on-screen button: a glyph, or a letter.",
811
- "pattern": "\\S",
812
- "maxLength": 8,
813
- "errorMessage": "must not be blank"
814
- },
815
- "join": {
816
- "type": "boolean",
817
- "description": "Whether pressing it on a pad or a part of the keyboard nobody plays with makes a new player, while the game is taking players. Left out on every action, any of them does.",
818
- "markdownDescription": "Whether pressing it on a pad or a part of the keyboard nobody plays with\nmakes a new player, while the game is taking players. Left out on every\naction, any of them does."
819
- }
820
- },
821
- "additionalProperties": false,
822
- "description": "One thing each player does: the same action for every local player, pressed by their own pad, their own part of the keyboard, or the on-screen controls.",
823
- "markdownDescription": "One thing each player does: the same action for every local player, pressed\nby their own pad, their own part of the keyboard, or the on-screen controls."
824
- },
825
- "PlayerBinding": {
826
- "type": "string",
827
- "description": "What presses a player's action on a pad or on the screen: a pad button, or an on-screen control. Keys and mouse buttons are a keyboard set's, in `PlayerInputDeclaration.keyboard`.",
828
- "markdownDescription": "What presses a player's action on a pad or on the screen: a pad button, or\nan on-screen control. Keys and mouse buttons are a keyboard set's, in\n`PlayerInputDeclaration.keyboard`.",
829
- "pattern": "^(?:controls\\.(?=.{1,48}$)[a-z0-9]+(?:[_-][a-z0-9]+)*|pad\\.(?:north|south|east|west|start|select)|pad\\.(?:left|right)\\.(?:north|south|east|west|bumper|trigger))$",
830
- "errorMessage": "must be a pad button or an on-screen control: a player's keys and mouse buttons go in input.player.keyboard"
831
- },
832
- "KeyboardSet": {
833
- "type": "object",
834
- "properties": {
835
- "title": {
836
- "type": "string",
837
- "description": "What the players call it: *Left keys*, *Arrows*.",
838
- "markdownDescription": "What the players call it: *Left keys*, *Arrows*.",
839
- "pattern": "\\S",
840
- "maxLength": 40,
841
- "errorMessage": "must not be blank"
842
- },
843
- "bind": {
844
- "type": "object",
845
- "additionalProperties": {
846
- "type": "array",
847
- "items": {
848
- "$ref": "#/definitions/KeyboardBinding"
849
- }
850
- },
851
- "description": "The keys and mouse buttons of each player action, by its id.",
852
- "markdownDescription": "The keys and mouse buttons of each player action, by its id.",
853
- "maxProperties": 64,
854
- "propertyNames": {
855
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
856
- "maxLength": 48,
857
- "errorMessage": "must be a player action id"
858
- }
859
- }
860
- },
861
- "required": [
862
- "bind"
863
- ],
864
- "additionalProperties": false,
865
- "description": "One part of the keyboard one player plays with: the keys and mouse buttons that press each of the player actions there.",
866
- "markdownDescription": "One part of the keyboard one player plays with: the keys and mouse buttons\nthat press each of the player actions there."
867
- },
868
- "KeyboardBinding": {
869
- "type": "string",
870
- "description": "What presses a player's action on their part of the keyboard: a key, or a mouse button.",
871
- "markdownDescription": "What presses a player's action on their part of the keyboard: a key, or a\nmouse button.",
872
- "pattern": "^(?:key\\.(?!Escape$)(?=.{1,48}$)[A-Za-z][A-Za-z0-9]*|mouse\\.(?:left|middle|right))$",
873
- "errorMessage": "must be a key or a mouse button (and Escape is the host's key)"
874
- },
875
- "PlayersDeclaration": {
876
- "type": "object",
877
- "properties": {
878
- "local": {
879
- "type": "integer",
880
- "description": "The most players on one device, each with their own copy of `input.player`'s actions. 1 when left out.",
881
- "markdownDescription": "The most players on one device, each with their own copy of\n`input.player`'s actions. 1 when left out.",
882
- "minimum": 1,
883
- "maximum": 8
884
- }
885
- },
886
- "additionalProperties": false,
887
- "description": "How many people play a game on one device.\n\nRead by hosts before the game runs: a listing says *1–4 on one device*, and the input panel offers a row for each player.",
888
- "markdownDescription": "How many people play a game on one device.\n\nRead by hosts before the game runs: a listing says *1–4 on one device*, and\nthe input panel offers a row for each player."
889
- },
890
- "AudioDeclaration": {
891
- "type": "object",
892
- "properties": {
893
- "channels": {
894
- "type": "object",
895
- "additionalProperties": {
896
- "$ref": "#/definitions/AudioChannel"
897
- },
898
- "description": "The channels, by id. Optional, and may be empty: either way there is only the master. At most 8: a panel of faders nobody can read is not a feature.\n\n`master` is refused rather than quietly shadowed. A master fader exists whether or not a game has said anything, and an author who wrote it meant something by it; a fader that turned out to be the host's own would be a control that ignored half of what they wired it to. The id grammar is the wire's too, and a test keeps the two in step.",
899
- "markdownDescription": "The channels, by id. Optional, and may be empty: either way there is only\nthe master. At most 8: a panel of faders nobody can read is not a feature.\n\n`master` is refused rather than quietly shadowed. A master fader exists\nwhether or not a game has said anything, and an author who wrote it meant\nsomething by it; a fader that turned out to be the host's own would be a\ncontrol that ignored half of what they wired it to. The id grammar is the\nwire's too, and a test keeps the two in step.",
900
- "maxProperties": 8,
901
- "propertyNames": {
902
- "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$",
903
- "maxLength": 48,
904
- "not": {
905
- "const": "master"
906
- },
907
- "errorMessage": "must be lowercase letters, digits, dots, hyphens and underscores, and must not be \"master\", which every host adds itself"
908
- }
909
- }
910
- },
911
- "additionalProperties": false,
912
- "description": "What this game makes noise with, so a host can offer a fader for each.\n\n**A map from the first version, even for a game with one channel.** The channel id travels in `audio.set`, which is frozen game-side code, and a single-channel key would have to *change meaning* to grow a second one — the one move the additive rule forbids.\n\n**The manifest's test is whether the host must know before the bundle runs**, and here it must twice over. The panel is drawn where the game's title is, which a host draws for games in a feed that nobody has opened; and the opening volumes ride in the handshake, so the host has to know which channels it is stating a volume for before there is a game to ask.\n\n**The key is required, and `null` is how a silent game says so.** Leaving it out would read the same as forgetting it, and a game that makes noise but never said so is one whose player cannot turn it down. An object with no channels is a game with sound and no tracks worth a fader of their own: it gets a master fader and a mute button and no more. What is never optional is obeying what the host then says: see `AudioState`.",
913
- "markdownDescription": "What this game makes noise with, so a host can offer a fader for each.\n\n**A map from the first version, even for a game with one channel.** The\nchannel id travels in `audio.set`, which is frozen game-side code, and a\nsingle-channel key would have to *change meaning* to grow a second one — the\none move the additive rule forbids.\n\n**The manifest's test is whether the host must know before the bundle runs**,\nand here it must twice over. The panel is drawn where the game's title is,\nwhich a host draws for games in a feed that nobody has opened; and the\nopening volumes ride in the handshake, so the host has to know which channels\nit is stating a volume for before there is a game to ask.\n\n**The key is required, and `null` is how a silent game says so.** Leaving it\nout would read the same as forgetting it, and a game that makes noise but\nnever said so is one whose player cannot turn it down. An object with no\nchannels is a game with sound and no tracks worth a fader of their own: it\ngets a master fader and a mute button and no more. What is never optional is\nobeying what the host then says: see `AudioState`."
914
- },
915
- "AudioChannel": {
916
- "type": "object",
917
- "properties": {
918
- "title": {
919
- "type": "string",
920
- "description": "What to call it in front of a player.",
921
- "markdownDescription": "What to call it in front of a player.",
922
- "pattern": "\\S",
923
- "maxLength": 40,
924
- "errorMessage": "must not be blank"
925
- }
926
- },
927
- "required": [
928
- "title"
929
- ],
930
- "additionalProperties": false,
931
- "description": "One thing a game makes noise with, as the player is offered it.\n\nThe title is the whole of it, and required: this exists to be a label on a fader in a host's own panel, and a fader labelled `sfx2` is a control nobody can use. What a channel *is* — a bus, a set of samples, one oscillator — is the game's business and is never described here.",
932
- "markdownDescription": "One thing a game makes noise with, as the player is offered it.\n\nThe title is the whole of it, and required: this exists to be a label on a\nfader in a host's own panel, and a fader labelled `sfx2` is a control nobody\ncan use. What a channel *is* — a bus, a set of samples, one oscillator — is\nthe game's business and is never described here."
933
- },
934
- "PreviewsDeclaration": {
935
- "type": "object",
936
- "properties": {
937
- "network": {
938
- "$ref": "#/definitions/PreviewRevision",
939
- "description": "That this game plays over the network, in matches, at this revision of `@hopple/sdk-preview-network`: `sdk.match`.\n\nThe permission a reviewer grants, and what lets a host offer *Play with friends* before the game has loaded. Nothing else about networking is declared: the way a match is played, and its size, are chosen by the game when it makes one. Absent, a game is never told about a match, and never reaches one.",
940
- "markdownDescription": "That this game plays over the network, in matches, at this revision of\n`@hopple/sdk-preview-network`: `sdk.match`.\n\nThe permission a reviewer grants, and what lets a host offer *Play with\nfriends* before the game has loaded. Nothing else about networking is\ndeclared: the way a match is played, and its size, are chosen by the game\nwhen it makes one. Absent, a game is never told about a match, and never\nreaches one."
941
- }
942
- },
943
- "additionalProperties": false,
944
- "description": "The previews a game is written against, each at the revision it needs.\n\nA preview is a part of the SDK that is not stable yet: its own `0.x` package, versioned apart from `api`, and served only to the games that declare it, at the revision they declare. A change to a preview reaches the games written against it and nobody else.",
945
- "markdownDescription": "The previews a game is written against, each at the revision it needs.\n\nA preview is a part of the SDK that is not stable yet: its own `0.x`\npackage, versioned apart from `api`, and served only to the games that\ndeclare it, at the revision they declare. A change to a preview reaches the\ngames written against it and nobody else."
946
- },
947
- "PreviewRevision": {
948
- "type": "integer",
949
- "description": "A preview's revision: a whole number from 1, the `R` of its package's `0.R.p`. A breaking change to the preview is a new revision.",
950
- "markdownDescription": "A preview's revision: a whole number from 1, the `R` of its package's\n`0.R.p`. A breaking change to the preview is a new revision.",
951
- "minimum": 1
952
- }
953
- }
954
- }