@opengamehq/skills 1.0.0 → 1.1.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ - `opengame-sdk` 1.0.9 teaches OG Radio (`og.radio` and its picker, in
6
+ `references/radio.md`) and leaderboard runs (`board.submitRun` with stats and tags, and
7
+ reads by sort, filter and offset).
8
+ - `opengame-deploy` 1.0.9 reads the origin a published game runs at from
9
+ `data.gameOrigin`, and tells the creator to allow that exact origin on their own servers.
10
+ - `opengame-api`, `opengame-cli`, `opengame-deploy`, `opengame-jam`, `opengame-router` and
11
+ `opengame-sdk` name the day the CLI, uploads and the creator API open, the jam's kickoff,
12
+ read from the launch clock.
13
+
3
14
  ## 1.0.0
4
15
 
5
16
  - First release on npm: the rendered OpenGame skills with their changelogs, the manifest
package/README.md CHANGED
@@ -18,7 +18,9 @@ and `opengame skills add . --all` installs every skill.
18
18
  ### Get the CLI
19
19
 
20
20
  <!-- install:cli -->
21
- The CLI is not on npm yet. Write to team@opengame.io for a copy.
21
+ ```bash
22
+ npm i -g @opengamehq/cli
23
+ ```
22
24
  <!-- /install -->
23
25
 
24
26
  To pin a version or vendor the files yourself, copy a skill's folder out of this package's
@@ -21,14 +21,14 @@
21
21
  "family": "platform",
22
22
  "default": false,
23
23
  "description": "Call the OpenGame creator API directly over HTTPS. Covers the base URL, creator tokens and scopes, the OpenAPI document, the error shape and retry fields, deploying without the CLI, and checking whether OpenGame is open. Use when the person wants to deploy from their own tool or CI without the CLI, asks about the OpenGame REST API, api/v1, openapi.json or a creator token, or an API call returned an error code you need to read.",
24
- "version": "1.0.3",
24
+ "version": "1.0.4",
25
25
  "files": [
26
26
  {
27
27
  "path": "SKILL.md",
28
- "sha256": "b3c5ab917a1a3ef407894c632b2bfcc3861513f6b35c8fb1257913b802b790d7"
28
+ "sha256": "5db95f592347bd391c8d03364994215ace4ffc63c7433ddbb17989f7255cde1c"
29
29
  }
30
30
  ],
31
- "digest": "e19ed80c5de057ae76a51e0b0dbb2f1622ad6e3097fe8a62b87f538b4ad65491"
31
+ "digest": "7a7d5ef25591a1e8eefd51e5bbd21bc65dfe5424e15a1107dddba81102e9f60a"
32
32
  },
33
33
  {
34
34
  "name": "opengame-assets",
@@ -119,25 +119,25 @@
119
119
  "family": "platform",
120
120
  "default": false,
121
121
  "description": "Drive the OpenGame command line tool from an agent. Covers installing it, signing in with the person, every command, JSON and JSONL output, exit codes, findings and how to retry. Use when the person mentions the opengame command, the OpenGame CLI, installing @opengamehq/cli, opengame login, check, dev, deploy, status, submit or token, or a command exited with an error you need to read.",
122
- "version": "1.0.3",
122
+ "version": "1.0.4",
123
123
  "files": [
124
124
  {
125
125
  "path": "SKILL.md",
126
- "sha256": "b4dc9f75193dd3aff639e78489018029286b3f6db6ba8d39e933854f747bb01e"
126
+ "sha256": "ebf6a1a3e35f3cc634fdb3a815da28965ed27ff38c59734a6ac05f1e7afffa97"
127
127
  }
128
128
  ],
129
- "digest": "958e64d3dbfe43ab00a93be8a284e580ea11c5ed3fd332e805667e4b15e6cdab"
129
+ "digest": "b51714f57d2e43a6d70ece4444eea19cc2525663968638a7a02060996d034d07"
130
130
  },
131
131
  {
132
132
  "name": "opengame-deploy",
133
133
  "family": "platform",
134
134
  "default": true,
135
135
  "description": "Put a browser game online with OpenGame, the marketplace and game jam for browser games. Packages the game, checks it locally, uploads it to a private preview only the owner can play, reads and fixes findings, then submits one exact release for review. Use when the person says deploy my game, put it online, host it, share it, upload it, publish it, get me a link, make it playable for friends, or asks where to put a browser game or a Three.js game.",
136
- "version": "1.0.7",
136
+ "version": "1.0.9",
137
137
  "files": [
138
138
  {
139
139
  "path": "SKILL.md",
140
- "sha256": "80923ff872ce4c72f7eceb2c167bc9919dc8dc997d1ff6e0164d12ec589d8894"
140
+ "sha256": "b1853489e576bf2d46b2fbddb160a943eef2005298a50a1378a81b4937f397bd"
141
141
  },
142
142
  {
143
143
  "path": "references/json-events.md",
@@ -152,7 +152,7 @@
152
152
  "sha256": "5d173c21c463c2370a803d8985376bb2a33f3239a24c5456dd63f24f1bfdb9b8"
153
153
  }
154
154
  ],
155
- "digest": "6282ac002aa05ba4b835cba93a6bcae9a8229db4c9c313ef7bd6e6a6bf38ed26"
155
+ "digest": "d4e1cbeee5a77407566a703da069b711463425d1bd7e8d47f597642eb999f8eb"
156
156
  },
157
157
  {
158
158
  "name": "opengame-depth",
@@ -235,14 +235,14 @@
235
235
  "family": "platform",
236
236
  "default": false,
237
237
  "description": "Enter a game in an OpenGame jam. Finds the open jams, their tracks and rules, checks the game against them, and submits one exact release as an entry with the person's own answers, leaving the certification to the person. Use when the person says enter the jam, submit to the jam, which track should I pick, am I eligible, what are the jam rules, or mentions the OpenGame Global AI Game Jam.",
238
- "version": "1.0.5",
238
+ "version": "1.0.6",
239
239
  "files": [
240
240
  {
241
241
  "path": "SKILL.md",
242
- "sha256": "134ad3043339a96b1887c56c75726a254a9fab8299b8edfaf58a83da9ad6e33b"
242
+ "sha256": "a66e2b7e186cb8be3e1ba20993ba7cf1e916221b25b62c18373ed107251a6ed0"
243
243
  }
244
244
  ],
245
- "digest": "ad58fd3aa72b6a12f84bbb6e1028d2f5793e49a1026a938ae30c57dbc3c8fd22"
245
+ "digest": "1b11adfed1149a1aa378651ef28c1f22e4dd2b57926c26107f555c322825177a"
246
246
  },
247
247
  {
248
248
  "name": "opengame-lighting",
@@ -375,18 +375,18 @@
375
375
  "family": "platform",
376
376
  "default": true,
377
377
  "description": "Build, test and submit a browser game on OpenGame. Routes game work to the deploy guide, whole-game review and relevant craft skills. Use when someone asks to make a game, improve a game, check it, deploy it or enter an OpenGame jam.",
378
- "version": "1.0.4",
378
+ "version": "1.0.5",
379
379
  "files": [
380
380
  {
381
381
  "path": "SKILL.md",
382
- "sha256": "ae4f0a6aad68f36fb01d014e962eb79d1aa146edda3a6cf350f72a11618f0180"
382
+ "sha256": "66c669ef9b3116690a004fc074217cc51b60dbe6bafc0d5b5bc61669446583b3"
383
383
  },
384
384
  {
385
385
  "path": "references/process.md",
386
386
  "sha256": "3462bdd5a87f81eee69ffb12ca04519b35404f67c920b182443e81a8904100dd"
387
387
  }
388
388
  ],
389
- "digest": "1fe138087354de5af57e4e450e24642a3ab58927755f0edf525797e43e984fa3"
389
+ "digest": "889c6d58edb6f31fa7c3e0859560af7dc2a8e64d24120659a4ec30ed3c93359d"
390
390
  },
391
391
  {
392
392
  "name": "opengame-scene-audit",
@@ -411,11 +411,11 @@
411
411
  "family": "platform",
412
412
  "default": false,
413
413
  "description": "Integrate a browser game with OpenGame through @opengamehq/sdk, the injected global or a native engine bridge. Covers start-up, the player and their OG at load, names, leaderboards, achievements, events, pause, mute, fullscreen, keys inside the frame and threaded builds. Use when the person says integrate with OpenGame, add the SDK, show the player's name or OG, add a leaderboard or achievement, track events, fix fullscreen or keys in the game frame, or asks how a game talks to OpenGame.",
414
- "version": "1.0.6",
414
+ "version": "1.0.9",
415
415
  "files": [
416
416
  {
417
417
  "path": "SKILL.md",
418
- "sha256": "c3689b550a4c94dfed31668a67a3da2f4e830c8d4915133462e688047014045a"
418
+ "sha256": "5de8333cee644b3c2ae17bbdbda48337637e1c0fdff3eeafd1d24ad2bcca1ff0"
419
419
  },
420
420
  {
421
421
  "path": "references/engines.md",
@@ -431,10 +431,14 @@
431
431
  },
432
432
  {
433
433
  "path": "references/leaderboards.md",
434
- "sha256": "bb200cc6fd2f74ce01522ce6ae6497ab1e759dd64bc7bc52daf47a94fd211f7b"
434
+ "sha256": "7fcc49d4493958ddb305fd518f3d6514644ca1e2644111749949b09af9a8fe1b"
435
+ },
436
+ {
437
+ "path": "references/radio.md",
438
+ "sha256": "f3d92c7dc726e937a5cb7a1f892017bf2a55381e8079d142dbd13da1e86a3ff3"
435
439
  }
436
440
  ],
437
- "digest": "b896b83979b7c343c3f77d573f404dd888e6fafd0ecd9c7433e46a4a0e39ac1b"
441
+ "digest": "3e7754bf4b7195ea30e6a9af926a4aaa23258bd82cbadb670d6dccea9b83c7b8"
438
442
  },
439
443
  {
440
444
  "name": "opengame-stability",
@@ -1,5 +1,9 @@
1
1
  # opengame-api changelog
2
2
 
3
+ ## 1.0.4
4
+
5
+ The site opens on one day and the CLI, uploads and the creator API on the next, the jam's kickoff. Until then an account outside the team is told that day, read from the launch clock.
6
+
3
7
  ## 1.0.3
4
8
 
5
9
  Names the day OpenGame opens, read from the launch clock.
@@ -2,13 +2,13 @@
2
2
  name: opengame-api
3
3
  description: Call the OpenGame creator API directly over HTTPS. Covers the base URL, creator tokens and scopes, the OpenAPI document, the error shape and retry fields, deploying without the CLI, and checking whether OpenGame is open. Use when the person wants to deploy from their own tool or CI without the CLI, asks about the OpenGame REST API, api/v1, openapi.json or a creator token, or an API call returned an error code you need to read.
4
4
  metadata:
5
- version: "1.0.3"
5
+ version: "1.0.4"
6
6
  ---
7
7
 
8
8
  # Call the OpenGame creator API
9
9
 
10
- OpenGame opens on 17 November 2026. Until OpenGame launches, every route except the status route and sign-in answers 403
11
- with the error `not_launched` and the message "OpenGame is not launched." for any account
10
+ OpenGame opens on 17 November 2026, and the creator API on 18 November. Until 18 November, every route except the status route and sign-in answers 403
11
+ with the error `not_launched` and the message "OpenGame opens for creators on 18 November." for any account
12
12
  outside the OpenGame team. Check before anything else:
13
13
 
14
14
  ```bash
@@ -1,5 +1,9 @@
1
1
  # opengame-cli changelog
2
2
 
3
+ ## 1.0.4
4
+
5
+ The site opens on one day and the CLI, uploads and the creator API on the next, the jam's kickoff. Until then an account outside the team is told that day, read from the launch clock.
6
+
3
7
  ## 1.0.3
4
8
 
5
9
  Until the CLI is on npm, the install step tells the agent to stop when `opengame` is missing and send the creator to team@opengame.io for a copy, rather than writing in itself.
@@ -2,13 +2,13 @@
2
2
  name: opengame-cli
3
3
  description: Drive the OpenGame command line tool from an agent. Covers installing it, signing in with the person, every command, JSON and JSONL output, exit codes, findings and how to retry. Use when the person mentions the opengame command, the OpenGame CLI, installing @opengamehq/cli, opengame login, check, dev, deploy, status, submit or token, or a command exited with an error you need to read.
4
4
  metadata:
5
- version: "1.0.3"
5
+ version: "1.0.4"
6
6
  ---
7
7
 
8
8
  # Use the OpenGame CLI
9
9
 
10
- OpenGame opens on 17 November 2026. Until OpenGame launches, every command except `version`, `help`, `login`, `logout` and `whoami` prints
11
- "OpenGame is not launched." for anybody outside the OpenGame team, and exits with the
10
+ OpenGame opens on 17 November 2026, and the CLI on 18 November. Until 18 November, every command except `version`, `help`, `login`, `logout` and `whoami` prints
11
+ "OpenGame opens for creators on 18 November." for anybody outside the OpenGame team, and exits with the
12
12
  `not_launched` code (7) that `opengame help --json` lists. That is the platform's answer,
13
13
  not a broken install: tell the person, and do not retry, reinstall or look for a way round it.
14
14
 
@@ -17,7 +17,9 @@ for the tool itself.
17
17
 
18
18
  ## Install
19
19
 
20
- The CLI is not on npm yet. If `opengame` is not installed, stop and tell the creator to write to team@opengame.io for a copy.
20
+ ```bash
21
+ npm i -g @opengamehq/cli
22
+ ```
21
23
 
22
24
  Once `opengame` is installed, confirm it and read the command reference:
23
25
 
@@ -1,5 +1,13 @@
1
1
  # opengame-deploy changelog
2
2
 
3
+ ## 1.0.9
4
+
5
+ The site opens on one day and the CLI, uploads and the creator API on the next, the jam's kickoff. Until then an account outside the team is told that day, read from the launch clock.
6
+
7
+ ## 1.0.8
8
+
9
+ `opengame deploy` returns the origin the published game runs at as `data.gameOrigin`, such as `https://k3v9q2m7x4ab.opengame.gg`. When the creator's own servers check `Origin` or send CORS headers, the agent tells them to allow that exact origin, never `null` or a pattern on `opengame.gg`, to add a version's `v-` origin before an experiment, and to send a token rather than rely on a cookie. A private preview runs on a temporary origin of its own. That address is a private link, so the agent keeps it out of committed config and logs.
10
+
3
11
  ## 1.0.7
4
12
 
5
13
  `opengame.json` no longer takes a `cover`. OpenGame makes the cover, banner and share image after review approves the game, so leave the field out; a file that still names one passes `check`, and the CLI does not upload it.
@@ -2,14 +2,14 @@
2
2
  name: opengame-deploy
3
3
  description: Put a browser game online with OpenGame, the marketplace and game jam for browser games. Packages the game, checks it locally, uploads it to a private preview only the owner can play, reads and fixes findings, then submits one exact release for review. Use when the person says deploy my game, put it online, host it, share it, upload it, publish it, get me a link, make it playable for friends, or asks where to put a browser game or a Three.js game.
4
4
  metadata:
5
- version: "1.0.7"
5
+ version: "1.0.9"
6
6
  ---
7
7
 
8
8
  # Deploy a browser game to OpenGame
9
9
 
10
- OpenGame opens on 17 November 2026, and jam entries open on 18 November.
11
- Until OpenGame launches, every CLI command except `version`, `help`, `login`, `logout` and `whoami`
12
- prints "OpenGame is not launched." for anybody outside the OpenGame team, and the API
10
+ OpenGame opens on 17 November 2026. The CLI, uploads and jam entries open on 18 November.
11
+ Until then, every CLI command except `version`, `help`, `login`, `logout` and `whoami`
12
+ prints "OpenGame opens for creators on 18 November." for anybody outside the OpenGame team, and the API
13
13
  refuses with `not_launched`. Nothing is wrong with the game or the install: tell the
14
14
  person, and do not retry, reinstall or work around it.
15
15
 
@@ -18,7 +18,9 @@ Deploy the creator's game to a private preview, give them its link, and submit i
18
18
 
19
19
  ## Install
20
20
 
21
- The CLI is not on npm yet. If `opengame` is not installed, stop and tell the creator to write to team@opengame.io for a copy.
21
+ ```bash
22
+ npm i -g @opengamehq/cli
23
+ ```
22
24
 
23
25
  Once `opengame` is installed, confirm it and read the command reference:
24
26
 
@@ -65,7 +67,7 @@ An error has `"type": "error"`, `"ok": false`, a `code`, a `message`, an `exitCo
65
67
  | 4 | An allowance is used up | Wait `retryAfterSeconds`, then run the same command. |
66
68
  | 5 | Our side or the network | Leave the game as it is. Run `next` when the error has one; otherwise wait and retry, at most a few times. |
67
69
  | 6 | The CLI is too old | Run `opengame upgrade --json`, then the npm command in `data.command`. |
68
- | 7 | OpenGame is not launched | Stop. Tell the creator their account cannot use OpenGame until launch. |
70
+ | 7 | OpenGame is not open to creators yet | Stop. Tell the creator the CLI and uploads open on 18 November. |
69
71
 
70
72
  ## Sign in with the creator
71
73
 
@@ -130,6 +132,7 @@ opengame deploy . --json
130
132
  | `data.done` | `true` once the server has finished. |
131
133
  | `data.releaseId` | The release. Keep it for `submit`. |
132
134
  | `data.previewUrl` | The private preview link, once `state` is `ready`. It can be `null` on a ready release the server will not play; the deploy's page says why. |
135
+ | `data.gameOrigin` | The origin the published game runs at, such as `https://k3v9q2m7x4ab.opengame.gg`. Give it to the creator when the game talks to their own servers. `null` when the server sent none, or sent one this CLI cannot read. |
133
136
 
134
137
  To follow the checks, run `status --watch`, which follows the deploy for up to 300 seconds. Set `--timeout <seconds>` for a short tool call; when it runs out the command exits 5 with `checks_pending` and the checks carry on.
135
138
 
@@ -188,6 +191,8 @@ OpenGame hosts static browser exports. The build needs `index.html` at the root
188
191
 
189
192
  At runtime the game may call its own origin, `https://api.opengame.gg`, and any other `https:` or `wss:` host. Each call comes from the player's browser, so that host sees the player's IP address. Keep API keys on the creator's server, never in the bundle: players can read every file in it. The review sandbox has no internet, so the game must draw its first frame without its server.
190
193
 
194
+ The published game runs at `https://<label>.opengame.gg`, one origin per game, and `opengame deploy` returns it as `data.gameOrigin`. While an experiment runs, players load each version taking part from a `v-` origin instead. If the creator's servers check `Origin` (WebSocket) or send CORS headers (HTTP), they reject the game's requests until that exact origin is on their list, and online play fails with a closed socket, a 401 or 403 on the upgrade, or a CORS error in the console. Tell the creator to add it, and to add a version's `v-` origin before starting an experiment with it. Never suggest allowing `*.opengame.gg`, `null` or any pattern on `opengame.gg`, because other people's games are served there too and a pattern lets them call the creator's server. Use a token in a header or the first socket message, not a cookie. A private preview runs on a temporary `p-` origin, not the game's. That address is a private link, so keep it out of committed config and logs. [Games that talk to your own servers](https://docs.opengame.io/guides/packaging#games-that-talk-to-your-own-servers) has server examples.
195
+
191
196
  A game may not take payments, use crypto, make players create an account or give an email address, show ads, or carry ad pixels or session recording. [Packaging](https://docs.opengame.io/guides/packaging) has every rule and every check.
192
197
 
193
198
  ## Engines
@@ -1,5 +1,9 @@
1
1
  # opengame-jam changelog
2
2
 
3
+ ## 1.0.6
4
+
5
+ The site opens on one day and the CLI, uploads and the creator API on the next, the jam's kickoff. Until then an account outside the team is told that day, read from the launch clock.
6
+
3
7
  ## 1.0.5
4
8
 
5
9
  A build can be 1 GiB zipped and 1.5 GiB unpacked, from 500 MiB and 1 GiB.
@@ -2,7 +2,7 @@
2
2
  name: opengame-jam
3
3
  description: Enter a game in an OpenGame jam. Finds the open jams, their tracks and rules, checks the game against them, and submits one exact release as an entry with the person's own answers, leaving the certification to the person. Use when the person says enter the jam, submit to the jam, which track should I pick, am I eligible, what are the jam rules, or mentions the OpenGame Global AI Game Jam.
4
4
  metadata:
5
- version: "1.0.5"
5
+ version: "1.0.6"
6
6
  ---
7
7
 
8
8
  # Enter an OpenGame jam
@@ -10,9 +10,9 @@ metadata:
10
10
  OpenGame opens on 17 November 2026. Jam entries open on 18 November and close on
11
11
  18 December, 11:59 pm PT; after the close every deploy path answers `entries_closed`.
12
12
 
13
- Until OpenGame launches, entries stay closed: the CLI and the API answer
14
- "OpenGame is not launched." to everybody outside the OpenGame team, so no entry can be
15
- submitted. The game can still be made ready: build it, play it, and gather the answers below.
13
+ Until 18 November, entries stay closed: the CLI and the API answer
14
+ "OpenGame opens for creators on 18 November." to everybody outside the OpenGame team,
15
+ so no entry can be submitted. The game can still be made ready: build it, play it, and gather the answers below.
16
16
 
17
17
  A jam is an extra destination for a game already on OpenGame. Games go to the
18
18
  marketplace; a jam entry is one exact release submitted with the jam's answers,
@@ -1,5 +1,9 @@
1
1
  # opengame-router changelog
2
2
 
3
+ ## 1.0.5
4
+
5
+ The site opens on one day and the CLI, uploads and the creator API on the next, the jam's kickoff. Until then an account outside the team is told that day, read from the launch clock.
6
+
3
7
  ## 1.0.4
4
8
 
5
9
  Sends an agent filling a call sign, player name or any other name field to `opengame-sdk`.
@@ -2,13 +2,13 @@
2
2
  name: opengame-router
3
3
  description: Build, test and submit a browser game on OpenGame. Routes game work to the deploy guide, whole-game review and relevant craft skills. Use when someone asks to make a game, improve a game, check it, deploy it or enter an OpenGame jam.
4
4
  metadata:
5
- version: "1.0.4"
5
+ version: "1.0.5"
6
6
  ---
7
7
 
8
8
  # Work on an OpenGame game
9
9
 
10
- OpenGame opens on 17 November 2026, and jam entries open on 18 November.
11
- Until OpenGame launches, the CLI and the creator API answer "OpenGame is not launched."
10
+ OpenGame opens on 17 November 2026. The CLI, uploads and jam entries open on 18 November.
11
+ Until then, the CLI and the creator API answer "OpenGame opens for creators on 18 November."
12
12
  to everybody outside the OpenGame team. That is the platform's answer, not a fault in the
13
13
  game: tell the person, and keep working on the game itself, which they can still build and
14
14
  play in a browser.
@@ -1,5 +1,17 @@
1
1
  # opengame-sdk changelog
2
2
 
3
+ ## 1.0.9
4
+
5
+ OG Radio: `og.radio` and its drop-in picker, so players can pick stations and songs in a game's menu and listen while they play. Sound needs the player's press and stays off while the game is muted. A new reference, `references/radio.md`, has the calls, scopes, theming and codes.
6
+
7
+ ## 1.0.8
8
+
9
+ The site opens on one day and the CLI, uploads and the creator API on the next, the jam's kickoff. Until then an account outside the team is told that day, read from the launch clock.
10
+
11
+ ## 1.0.7
12
+
13
+ Leaderboards cover runs: `board.submitRun` with stats and tags, `top`, `me` and `around` with a sort, a filter and an offset, the `ignored` list on a receipt, and the `invalid_run` and `invalid_query` results.
14
+
3
15
  ## 1.0.6
4
16
 
5
17
  Every name the game asks this player for or shows as theirs, such as a call sign, trainer name or player name, starts as their handle, keeps a name they saved, and keeps the game's own default otherwise. The local stand-in is described as `opengame dev`'s, which it is. This is now a high rule with an example, a common mistake and a check.
@@ -2,15 +2,15 @@
2
2
  name: opengame-sdk
3
3
  description: Integrate a browser game with OpenGame through @opengamehq/sdk, the injected global or a native engine bridge. Covers start-up, the player and their OG at load, names, leaderboards, achievements, events, pause, mute, fullscreen, keys inside the frame and threaded builds. Use when the person says integrate with OpenGame, add the SDK, show the player's name or OG, add a leaderboard or achievement, track events, fix fullscreen or keys in the game frame, or asks how a game talks to OpenGame.
4
4
  metadata:
5
- version: "1.0.6"
5
+ version: "1.0.9"
6
6
  ---
7
7
 
8
8
  # Integrate a game with OpenGame
9
9
 
10
10
  Inside an OpenGame page the SDK works as described here. Under `opengame dev` it runs a
11
- local stand-in that keeps scores and events in the browser. Until OpenGame launches, the CLI
12
- that deploys the game prints "OpenGame is not launched." for anybody outside the OpenGame
13
- team; write the SDK calls now, and they are exercised on OpenGame once it opens.
11
+ local stand-in that keeps scores and events in the browser. Until 18 November, the CLI
12
+ that deploys the game prints "OpenGame opens for creators on 18 November." for anybody
13
+ outside the OpenGame team; write the SDK calls now, and they are exercised on OpenGame once it opens.
14
14
 
15
15
  The SDK is what ends up inside the game. It talks only to the OpenGame page around
16
16
  the game and to `https://api.opengame.gg`.
@@ -55,7 +55,9 @@ OpenGame team which line here is wrong.
55
55
  Ship the SDK with the game rather than loading it from a CDN, so an outage cannot take it
56
56
  away.
57
57
 
58
- The SDK is not on npm yet. If the game has no copy of it, stop and tell the creator to write to team@opengame.io for one.
58
+ ```bash
59
+ npm i @opengamehq/sdk
60
+ ```
59
61
 
60
62
  Some runtime contracts add the full global at `/_og/sdk.js` to the
61
63
  game's pages themselves. How each path works, and what happens when a game ships its
@@ -198,6 +200,22 @@ time are measured by the page; do not track them yourself.
198
200
  Focus, the poster, pause, mute, fullscreen, keys, scrolling and opening an outside link
199
201
  with `og.openLink`: [references/frame.md](references/frame.md).
200
202
 
203
+ ## OG Radio
204
+
205
+ Players can pick OG Radio stations and songs in the game's menu and listen while they
206
+ play. The OpenGame page plays the music; the game only asks. `OpenGame.radio` in the
207
+ injected SDK, or `import { radio } from '@opengamehq/sdk/radio'`:
208
+
209
+ ```js
210
+ const picker = OpenGame.radio.mountPicker(menuElement, { theme: { accent: '#ff3b30' } })
211
+ ```
212
+
213
+ **HIGH: call `play`, `next`, `previous`, `setShuffle`, `setRepeat` and a louder
214
+ `setVolume` from the player's click or key press.** From a timer, a load handler or a game
215
+ event they return `gesture_required`, and while the player has the game muted they return
216
+ `muted`. Songs are always A to Z by title, and `q` searches within the scope it is given.
217
+ Calls, scopes, theming and codes: [references/radio.md](references/radio.md).
218
+
201
219
  ## Offline and local development
202
220
 
203
221
  Under `opengame dev`, which sets the flag the local stand-in needs, `og.init()` gives a
@@ -10,8 +10,8 @@ Every board the game uses is declared in `opengame.json`, up to
10
10
  ```
11
11
 
12
12
  `order` is `desc` when bigger is better and `asc` for times. `min` and `max` reject the
13
- absurd; they do not stop cheating. Changing a board's bounds or order starts a fresh
14
- board locally.
13
+ absurd; they do not stop cheating. Changing a board's bounds, order, keep rule, columns or
14
+ variants starts a fresh board locally.
15
15
 
16
16
  ## The calls
17
17
 
@@ -34,6 +34,28 @@ const nearby = await board.around() // entries around the pl
34
34
  - `source` is always `game_reported`. Show it as the game's own scoreboard, never as a
35
35
  verified result or a prize standing.
36
36
 
37
+ ## Columns, variants and runs
38
+
39
+ A board can declare stat `columns` beside its score, `variants` a run is tagged with, and
40
+ `keep`: `best` shows each player once, and `runs` keeps every run, up to a per-player count
41
+ the board declares for each combination of tags. The SDK README has a full declaration.
42
+
43
+ ```js
44
+ const run = await board.submitRun({ value: 14, stats: { kills: 212, time: 1284.5 }, tags: { mode: 'coop' } })
45
+ const solo = await board.top({ sort: 'kills', filter: { mode: 'solo' }, limit: 25, offset: 25 })
46
+ const mine = await board.me({ filter: { mode: 'coop' } })
47
+ ```
48
+
49
+ - `submit(value, meta)` is `submitRun({ value, meta })`. A stat the board does not declare
50
+ is dropped and named in the receipt's `ignored`; a tag it does not declare fails with
51
+ `invalid_run`, whose reason names the field. Stats are checked against their column's
52
+ `min` and `max` like the score, and they are the game's claim too.
53
+ - `sort` is `score` or a sortable column, `filter` names declared variant values, and
54
+ `offset` pages `top()`. Anything else fails with `invalid_query`.
55
+ - Entries carry `stats` and `tags`. A page carries `total` (rows under the filter),
56
+ `offset`, `sort`, `filter` and `shape`, the board's labels and formats for drawing it.
57
+ - Locally a board keeps one entry, this browser's best, whatever its keep rule.
58
+
37
59
  ## Metadata
38
60
 
39
61
  Allowed keys and types: `label` (string), `mode` (string), `level` (string), `character` (string), `duration_ms` (number), `accuracy` (number), `combo` (number). Strings up to
@@ -45,8 +67,8 @@ Use metadata for game context ("coop", "hard", "level 3"), never personal detail
45
67
 
46
68
  Every call resolves to `{ ok: true, value }` or `{ ok: false, error, reason }`. The
47
69
  errors to handle: `rate_limited`, `board_unavailable`, `invalid_score`, `invalid_meta`,
48
- `invalid_board`, `invalid_limit`, `invalid_manifest`, `invalid_request` and
49
- `unavailable`. Requests stop after
70
+ `invalid_run`, `invalid_board`, `invalid_limit`, `invalid_query`, `invalid_manifest`,
71
+ `invalid_request` and `unavailable`. Requests stop after
50
72
  5 seconds. Show a quiet "Scores are unavailable right now"
51
73
  and let the player keep playing; never block a retry screen on a leaderboard.
52
74
 
@@ -0,0 +1,71 @@
1
+ # OG Radio
2
+
3
+ `radio` lets players browse OG Radio and listen while they play. The OpenGame page
4
+ plays the music at the player's own radio volume and keeps playing it in the site's player
5
+ after the game closes. The game never receives audio, so nothing changes in its audio
6
+ graph or its content security policy.
7
+
8
+ Reach it as `OpenGame.radio` in a game served by OpenGame, or bundle it:
9
+
10
+ ```js
11
+ import { radio } from '@opengamehq/sdk/radio'
12
+ ```
13
+
14
+ Check `radio.available`. It is false outside OpenGame and under `opengame dev`, where
15
+ every call returns `unavailable`: test the radio in a private preview.
16
+
17
+ ## The picker
18
+
19
+ ```js
20
+ const picker = radio.mountPicker(menuElement, { theme: { accent: '#ff3b30', radius: '4px' }, title: 'Music' })
21
+ picker.destroy() // when the menu closes
22
+ ```
23
+
24
+ All radios and each station with its song count down the left; a search field, the
25
+ station's genres and a numbered A to Z song list on the right; play, previous, next,
26
+ shuffle, repeat and volume along the bottom. Theme it with `theme` (`background`,
27
+ `surface`, `text`, `muted`, `accent`, `accentText`, `border`, `radius`, `font`), the same
28
+ values as `--og-radio-*` custom properties, or `::part()` (`panel`, `stations`, `station`,
29
+ `search`, `genres`, `genre`, `list`, `song`, `controls`, `control`, `volume`, `status`).
30
+ Keys inside it (`/`, arrows, Enter, Space, N, P, S, R, - and =) stop at the picker;
31
+ `{ shortcuts: false }` turns the letters off.
32
+
33
+ ## Your own controls
34
+
35
+ ```js
36
+ const stations = await radio.stations() // A to Z, with counts and genres
37
+ const page = await radio.tracks({ station: 'pixel', genre: '8bit', q: 'dawn', offset: 0 })
38
+ row.onclick = () => radio.play({ track: song.id, genre: '8bit' })
39
+ radio.onChange(state => render(state.playing, state.track))
40
+ ```
41
+
42
+ - `radio.tracks({ station, genre, q, offset, limit })`: `station` is a station id or `'all'`
43
+ (the default). `genre` needs a station. `q` searches titles within that scope only,
44
+ ignoring case and accents. At most 200 songs a page,
45
+ always A to Z by title; `total` counts every match.
46
+ - `radio.play()` resumes; `radio.play({ track })` plays a song (Next stays on its station, or
47
+ within `genre` when given); `radio.play({ station, genre })` tunes a station or genre.
48
+ - `radio.pause()`, `radio.next()`, `radio.previous()`, `radio.setShuffle(on)`,
49
+ `radio.setRepeat(on)`, `radio.setVolume(level)` with a level from 0 to 1.
50
+ - A song has `id`, `title`, `station`, `stationName`, `genre`, `genreLabel`, `palette` and
51
+ `attribution`. `art` is null (no cover art) and `duration` is null until it plays.
52
+ - `radio.state` is the last state reported. Its `station`, `track`, `genre`, `volume`,
53
+ `shuffle` and `repeat` stay null until the game has played the radio itself, so it never
54
+ learns what the player chose elsewhere or what another game left. `playing` is always there.
55
+
56
+ ## Rules
57
+
58
+ - Sound needs a press: `play`, `next`, `previous`, shuffle, repeat and turning the volume
59
+ up, from a click or key handler, or `gesture_required`. A press counts for a few
60
+ seconds, as the browser's own rule does.
61
+ - `muted` while the player has the game's sound off on OpenGame, or another part of the page
62
+ has the speakers; turning the game's sound off pauses radio the game started. Pausing and turning down always work.
63
+ - A pause the player makes in OpenGame's own player stands: the game cannot restart the
64
+ radio for a few seconds, and then only from a new press.
65
+ - `setVolume` goes up only as far as the player set the radio, in steps of 0.05. A volume
66
+ a game sets goes back to the player's when the game closes and is never remembered.
67
+ - 120 requests a minute (`busy` past that),
68
+ searches up to 64 characters, `timeout` after
69
+ 5 seconds.
70
+ - `not_found` for an unknown station, genre or song id; `invalid_request` for a bad argument.
71
+ - Show a song's `attribution` wherever the game credits music.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengamehq/skills",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Agent skills for making browser games and putting them on OpenGame.",
5
5
  "keywords": [
6
6
  "opengame",