@vibechain/os 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/AGENTS.md +22 -9
  2. package/README.md +53 -17
  3. package/SECURITY.md +6 -2
  4. package/dist/app-client.js +29 -5
  5. package/dist/app-host.d.ts +27 -4
  6. package/dist/app-host.js +76 -9
  7. package/dist/app-protocol.d.ts +36 -1
  8. package/dist/app-protocol.js +21 -0
  9. package/dist/app-wire.d.ts +24 -3
  10. package/dist/app-wire.js +19 -4
  11. package/dist/audio.d.ts +65 -0
  12. package/dist/audio.js +162 -0
  13. package/dist/browser.d.ts +2 -0
  14. package/dist/browser.js +2 -0
  15. package/dist/bundle.d.ts +2 -0
  16. package/dist/bundle.js +2 -0
  17. package/dist/capture.d.ts +22 -0
  18. package/dist/capture.js +99 -0
  19. package/dist/cli.js +3 -1
  20. package/dist/commands.d.ts +6 -0
  21. package/dist/commands.js +17 -0
  22. package/dist/index.d.ts +5 -2
  23. package/dist/index.js +1 -0
  24. package/dist/links.d.ts +21 -0
  25. package/dist/links.js +43 -0
  26. package/dist/os.d.ts +33 -8
  27. package/dist/os.js +68 -14
  28. package/dist/preview-parent.d.ts +8 -2
  29. package/dist/preview-parent.js +35 -10
  30. package/dist/preview-ui.js +1 -1
  31. package/dist/preview.js +1 -1
  32. package/dist/templates/plain/game.js +3 -1
  33. package/dist/testing.d.ts +15 -2
  34. package/dist/testing.js +64 -19
  35. package/dist/transport.d.ts +2 -0
  36. package/dist/transport.js +1 -1
  37. package/dist/vibemarket-os.js +1 -1
  38. package/examples/paw-beat/README.md +28 -9
  39. package/examples/paw-beat/game.ts +280 -123
  40. package/examples/paw-beat/index.html +18 -4
  41. package/examples/paw-beat/main.ts +101 -44
  42. package/examples/paw-beat/music.ts +72 -337
  43. package/examples/paw-beat/stage.ts +23 -9
  44. package/examples/paw-beat/store/screenshot-1.webp +0 -0
  45. package/examples/paw-beat/store/screenshot-2.webp +0 -0
  46. package/examples/paw-beat/synth.ts +477 -0
  47. package/examples/paw-beat/tracks.ts +286 -0
  48. package/examples/paw-beat/vibemarket.json +2 -2
  49. package/examples/vibexp-app/plain/game.ts +6 -2
  50. package/package.json +7 -1
  51. package/skill.md +399 -0
package/AGENTS.md CHANGED
@@ -1,9 +1,10 @@
1
- # VibeStore app author contract — @vibechain/os 0.5.0
1
+ # VibeStore app author contract — @vibechain/os 0.5.2
2
2
 
3
3
  This is the contract for people and agents building apps for VibeStore, the app
4
4
  store inside VibeMarket OS. Read it with [README.md](README.md) (API, helpers and
5
5
  the listing table) and [SECURITY.md](SECURITY.md) (sandbox and limits). The public
6
- guide is https://vibechain.com/os/docs.
6
+ guide is https://vibechain.com/os/docs. Coding agents: start from the agent skill,
7
+ https://vibechain.com/os/skill.md, generated from this package for its version.
7
8
 
8
9
  ## What you build
9
10
 
@@ -18,7 +19,7 @@ declares in `network` (below).
18
19
  ## Start
19
20
 
20
21
  ```sh
21
- npx --yes @vibechain/os@0.5.0 init my-app # TypeScript + canvas; or --template three, or --template plain
22
+ npx --yes @vibechain/os@0.5.2 init my-app # TypeScript + canvas; or --template three, or --template plain
22
23
  cd my-app
23
24
  npm install
24
25
  npm run build
@@ -51,14 +52,26 @@ Every rejection is an `OsError` with a stable `code` (`unsupported`,
51
52
  `not-permitted`, `invalid`, `too-large`, `rate-limited`, `needs-click`,
52
53
  `unavailable`, `timeout`, `closed`); refusals keep the app running. `game.finish`
53
54
  takes one integer score from 0 to 1,000,000,000, once per open window; the host
54
- owns the results screen and the score grants nothing. Saves are coalesced (one
55
+ owns the results screen. The score is display data: it never sets a reward. A finished round of an approved app may earn the player a small amount of Printer Cash, decided and paid by VibeMarket OS within per-player daily caps. The app cannot grant, see or influence the amount, and nothing an app sends is trusted for it. Saves are coalesced (one
55
56
  write per 10 seconds) and kept on the server, except a guest's, which last only
56
- while the window is open. `os.pack(slug)` and `os.showPack(slug)` work for linked
57
- packs; `os.cards()` and `os.packs()` with `cards` declared. Pointer lock,
57
+ while the window is open. `os.pack(slug)`, `os.showPack(slug)`,
58
+ `os.showCard(slug, cardId)` and `os.open(link)` (app links `vmos://pack/<slug>`,
59
+ `vmos://card/<slug>/<cardId>` and `https://vibechain.com/os/pack/<slug>`) work
60
+ for any public pack, linked or not, on a click while the app is in front, at most
61
+ one per 10 seconds; buying happens only in VibeMarket's own window and the app
62
+ learns nothing from it. `os.cards()` and `os.packs()` need `cards` declared. Pointer lock,
58
63
  gamepads, audio, WebAssembly and `blob:` workers (`spawnWorker`) work; threads
59
64
  and `SharedArrayBuffer` do not. `os.fullscreen()` asks the host after a click.
60
- Optional helpers: `@vibechain/os/loop`, `@vibechain/os/canvas` and
65
+ The optional `os.onCapture?.(() => canvasOrDataUrl)` customises the picture the desktop camera takes of your app (by default the SDK sends the largest visible canvas, so canvas and WebGL games need nothing; apps built with an older SDK show a placeholder in desktop photos). Optional helpers: `@vibechain/os/loop`, `@vibechain/os/canvas` and
61
66
  `@vibechain/os/testing` (`createFakeOs`, an in-memory host for unit tests).
67
+
68
+ **Sound belongs to the desktop.** Follow `os.sound` (`{ muted, volume }`) and
69
+ `os.onSound`: silent while muted, scaled by the volume, live. A sandboxed frame
70
+ cannot be muted from outside, so review checks that the app follows it. Use
71
+ `createAudio(os)` from `@vibechain/os/audio` and connect everything you play to
72
+ `audio.master`; a game's own sound button is `audio.muted`, an extra mute that
73
+ never overrides the desktop's, and the game never says "sound on" while the
74
+ desktop is muted.
62
75
  `connectVibeMarketApp()` (0.4) still works and is deprecated.
63
76
 
64
77
  ## What an app cannot do
@@ -143,8 +156,8 @@ npm run pack # os pack dist app.zip
143
156
  Submit only what you are willing to publish permanently. Staff choose which
144
157
  approved version is live.
145
158
 
146
- Apps open in the browser version of VibeMarket OS. The Steam client shows a
147
- notice with a link instead of opening them, and the mobile apps do not run them.
159
+ Apps open in VibeMarket OS in the browser and in the VibeMarket Steam client;
160
+ the mobile apps do not run them.
148
161
 
149
162
  ## Market-game API (not for VibeStore apps)
150
163
 
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # @vibechain/os
2
2
 
3
- Build games, tools and desktop apps for VibeMarket OS. One `connect()` gives your app readiness, a save that follows the player, who is playing, their vmOS cards and packs, a signed statement of the player for your own server, and a score. Use TypeScript with a bundler, or two `<script>` tags and nothing to install.
3
+ Build games, tools and desktop apps for VibeMarket OS. Coding agents: read the agent skill, https://vibechain.com/os/skill.md. One `connect()` gives your app readiness, a save that follows the player, who is playing, their vmOS cards and packs, a signed statement of the player for your own server, and a score. Use TypeScript with a bundler, or two `<script>` tags and nothing to install.
4
4
 
5
5
  ## Quickstart
6
6
 
7
7
  ```sh
8
- npx --yes @vibechain/os@0.5.0 init my-app # TypeScript, esbuild and a 2D canvas (the default)
9
- npx --yes @vibechain/os@0.5.0 init my-app --template three # TypeScript, esbuild and Three.js: a spinning vmOS card
10
- npx --yes @vibechain/os@0.5.0 init my-app --template plain # index.html + game.js, nothing to install
8
+ npx --yes @vibechain/os@0.5.2 init my-app # TypeScript, esbuild and a 2D canvas (the default)
9
+ npx --yes @vibechain/os@0.5.2 init my-app --template three # TypeScript, esbuild and Three.js: a spinning vmOS card
10
+ npx --yes @vibechain/os@0.5.2 init my-app --template plain # index.html + game.js, nothing to install
11
11
  ```
12
12
 
13
13
  For `canvas` and `three`: `cd my-app`, `npm install`, `npm run build`, `npm run dev`, and open the printed `http://127.0.0.1:PORT` address. `npm run check` (`os check`) lists every problem with the manifest and the build at once, and `npm run pack` writes `app.zip`. For `plain`: `npx @vibechain/os preview my-app`; the folder is already the app, so zip it to submit. Every template's `vibemarket.json` is a complete schema version 3 listing with placeholder text and pictures you must replace first (an unchanged starter is rejected at review).
@@ -15,7 +15,7 @@ For `canvas` and `three`: `cd my-app`, `npm install`, `npm run build`, `npm run
15
15
  To install from a downloaded SDK archive, supply its absolute path to npm and the initializer:
16
16
 
17
17
  ```sh
18
- npm exec --yes --package=/absolute/path/vibechain-os-0.5.0.tgz -- os init my-app /absolute/path/vibechain-os-0.5.0.tgz
18
+ npm exec --yes --package=/absolute/path/vibechain-os-0.5.2.tgz -- os init my-app /absolute/path/vibechain-os-0.5.2.tgz
19
19
  ```
20
20
 
21
21
  That keeps a `file:` archive dependency; retain the archive for later reinstalls. Use a supported Node.js release: `^22.23.4`, `^24.22.1` or `^26.12.1`. The library is ESM-only (`import`, or dynamic `import()` from CommonJS); browsers without a bundler use `vibemarket-os.js` (below).
@@ -35,15 +35,18 @@ await os.save(save); // JSON, up to 1 MiB, coalesced
35
35
  const cards = await os.cards(); // the Card[] the manifest permits; os.cards("rooftop-rats") filters
36
36
  const off = os.onCards(next => {}); // the whole list again whenever it changes; returns unsubscribe
37
37
  const packs = await os.packs(); // PackSummary[]
38
- const pack = await os.pack("rooftop-rats"); // the full public card list
39
- await os.showPack("rooftop-rats"); // the host opens the pack; needs a click
38
+ const pack = await os.pack("born-to-vibe"); // any public pack's face: name, cover, cards with art
39
+ await os.showPack("born-to-vibe"); // VibeMarket opens the pack; needs a click
40
+ await os.showCard("born-to-vibe", "b1"); // ...or one card on its pack's page
41
+ await os.open("vmos://pack/born-to-vibe"); // ...or an app link (packLink, cardLink, parseVmosLink)
40
42
 
41
43
  const me = await os.player(); // { guest: false, handle, username?, name, picture, token?, expiresAt? } or { guest: true }
42
44
  await os.finish({ score: 42 }); // one integer score, 0 to 1,000,000,000
43
45
 
44
46
  os.onPause(() => {}); os.onResume(() => {});
45
47
  os.onResize(({ width, height }) => {});
46
- os.size; os.active; os.guest; // current values
48
+ os.onSound(({ muted, volume }) => {}); // the desktop's speaker and volume changed
49
+ os.size; os.active; os.guest; os.sound; // current values; os.sound is { muted, volume } (0 to 1)
47
50
  await os.maximize(); await os.fullscreen();
48
51
  os.close(); // release the port
49
52
  ```
@@ -57,14 +60,16 @@ os.close(); // release the port
57
60
  | `invalid` | A bad argument: not JSON, a bad pack slug, a number out of range. |
58
61
  | `too-large` | A save over 1 MiB, or over the player's 8 MiB across all apps. |
59
62
  | `rate-limited` | Too often; try later. |
60
- | `needs-click` | `showPack` or `fullscreen` without a fresh click in the app. |
63
+ | `needs-click` | `showPack`, `showCard`, `open` or `fullscreen` without a fresh click in the app. |
61
64
  | `unavailable` | The host or server could not answer now; retry. |
62
65
  | `timeout` | No answer in 10 seconds. |
63
66
  | `closed` | The session ended: the window closed, the app was revoked, or a limit. |
64
67
 
65
68
  **Saves.** `os.save(value)` stores one JSON value per player per app on VibeMarket's servers: at most 1 MiB as UTF-8 JSON, nested at most 64 deep, finite numbers only. It survives closing the window, other devices and reinstalling; a save not written for 365 days is deleted, and the player can delete it from the app's VibeStore page. Calls made sooner than the host accepts (one write in flight, at most one every 10 seconds) replace the pending value, and every caller's promise resolves with the write that carries it, so call it as often as you like. Saves are accepted while the window is behind another one: `os.onPause(() => os.save(state))` is the place to save. Two devices playing at once overwrite each other (last write wins). A guest's save lives only while the window is open (`os.guest`).
66
69
 
67
- **Cards and packs.** A manifest may link up to 3 vmOS packs by slug (the last part of `vibechain.com/os/pack/<slug>`), in `packs`. Linking someone else's pack takes effect once its creator approves the request your submission sends; your own packs are linked at once. With `packs` alone, `os.pack(slug)` returns the public card list (cards the player does not hold included, to draw them locked), `os.showPack(slug)` opens the pack in the market window, and the listing shows "Uses cards from". `"cards": "linked"` adds `os.cards()` and `os.packs()` for the player's holdings in those packs; `"cards": "all"` for every vmOS pack they hold. There is no prompt: the listing says what the app can see. An app never sees Nuggets, prices, Steam IDs or balances. Card art URLs are under your app's own address and send `Access-Control-Allow-Origin: *`: Three.js's `TextureLoader` uses them as WebGL textures as is; an `<img>` you create needs `img.crossOrigin = "anonymous"` before `src`. The [docs](https://vibechain.com/os/docs#sdk-05-card-game) show a card game skeleton (a deck builder) on these calls.
70
+ **Cards and packs.** A manifest may link up to 3 vmOS packs by slug (the last part of `vibechain.com/os/pack/<slug>`), in `packs`. Linking someone else's pack takes effect once its creator approves the request your submission sends; your own packs are linked at once. With `packs` alone, the listing shows "Uses cards from" and VibeMarket shows your game on the pack's page. `"cards": "linked"` adds `os.cards()` and `os.packs()` for the player's holdings in those packs; `"cards": "all"` for every vmOS pack they hold. There is no prompt: the listing says what the app can see. An app never sees Nuggets, prices, Steam IDs or balances. Card art URLs are under your app's own address and send `Access-Control-Allow-Origin: *`: Three.js's `TextureLoader` uses them as WebGL textures as is; an `<img>` you create needs `img.crossOrigin = "anonymous"` before `src`. The [docs](https://vibechain.com/os/docs#sdk-05-card-game) show a card game skeleton (a deck builder) on these calls.
71
+
72
+ **Showing any pack, and app links (0.5.1).** Any app can show and advertise any public vmOS pack, linked or not, with nothing in the manifest. `os.pack(slug)` returns its public face, what the pack's public page shows: name, creator, cover art and every card with its name, rarity and art (art URLs work as described above), never what the player holds. `os.showPack(slug)` opens the pack in VibeMarket inside vmOS, and `os.showCard(slug, cardId)` opens one card on its pack's page. An app link is one string you can put in your own content or get from your server: `vmos://pack/<slug>`, `vmos://card/<slug>/<cardId>`, or a pack's public page `https://vibechain.com/os/pack/<slug>` (or `www.`); `os.open(link)` opens it. `packLink(slug)` and `cardLink(slug, cardId)` write links and `parseVmosLink(text)` reads one (`{ kind: "pack", pack }`, `{ kind: "card", pack, card }` or `null`); the grammar is exact (lowercase scheme and host, no query, fragment, port or percent-encoding, at most 200 characters), and anything else answers `invalid` without reaching the host. `open` never navigates your frame: the SDK sends the host only the parsed pack or card. All three need the app ready and in front (`not-permitted`) and a fresh click in it (`needs-click`), share one budget of one per 10 seconds (`rate-limited`), and answer `invalid` for a pack that does not exist or was taken down or a card not in it. Buying and opening happen only in VibeMarket's own window, and your app learns nothing about what the player does there; it sees new holdings only through `os.cards()` and `onCards`, as the manifest permits. On a 0.5.0 host `showCard` and card links answer `unsupported`. The [docs](https://vibechain.com/os/docs#sdk-05-link-out) have the full rules and examples.
68
73
 
69
74
  **Network and the player.** A manifest may declare up to 8 servers in `network`: exact `https://` or `wss://` origins (a DNS name, no path, no IP addresses, no local or wildcard-DNS names). The app may then `fetch`, `WebSocket` and `EventSource` them, and load images, audio, video and fonts from the `https://` ones; never scripts, styles or workers. Your servers must answer the frame's `Origin: null` with `Access-Control-Allow-Origin: *` (or `null`) for `fetch` and for images used as textures. Version remote URLs and send a long `Cache-Control`: the app has no IndexedDB, Cache Storage or service worker. Every server you declare sees the player's IP address; the listing says "Connects to" and "Loads content from" your hosts, and what your server sends after review is still bound by the listing rules (no third-party advertising or analytics, no payments, no sign-in prompts).
70
75
 
@@ -74,11 +79,13 @@ os.close(); // release the port
74
79
 
75
80
  **Older hosts.** On a host older than 0.5, `ready`, `finish`, the lifecycle, `load` and `save` work (saves use the window-only 32 KiB checkpoint, and a larger one answers `too-large`); the rest answers `unsupported` and `progress` does nothing.
76
81
 
82
+ **Desktop photos.** The desktop camera cannot see inside a sandboxed app window, so it asks the app for its current frame (`app.capture`). `connect()` and `connectVibeMarketApp()` answer by default with the largest visible `<canvas>` on the page, taken on the next animation frame, scaled to at most 1280 pixels on its longest side and encoded as WebP (JPEG if WebP is unavailable) under 1,000,000 characters; a WebGL game needs no changes. An app that draws with the DOM, or wants a custom picture, registers `const off = os.onCapture?.(() => canvasOrDataUrl)` (optional; the 0.4 client has `sdk.onCapture` too): return an `HTMLCanvasElement`, a PNG/JPEG/WebP data URL, `null`, or a promise of one; the latest handler wins and the host waits about 1.2 seconds. Failures are silent. An app built with an older SDK shows a placeholder in desktop photos until it is rebuilt against this SDK.
83
+
77
84
  **Legacy API.** `connectVibeMarketApp()` and its `checkpoint` (0.4) keep working and keep their types, and are deprecated: `connect()` does the same and more on every host.
78
85
 
79
86
  ## Apps without a bundler
80
87
 
81
- `vibemarket-os.js` (in `dist/` of the package, copied by `os init --template plain`) defines one global, `VibemarketOS`, with `connect` and `OsError`. **Load it and your game from files: inline `<script>` code does not run**, because the runtime's policy allows scripts only from your app's own files.
88
+ `vibemarket-os.js` (in `dist/` of the package, copied by `os init --template plain`) defines one global, `VibemarketOS`, with `connect`, `OsError` and the link helpers `packLink`, `cardLink` and `parseVmosLink`. **Load it and your game from files: inline `<script>` code does not run**, because the runtime's policy allows scripts only from your app's own files.
82
89
 
83
90
  ```html
84
91
  <script src="vibemarket-os.js"></script>
@@ -95,7 +102,7 @@ VibemarketOS.connect().then(async os => {
95
102
 
96
103
  ## Game helpers
97
104
 
98
- `@vibechain/os/loop` and `@vibechain/os/canvas` take the result of `connect()` (or of the legacy `connectVibeMarketApp()`) and follow its lifecycle, so a game stops drawing when its window is not active.
105
+ `@vibechain/os/loop`, `@vibechain/os/canvas` and `@vibechain/os/audio` take the result of `connect()` (or of the legacy `connectVibeMarketApp()`) and follow its lifecycle, so a game stops drawing when its window is not active.
99
106
 
100
107
  ```ts
101
108
  import { connect } from "@vibechain/os";
@@ -110,6 +117,21 @@ os.ready();
110
117
  window.addEventListener("pagehide", () => { loop.stop(); os.close(); }, { once: true });
111
118
  ```
112
119
 
120
+ ### Sound
121
+
122
+ The desktop owns sound: its taskbar speaker and its game volume (on the website's desk, master volume × the Games fader) reach the app as `os.sound` and `os.onSound` (0.5.2; on an older host `os.sound` is `{ muted: false, volume: 1 }` and never changes). A sandboxed frame cannot be muted from outside in a browser, so this is cooperative: the app must follow it, and VibeStore review checks that it does. `@vibechain/os/audio` makes that the default:
123
+
124
+ ```ts
125
+ import { createAudio } from "@vibechain/os/audio";
126
+
127
+ const audio = createAudio(os); // ideally inside the first click; also takes connectVibeMarketApp()'s object
128
+ music.connect(audio.master); // connect everything you play to the master
129
+ audio.muted = !soundButtonOn; // optional: your own extra mute, which never overrides the desktop's
130
+ audio.onChange(() => { /* redraw a sound label; on a new audio.context, rebuild your nodes */ });
131
+ ```
132
+
133
+ The master is silent while the desktop is muted, follows its volume and ramps over 50 ms on every change (no clicks). The context is suspended after the ramp while the window is behind another one or minimized, and resumed when it comes back. A context the browser stopped (`suspended`, or WebKit's `interrupted` after an audio interruption, sleep or an output change) is resumed on every click, tap or key in the frame; one the browser closed, or one still stopped after 3 gestures, is replaced (at most 3 times), and `audio.context` and `audio.master` then name the new ones. `audio.paused = true` holds it suspended for your own pause (a menu, a lost GPU). `createLoop`'s pause and the helper's follow the same lifecycle and never fight. Show the real state: never "sound on" while `os.sound.muted` is true.
134
+
113
135
  `createLoop` runs a fixed-timestep simulation (default 60 steps per second, at most 5 catch-up steps per frame) and renders once per animation frame. It pauses while the app is inactive and discards that time instead of simulating it on return. `fitCanvas` sizes the canvas backing store from the host surface with the device pixel ratio capped (default 2, and at most 3840 x 2160 pixels), resizes only when the size changes, and keeps a lost WebGL context restorable through `onContextLost` and `onContextRestored`.
114
136
 
115
137
  ### Testing your game
@@ -123,11 +145,11 @@ const host = createFakeOs({ save: { best: 3 }, cards: myCards, packs: [myPack],
123
145
  const game = await startGame(host.os); // your code, given the os instead of connecting
124
146
  host.setCards(afterAPull); // onCards listeners hear about it
125
147
  host.setLifecycle({ active: false }); // as if the window was minimized
126
- host.click(); await game.openShop(); // showPack and fullscreen need a click
148
+ host.click(); await game.openShop(); // showPack, showCard, open and fullscreen need a click
127
149
  expect(host.save).toEqual({ best: 7 }); expect(host.finished).toEqual({ score: 7 });
128
150
  ```
129
151
 
130
- It applies the real save limits, slug checks, card access levels, single-shot score, click rule and error codes, and `protocol: 1` behaves like an older host. It has no time limits, rate limits or save coalescing, so still run the preview before you ship. `createFakeApp` is the same for the legacy `connectVibeMarketApp()` API.
152
+ It applies the real save limits, slug checks, card access levels, single-shot score, click rule, link grammar and error codes, and `protocol: 1` behaves like an older host. `packs` lists every public pack it knows (any of them works with `pack`, `showPack`, `showCard` and `open`), and `shownPacks` and `shownCards` record what the game asked to show. It has no time limits, rate limits or save coalescing, so still run the preview before you ship. `createFakeApp` is the same for the legacy `connectVibeMarketApp()` API.
131
153
 
132
154
  ### Complete examples
133
155
 
@@ -145,7 +167,7 @@ await app.game.finish({ score: 42 });
145
167
 
146
168
  `score` must be an integer from 0 through 1,000,000,000, with no other input fields. It is a reported game score. The host owns the final screen and Play again control. Completion is single-shot for that open controller, including suspended generations: retrying the same score acknowledges the accepted result; changing the score is rejected. The host posts acknowledgement before showing results. If the frame closes before it receives that acknowledgement, inspect the host result rather than assuming the completion failed.
147
169
 
148
- Completion does not grant Cash, XP, inventory or a wallet action. The local preview and collection host report score only. An approved host may show an existing Cash award only after its own registered game policy and server reward flow confirm it; the frame cannot select a reward amount or supply proof of payment. Older hosts may not understand this additive method; use a matching 0.2.x host/preview.
170
+ The score is display data: it never sets a reward. A finished round of an approved app may earn the player a small amount of Printer Cash, decided and paid by VibeMarket OS within per-player daily caps. The app cannot grant, see or influence the amount, and nothing an app sends is trusted for it. See [Rewards](https://vibechain.com/os/docs#rewards). Completion never grants XP, inventory or a wallet action, and the local preview and collection host report the score only. Older hosts may not understand this additive method; use a matching 0.2.x host/preview.
149
171
 
150
172
  ## Listing in VibeStore
151
173
 
@@ -187,7 +209,7 @@ Unknown fields are refused at every level, and version 3 refuses the four consta
187
209
 
188
210
  ## Publishing status
189
211
 
190
- Publish by submitting your packed ZIP from the VibeStore **Submit** tab in VibeMarket OS, or with `os submit` from your terminal; see [Publish](https://vibechain.com/os/docs#publish) and [Review](https://vibechain.com/os/docs#review). Installing the SDK does not list your app. An approved version is archived to public IPFS, so approval is publication: removing an app from VibeStore later does not recall that copy. Third-party apps open in the browser version of VibeMarket OS; the Steam client does not run them yet. The app API grants no native, payment, wallet or reward access, and card reads only as the manifest declares them. Existing Market games continue to use their separate permissioned API.
212
+ Publish by submitting your packed ZIP from the VibeStore **Submit** tab in VibeMarket OS, or with `os submit` from your terminal; see [Publish](https://vibechain.com/os/docs#publish) and [Review](https://vibechain.com/os/docs#review). Installing the SDK does not list your app. An approved version is archived to public IPFS, so approval is publication: removing an app from VibeStore later does not recall that copy. Third-party apps open in VibeMarket OS in the browser and in the VibeMarket Steam client. The app API grants no native, payment or wallet access and cannot grant, see or influence a reward, and card reads only as the manifest declares them. Existing Market games continue to use their separate permissioned API.
191
213
 
192
214
  See the [SDK docs](https://vibechain.com/os/docs) for the app API and [SECURITY.md](SECURITY.md) for the sandbox and resource limits.
193
215
 
@@ -213,16 +235,30 @@ npx os logout # revokes this computer's sign-in, then deletes it
213
235
 
214
236
  ## Maintainer workflow
215
237
 
238
+ The agent skill for app developers, **https://vibechain.com/os/skill.md**, is generated from this package: `tools/skill.ts` fills `tools/skill-template.md` with the version, the `Os` methods, the error and submission codes, the limits, the link grammar, the commands, the smallest app and the token check, and writes `skill.md`, which the website serves. `tests/skill.test.ts` (and the website's own test of the route) re-render it and fail on any difference, so an SDK change that alters one of those facts needs `pnpm skill` and the regenerated file in the same commit. A release bumps `package.json` and `OS_SDK_VERSION` together (a test binds them), then runs `pnpm skill`.
239
+
216
240
  ```sh
217
241
  pnpm install --frozen-lockfile
242
+ pnpm skill # regenerate skill.md from the SDK; pnpm review fails while it is stale
218
243
  pnpm review
219
244
  pnpm build
220
245
  pnpm check:package
221
- pnpm release:preview --version 0.5.0
246
+ pnpm release:preview --version 0.5.2
222
247
  ```
223
248
 
224
249
  `pnpm build` emits JavaScript/declarations, the bundled preview host UI, `dist/vibemarket-os.js` (the no-bundler IIFE) and `dist/templates/plain/game.js` (built from `examples/vibexp-app/plain/game.ts`, so the repository holds no authored JavaScript). Only `examples/paw-beat` and `examples/vibexp-app` (with its `plain` and `three` templates) are published; `examples/card-game` and `examples/verify-player.ts` are type-checked and tested here and shown on the docs site. The store images of both examples are generated by scripts in `tools/` (not published), which drive headless, muted Chromium through Playwright. Read [SECURITY.md](SECURITY.md) before integrating any untrusted app.
225
250
 
251
+ ## Changes in 0.5.2 (since 0.5.1)
252
+
253
+ - **New: the desktop's sound.** The host sends `app.sound` (`{ muted, volume }`) with the port, before any answer, and on every change; `Os.sound` and `Os.onSound` are new, and the 0.4 object gains `sound.current()` and `sound.onChanged()`. `@vibechain/os/audio` (`createAudio`, also on the `VibemarketOS` global) gives an AudioContext and a master that follow it, the window and the browser's gesture rule, and recover a stopped or closed context. Nothing existing changed: older apps ignore the event, and on an older host the sound reads audible at full volume. The fake hosts (`setSound`) and the preview (a speaker and volume in its header) let you test it.
254
+ - **Paw Beat 1.2.0.** The bundled example has six original tracks; a random one plays each round, with a best score per track.
255
+
256
+
257
+ ## Changes in 0.5.1 (since 0.5.0)
258
+
259
+ - **New, optional: desktop photos.** The host may send `app.capture` and the SDK answers with a new `app.frame` request carrying the app's picture (by default its largest visible canvas). `Os.onCapture` and `VibeMarketAppSdk.onCapture` are new optional hooks to supply your own picture. Nothing existing was renamed or removed, and no app needs a code change: an app built with an older SDK, or one that sends nothing, is shown as its icon and name in desktop photos.
260
+ - **New: link out to any pack or card.** `os.pack` and `os.showPack` work for any public pack, linked or not; `os.showCard(slug, cardId)` and `os.open(link)` are new, with the pure helpers `packLink`, `cardLink` and `parseVmosLink` (also on the no-bundler `VibemarketOS` global). One new protocol message, `card.show`, advertised as the hello feature `"card.show"`; on a host without it `showCard` and card links answer `unsupported`.
261
+
226
262
  ## License
227
263
 
228
264
  This package, including its bundled examples, is licensed under [MIT](LICENSE), copyright 2026 Beb, Inc. This license applies only to `@vibechain/os`; it does not relicense VibeMarket OS host code, other Vibechain software, other SDK packages or third-party dependencies. Their own terms continue to apply.
package/SECURITY.md CHANGED
@@ -33,7 +33,7 @@ The flag is a claim made by the client's page-level marker, not a credential. On
33
33
  - The additive app codec uses bounded JSON on the existing channel/envelope/port transport. Legacy Market messages stay unchanged. Wrong session, replayed IDs, unknown methods, invalid schemas, malformed/oversized messages and quota exhaustion close the port. No implicit Market permissions are inherited.
34
34
  - Close, navigation, minimize, hidden document, identity or package change revoke the active generation, and so does losing the front to another desktop window once a 60 second grace has run out. Within the grace the website's desk keeps the backgrounded frame and its session: the app is sent `active: false`, the frame is `display: none` and inert (never painted, hit or focused; the keyboard goes back to the desk), and its `game.finish` and `app.checkpoint.set` requests are withheld, neither applied nor answered, as they would be lost for a suspended app; reads are answered, saves (`app.save.set`, protocol 2) are accepted because that is when a game saves, `pack.show` and the display methods answer `not-permitted`, and every request still counts against the limits below. Returning in front within the grace re-activates the same frame, controller and session. The grace timer is the host's, starts when the window leaves the front, and nothing the app sends extends it; at most one app frame lives on the page, and opening another app tears the backgrounded one down at once. This is a cooperative pause, not a sandbox: until the host's frame-time watchdog exists (it does not yet), a hostile backgrounded app can keep its timers, workers and audio running for up to 60 seconds (Chromium stops a hidden frame's animation frames; WebKit does not), bounded only by the one-frame cap, the grace and the immediate teardown on a hidden page. Revocation preserves only the same app's host-accepted bounded checkpoint. Restore after revocation creates a fresh iframe, challenge and session. Host focus uses desktop policy, not the browser `blur` event caused by focusing the child itself.
35
35
  - The app receives no session, Steam ID, account id, balance, wallet address, Steam ticket, native handle, money, arbitrary HTTP relay or credential for any vibechain.com route. What it can receive (protocol 2, after `host.hello`): its own save (JSON it wrote, at most 1 MiB, parsed and validated, never merged into host objects); the card holdings its manifest declares (`cards: "linked"` for its effective linked packs, `cards: "all"` for every vmOS pack the player holds, with no prompt; card id, pack slug, name, rarity, count and an art path under the app's own prefix, never an internal pack id, pull id, Nugget or Printer Cash amount or foil); public pack card lists; and who is playing (owner decision 2026-11-23, "just tell the app who the user is"): for every schema 3 app, without a permission, the player's public vmOS identity, exactly what their public profile shows anyone (the fixed `handle`, the @`username` when it differs, the display `name` and the profile `picture` as a path under the app's own prefix), or `{ guest: true }` for a guest; and, only for apps whose manifest declares `network`, a 5-minute Ed25519 token stating that identity, whose audience is the app id and which no vibechain.com route accepts. The host re-checks every card, pack and player value against strict shapes before it reaches the app, so an extra field cannot ride along. There is no anonymous or per-app id: the same player is the same handle in every app, so apps can recognize and correlate a player, and everything an app sends to its declared servers (identity, holdings, save, gameplay) reaches them tied to the player's public profile, together with the player's IP address. The listing says what an app can see and where it connects. Checkpoints (legacy) contain only the app's own JSON. An app must not ask people to enter secrets inside its UI.
36
- - `game.finish` accepts only an integer score from 0 through 1,000,000,000. It cannot carry Cash, XP, receipts or grant instructions. The first score is retained across suspension; same-score retries acknowledge without a second host callback, and changed scores are refused. The host posts its acknowledgement before notifying its results UI. Callback throws or acknowledgement failure never authorize another award. Stale generations cannot notify the host. A reported score is not reward proof; only a separately registered host/server policy can confirm an existing Cash award.
36
+ - `game.finish` accepts only an integer score from 0 through 1,000,000,000. It cannot carry Cash, XP, receipts or grant instructions. The first score is retained across suspension; same-score retries acknowledge without a second host callback, and changed scores are refused. The host posts its acknowledgement before notifying its results UI. Callback throws or acknowledgement failure never authorize another award. Stale generations cannot notify the host. A reported score is not reward proof. The score is display data: it never sets a reward. A finished round of an approved app may earn the player a small amount of Printer Cash, decided and paid by VibeMarket OS within per-player daily caps. The app cannot grant, see or influence the amount, and nothing an app sends is trusted for it.
37
37
 
38
38
  ## Enforced accepted-work limits
39
39
 
@@ -55,7 +55,7 @@ A host that supplies protocol 2 services (an apps3 host: the desk with its `apps
55
55
  | Schema version 3 manifest | | at most 3 linked packs, 8 declared origins |
56
56
  | First Desk adapter | One open third-party app controller and at most one untrusted iframe | same |
57
57
 
58
- Policy outcomes (a missing permission, the app loading or behind another window, a soft rate, a missing click, a quota, an unavailable server) are answered with one of nine stable codes and keep the session. Protocol violations (malformed or unknown messages, schema errors, a second hello, a lower or repeated id, a request over its method's bound, the hard limits above) end it. `pack.show` and entering `display.fullscreen` act only while the app is ready and in front; the host additionally checks fresh user activation on its own page and answers `needs-click`. Leaving fullscreen is always allowed.
58
+ Policy outcomes (a missing permission, the app loading or behind another window, a soft rate, a missing click, a quota, an unavailable server) are answered with one of nine stable codes and keep the session. Protocol violations (malformed or unknown messages, schema errors, a second hello, a lower or repeated id, a request over its method's bound, the hard limits above) end it. `pack.show`, `card.show` and entering `display.fullscreen` act only while the app is ready and in front; the host additionally checks fresh user activation on its own page and answers `needs-click`. Leaving fullscreen is always allowed.
59
59
 
60
60
  The local preview snapshots admitted files once using bounded no-follow file-handle reads, then serves only that immutable in-memory map, exact fixed host assets and stand-in card art (the bundle's own listing icon, under the version prefix). It is an apps3 host with stand-in services: six fake cards per linked pack, a save in the parent page's own browser storage, and an unsigned placeholder player token for apps that declare `network`; its runtime responses carry the production policy from `appRuntimeCsp`, with the preview's asset prefix and parent. It has no URL proxy, arbitrary filesystem route, write route or credential. Local filesystem authoring is not the public upload trust boundary; the existing ZIP validator remains responsible for untrusted uploads. The preview requires `127.0.0.1` for the parent and a different `localhost` runtime host, validates Host headers, never auto-opens a browser, and closes owned connections on shutdown.
61
61
 
@@ -65,6 +65,10 @@ The browser allocates structured-clone data before host validation. Message byte
65
65
 
66
66
  The runtime policy (`appRuntimeCsp`, `@vibechain/os/policy`) limits scripts, styles and workers' first scripts to the version's own files, and every fetch, image, media and font to those files plus, for a version whose manifest declares `network`, its declared origins: every origin in `connect-src`, the `https://` ones also in `img-src`, `media-src` and `font-src`, and never in `script-src`, `style-src`, `worker-src`, `child-src`, `frame-src` or `object-src`. Declared origins are re-validated (`networkOrigin`: https or wss, a public DNS name, no IP address in any form, no local, reserved or wildcard-DNS name, no Vibechain domain) and a list that is not normalized throws rather than produce a partial policy. What it cannot stop: text fetched from a declared server run in a `blob:` worker (`worker-src blob:` stays, for engines and decoders), `WebAssembly.instantiate` on fetched bytes, fetched CSS put into a `<style>` element, an interpreter in the bundle running server-sent programs, and server data driving behaviour. So "the reviewed code is the code that runs" holds for the files VibeStore hosts and is listing policy for everything else: an app whose behaviour changes after review because its server says so breaches the listing rules and is removed by revocation; it is not confined. A declared name can also resolve to a private address; Chromium's Private Network Access narrows that in one engine only. Every declared server sees the player's IP address. Network apps may not embed third-party advertising or analytics SDKs (review rule, owner decision 2026-11-23). WebRTC is not governed by CSP: an app can open peer connections in every measured engine, so the listing allows WebRTC only for play between players signalled through declared servers. A sandboxed app can also navigate its own frame to an external URL; navigation revokes the session after load, but a request may already have occurred. Do not describe any of this as a network firewall or supply secrets that require one. Known native bridge markers and embedded user agents are denied, except the Steam client's own two markers when it claims app frames (see Host admission); their absence does not certify unknown webviews, and that claim does not certify the client. Native IPC provenance tests on each platform remain the client's gate before a build sets the flag.
67
67
 
68
+ **Sound (0.5.2).** The desktop's speaker and volume reach an app only as the `app.sound` event (`{ muted, volume }`, validated exactly by both ends): sent with the port before any answer, and on every change. It is cooperative, not enforcement: a browser cannot mute a sandboxed cross-origin frame from outside, so an app that ignores it, or a client older than 0.5.2, keeps sounding until its window goes behind another (then the lifecycle and, after the grace, teardown stop it) or the app is closed. Following the desktop's sound is a review rule, and `@vibechain/os/audio` follows it by default. The event tells the app nothing about the player beyond the desktop's own sound setting.
69
+
70
+ **Showing packs and cards (0.5.1).** Any app may show any public pack (one that exists and is not taken down), linked or not: `cards.pack` answers the pack's public face, exactly what its public page shows (name, creator, cover, card names, rarities and art under the app's own prefix) and never holdings, which come only from `cards.list` as the manifest declares. `pack.show` and `card.show` ask the host to open the pack or one card in VibeMarket's market window. `os.open(link)` accepts only the exact app-link grammar (`vmos://pack/<slug>`, `vmos://card/<slug>/<cardId>`, `https://vibechain.com/os/pack/<slug>` or `www.`, at most 200 characters, no percent-encoding, query, fragment, port, user or other host), parses it in the SDK and sends only the parsed slug and card id; neither the SDK nor the host navigates to the string. The host acts only while the app is ready and in front and on fresh user activation on its own page (`needs-click`), at most once per 10 seconds across both methods (`rate-limited`), and answers `invalid` for an unknown or taken-down pack or a card not in it. The market window's Buy and Open controls are the host's own and ignore clicks for 500 ms after it opens, and the app is never told whether anything was bought or opened, so showing a pack tells it nothing new about the player and grants it nothing.
71
+
68
72
  **Player identity.** An app learns the player's public identity and nothing private: the handle, @name, display name and picture their public profile already shows. The token is a 5-minute Ed25519 JWT (`sub` = the handle, plus `username`, `name`, `guest: false`, `aud` = the app id) signed by the backend only, for apps that declare `network`, so their servers can trust who is playing instead of a handle the client claims; guests get none; public keys are at `https://vibechain.com/.well-known/vmos-app-keys.json`. It is a statement for the app's own server, not a credential: no vibechain.com route accepts it. A server that does not check `aud` would accept another app's tokens; the verification sample in the docs (https://vibechain.com/os/docs#sdk-05-verify) checks it. Within its 5 minutes a token can be replayed; servers that need one-time use keep `jti`.
69
73
 
70
74
  **Owner decisions applied (2026-11-23).** An app is told who is playing (its public identity; no anonymous ids), and `cards: "all"` reads every vmOS pack the player holds with no consent prompt: the listing discloses both. Fullscreen goes through the host: the app's window, with a host-drawn strip naming the app and offering Report and Exit, enters the browser's full screen; the frame never gets the Fullscreen API (`fullscreen=()` stays in the runtime's Permissions-Policy) and Escape always leaves. Saves are kept on uninstall and revocation, deleted after 365 days without a write, on the player's request and with the account. Network apps carry no third-party advertising or analytics SDKs (a review rule).
@@ -1,5 +1,6 @@
1
- import { APP_FRAGMENT, APP_LIMITS, appNonce, checkpointValue, lifecycleValue } from "./app-protocol.js";
1
+ import { APP_FRAGMENT, APP_LIMITS, AUDIBLE, appNonce, checkpointValue, lifecycleValue, soundValue, FRAME_MESSAGE_BYTES } from "./app-protocol.js";
2
2
  import { connectHostPort, createRpcTransport } from "./transport.js";
3
+ import { createCapturer } from "./capture.js";
3
4
  import { gameFinishInput } from "./completion.js";
4
5
  /**
5
6
  * The 0.4 app API: readiness, lifecycle, the window-only checkpoint and one score.
@@ -19,11 +20,30 @@ export async function connectVibeMarketApp(signal) {
19
20
  export function createAppPortSdk(port, session) {
20
21
  if (!appNonce(session))
21
22
  throw Error("Invalid app session.");
22
- let state = Object.freeze({ active: true, width: 0, height: 0 });
23
- const listeners = new Set();
23
+ let state = Object.freeze({ active: true, width: 0, height: 0 }), sound = AUDIBLE;
24
+ const listeners = new Set(), sounds = new Set();
24
25
  const transport = createRpcTransport(port, {
25
- session, timeoutMs: APP_LIMITS.requestTimeoutMs, maxPending: APP_LIMITS.inFlight, jsonBytes: APP_LIMITS.responseBytes,
26
+ session, timeoutMs: APP_LIMITS.requestTimeoutMs, maxPending: APP_LIMITS.inFlight, jsonBytes: APP_LIMITS.responseBytes, outBytes: FRAME_MESSAGE_BYTES,
26
27
  onEvent(value) {
28
+ if (value.event === "app.capture") {
29
+ capturer.event(value.id);
30
+ return;
31
+ }
32
+ if (value.event === "app.sound") {
33
+ let next;
34
+ try {
35
+ next = soundValue(value.state);
36
+ }
37
+ catch {
38
+ return;
39
+ }
40
+ if (next.muted === sound.muted && next.volume === sound.volume)
41
+ return;
42
+ sound = next;
43
+ for (const listener of [...sounds])
44
+ listener(sound);
45
+ return;
46
+ }
27
47
  if (value.event !== "app.lifecycle")
28
48
  return;
29
49
  try {
@@ -36,6 +56,8 @@ export function createAppPortSdk(port, session) {
36
56
  listener(state);
37
57
  },
38
58
  });
59
+ const capturer = createCapturer((id, image) => { transport.request({ method: "app.frame", id, image }).catch(() => { }); }, () => destroyed);
60
+ let destroyed = false;
39
61
  const complete = (result) => { if (!("completed" in result) || result.completed !== true)
40
62
  throw Error("Invalid app acknowledgement."); };
41
63
  return Object.freeze({
@@ -47,6 +69,8 @@ export function createAppPortSdk(port, session) {
47
69
  async write(value) { complete(await transport.request({ method: "app.checkpoint.set", value: checkpointValue(value) })); },
48
70
  }),
49
71
  lifecycle: Object.freeze({ current: () => state, onChanged(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; } }),
50
- destroy() { listeners.clear(); transport.destroy(); },
72
+ sound: Object.freeze({ current: () => sound, onChanged(listener) { sounds.add(listener); return () => { sounds.delete(listener); }; } }),
73
+ onCapture(handler) { return capturer.on(handler); },
74
+ destroy() { destroyed = true; capturer.clear(); listeners.clear(); sounds.clear(); transport.destroy(); },
51
75
  });
52
76
  }
@@ -1,9 +1,17 @@
1
1
  import type { GameFinishInput } from "./completion.ts";
2
- import { type AppLifecycle } from "./app-protocol.ts";
2
+ import { type AppLifecycle, type AppSound } from "./app-protocol.ts";
3
3
  import { type Player, type WireCard, type WirePack, type WirePackSummary } from "./app-wire.ts";
4
4
  export interface AppSession {
5
5
  lifecycle(value: AppLifecycle): void;
6
6
  close(): void;
7
+ /** Tell the app the desktop's sound (`app.sound`, any protocol; clients before 0.5.2 ignore it). */
8
+ sound(value: AppSound): void;
9
+ /**
10
+ * Ask a protocol 2 app for its current frame (`app.capture` / `app.frame`): a PNG, JPEG or WebP data URL, or null when
11
+ * there is none (protocol 1, no hello yet, the app has no picture, the timeout, the session ended, a newer capture took
12
+ * over). One capture is pending at a time. Never rejects.
13
+ */
14
+ capture(timeoutMs?: number): Promise<string | null>;
7
15
  }
8
16
  /**
9
17
  * `current`: this generation is the live one (its frame is mounted for this app and the page is shown). `foreground`: its
@@ -50,10 +58,15 @@ export interface AppHostServices {
50
58
  }>;
51
59
  /** the permitted packs with what the player holds of each */
52
60
  packs(): Promise<WirePackSummary[]>;
53
- /** one pack's public card list, for a pack the app may read */
61
+ /** the public face of any public pack (exists, not taken down): never holdings; throw `invalid` for an unknown or taken-down pack */
54
62
  pack(slug: string): Promise<WirePack>;
55
- /** open the market window on a pack (check activation and permission) */
63
+ /** open the market window on any public pack; throw `needs-click` without a fresh activation, `invalid` for an unknown or taken-down pack */
56
64
  showPack(slug: string): Promise<void>;
65
+ /**
66
+ * open that card in its pack's page (0.5.1); the same rules as `showPack`, and `invalid` for a card not in the pack. Without it
67
+ * the host does not offer `card.show`, and a 0.5.1 client answers `os.showCard` with `unsupported` itself.
68
+ */
69
+ showCard?(slug: string, card: string): Promise<void>;
57
70
  /** the player's public identity (`picture` as a path after the version prefix), or `{ guest: true }`; `token` and `expiresAt` only for an app that declares `network` */
58
71
  player(): Promise<Player>;
59
72
  maximize(on: boolean): Promise<void>;
@@ -89,12 +102,22 @@ export interface AppFrameOptions {
89
102
  finish?: (result: Readonly<GameFinishInput>) => void;
90
103
  /** protocol 2: the app's loading progress, 0 to 1, for the host's loading bar */
91
104
  progress?: (fraction: number) => void;
105
+ /**
106
+ * The desktop's sound when the frame connects (0.5.2). It reaches the app with the port, ahead of any answer, so a 0.5.2
107
+ * `connect()` has it when it resolves; send every change with `setSound`. Without it the app hears nothing about sound and
108
+ * plays at full volume.
109
+ */
110
+ sound?: AppSound;
92
111
  }
93
- /** One mounted frame. `setActive` sends the app its lifecycle's `active` flag; `resize` keeps it. */
112
+ /** One mounted frame. `setActive` sends the app its lifecycle's `active` flag; `resize` keeps it; `setSound` sends the desktop's sound. */
94
113
  export interface MountedAppFrame {
95
114
  resize(width: number, height: number): void;
96
115
  setActive(active: boolean): void;
97
116
  dispose(): void;
117
+ /** the desktop's sound changed (the taskbar speaker or the volume): the app hears it at once, and a frame that connects later on connecting */
118
+ setSound(sound: AppSound): void;
119
+ /** the app's current frame as a data URL (see `AppSession.capture`), or null; also null when there is no session or it ended */
120
+ capture(timeoutMs?: number): Promise<string | null>;
98
121
  }
99
122
  /**
100
123
  * Caller supplies the already-validated immutable URL, including this generation's fragment. With a protocol 2