@vestra-player/sdk 1.11.0-rc.4 → 1.11.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
@@ -2,16 +2,16 @@
2
2
 
3
3
  ## 1.11.0
4
4
 
5
- **The second batch of events, no capability disclosure, and the built-in-only refusal renamed** (user rulings 2026-11-16 and 2026-11-21). Plugins have no capabilities, neither as declarations (gone since 1.9.0) nor as a disclosure: the name-based scan and its table are removed, and the plugin store no longer shows what a plugin's code uses. The player's real API boundaries stay (request validation and the built-in-only requests); their refusal now has the code `builtin-only`. Breaking, released as a minor without an alias, since every plugin is the project's own (ruling 2026-11-21). Who must change: a tool that runs `vestra-plugin scan` or reads `@vestra-player/sdk/capability-scan.json`, and a plugin that compares `error.code` for a built-in-only call (below).
5
+ **The second batch of events, no capability disclosure, and the built-in-only refusal renamed** (user rulings 2026-11-16 and 2026-11-21). Plugins have no capabilities, neither as declarations (gone since 1.9.0) nor as a disclosure: the name-based scan and its table are removed, and the plugin store no longer shows what a plugin's code uses. The player's real API boundaries stay (request validation and the built-in-only requests); their refusal now has the code `builtin-only`. Breaking, released as a minor without an alias, since every plugin is the project's own (ruling 2026-11-21). Who must change: a plugin that calls `player.subscribe()` or `player.onChange()`, a tool that runs `vestra-plugin scan` or reads `@vestra-player/sdk/capability-scan.json`, and a plugin that compares `error.code` for a built-in-only call (below).
6
6
 
7
7
  **The second batch of events** (needs the player version that sends them, 0.11):
8
8
 
9
9
  - **Fact events** (new, `FactEvent` and `FactEventPayloads`, a third overload of `player.on`): `video.reconfigured` (`{ sourceId, width, height, displayWidth, displayHeight, fps, rotation, hdr }`), `audio.reconfigured` (`{ sourceId, sampleRate, channels, format }`), `audio.tracks.changed` (`{ sourceId, audioTracks }`, as `AudioTrack`s), `subtitles.changed` (`{ state }`, a `SubtitlesState`, taken into `plugin.subtitles.state` first), `window.changed` (a `WindowState`, taken into `plugin.window.state` first; a resize once it has settled for 300 ms), `layout.changed` (`{ slots }`, each position with its panels, `LayoutPosition`), `audio.devices.changed` (`{ devices, requested, active }`) and `app.started` (`{ version, previous }`). Each is sent once per change; a listener of one does not keep the plugin running, and the player wakes a plugin in standby for it.
10
- - **The copies take a fact first** (1.11.0-rc.2 adds the last two): `subtitles.changed` into `plugin.subtitles.state`, `window.changed` into `plugin.window.state`, `layout.changed` into the panel layout, `audio.tracks.changed` into `plugin.player.state.audioTracks` (when it is the copy's source) and `audio.devices.changed` into `plugin.player.state.audioOutput`, so the copy holds it when the listener runs and a binding that reads it runs again.
10
+ - **The copies take a fact first**: `subtitles.changed` into `plugin.subtitles.state`, `window.changed` into `plugin.window.state`, `layout.changed` into the panel layout, `audio.tracks.changed` into `plugin.player.state.audioTracks` (when it is the copy's source) and `audio.devices.changed` into `plugin.player.state.audioOutput`, so the copy holds it when the listener runs and a binding that reads it runs again.
11
11
  - Removed `Player.subscribe()` and `Player.onChange()`.
12
12
  - **An event reaches a plugin from its first listener.** `source.state`, `playback.backend`, `window.state`, `timeline.changed`, `appearance.changed` and `resolvers.fileTypes` are subscribed while a listener, a watcher (`MainWindow.onChange`, a panel slot's `onChange`, `Subtitles.onChange`, a media handle's `ready` and `onEnd`, a scrub) or a stream holds them; the SDK's own copy and a binding's read never subscribe them on their own, so a bound value or a command state that reads `plugin.player.state` shows the newest snapshot the plugin has. `Media.ready` no longer polls the state every 100 ms.
13
- - **Following the source is not listening** (1.11.0-rc.4): `plugin.video.view()`, a shader channel (`plugin.video.shaders(id)`) and a processing node (`plugin.video.filter`, `plugin.audio.filter`) send their values again when the source changes, so they follow `source.state`, but they no longer count as a listener of it. The player is told the SDK's copy (`mirror`), so a plugin is never classified as "listening to source.state" because of such a handle, nor early through the race between that subscription and its ready; the handle's own resource keeps it running, with its own reason. `Media.ready`, `Media.onEnd` and a scrub still count: they serve the plugin's own wait, callback or gesture.
14
- - **No request after `runtime.stop`**: once the player sent `runtime.stop`, every request of the plugin is refused with `disabled` and not sent, the plugin's own cleanup included (the player's runner refused them already). In `TestHost` the cleanup requests at a plugin's stop (and at `park()` and `upgrade()`) are therefore no longer sent, and the test host revokes what the run held itself, as the player does (1.11.0-rc.3 matches each kind of stop): at every stop its windows, panels, commands, settings pages, resolvers, sequence provider, streams, filter chains, display layer, render options and shaders; its timeline layer, always-on-top and cursor settings stay through `park()` (an idle stop) and go at every other stop (disable, a fault, uninstall, reload, `upgrade()`, quit, or `stop()` without a reason).
13
+ - **Following the source is not listening**: `plugin.video.view()`, a shader channel (`plugin.video.shaders(id)`) and a processing node (`plugin.video.filter`, `plugin.audio.filter`) send their values again when the source changes, so they follow `source.state`, but they do not count as a listener of it: the player is told the SDK's copy (`mirror`), and a plugin is never classified as "listening to source.state" because of such a handle. What the handle holds keeps the plugin running, with its own reason: the display layer from the moment it is made, a filter chain once it has nodes, a shader channel once it has shaders. `Media.ready`, `Media.onEnd` and a scrub count as listeners: they serve the plugin's own wait, callback or gesture. A binding or a command's function field that reads a state never makes the plugin a listener, not even while such a handle keeps the event subscribed; its reason joins what the player is told only while a real listener or stream listens. (The `theme-widgets` example's trace: its view's bind of `plugin.commands.keys` subscribes as the SDK's copy.)
14
+ - **No request after `runtime.stop`**: once the player sent `runtime.stop`, every request of the plugin is refused with `disabled` and not sent, the plugin's own cleanup included (the player's runner refused them already). In `TestHost` the cleanup requests at a plugin's stop (and at `park()` and `upgrade()`) are therefore no longer sent, and the test host revokes what the run held itself, as the player does at each kind of stop: at every stop its windows, panels, commands, settings pages, resolvers, sequence provider, streams, filter chains, display layer, render options and shaders; its timeline layer, always-on-top and cursor settings stay through `park()` (an idle stop) and go at every other stop (disable, a fault, uninstall, reload, `upgrade()`, quit, or `stop()` without a reason).
15
15
  - **`TestHost`** sends the fact events by the player's rules: `audio.tracks.changed` after a source change, `window.changed` and `layout.changed` after a `window.state`, `subtitles.changed` and `audio.devices.changed` after a request or an event changed them, and `video.reconfigured` and `audio.reconfigured` from `host.stats` when a source becomes ready. `app.started` is sent with `host.emit`.
16
16
 
17
17
  **No capability disclosure:**
@@ -28,7 +28,11 @@
28
28
  - **New guide, [Learn what happens in the player without staying up](docs/guides/events-and-triggers.md)**: the four ways to learn the state (a read, an event, a trigger, a stream) and when each fits, with four examples (on top while playing fullscreen; a named sleep timer; acting at position ranges; a window that shows the time left), the patterns for state that has no event, and tests with `keepsRunning`, `park`, `advance` and `upgrade`.
29
29
  - **[Command state](docs/guides/command-state.md) covers the whole `when` language**: a function field is evaluated in the plugin with the plugin's own copy of the state, a condition by the player, also in standby. How a plugin works, Control playback, Troubleshooting (an old playback state in a menu, a plugin that never parks, a trigger declared after an `await`), the tutorial, Filters, Sliders, Subtitles, Design rules, the README and the `@example`s of `Commands.add`, `Command.set`, `Bindable`, `Player.read`, `Player.previous`, `Player.audioDevices`, `View.bind`, `Panels.mount` and `OsdPanel` follow the same rules: commands follow the player with `when`, handlers read the state with `refresh()`, a stream is open only while something shows the state, and a filter is made when it is first needed (a filter follows the source from the moment it is made, which keeps the plugin running).
30
30
  - **Examples**: `adjust-panel` follows the speed with a stream only while its tab is on screen (`layout.changed`) and enables Normal Speed with `when.can("rate")`; `bookmark` streams only while its window is open and keeps its mark in session storage; `menus` checks the speeds with `when.rate` and enables them with `when.can("rate")`; `three-ways` follows the speed only while the bar shows and learns a new source from `source.opening`/`ready`/`ended` in every style; `blur` makes its filter on first use; `panel-menu` keeps its list in session storage. Every example's test checks with `keepsRunning` that nothing keeps it running while idle. `minPlayerVersion`: `adjust-panel` 0.11.0, `menus` 0.10.0. The golden traces of `adjust-panel`, `blur`, `bookmark`, `menus` and `panel-menu` are recorded again (fewer subscriptions and passes; the session storage reads), and `docs-tree.test.ts` looks for style B's new listener line in the tutorial.
31
- - `TestHost.listening`, `listeningWhy` and `keepsRunning` say what they list now: listeners and streams, not bindings.
31
+ - `TestHost.listening`, `listeningWhy` and `keepsRunning` say what they list now: the listeners and streams that keep a plugin running. A binding's or a command field's read is never one; while a listener or stream holds the same event, the read is listed beside it (with "— use plugin.when" where a condition exists), as the player's log shows it.
32
+
33
+ **Product data:**
34
+
35
+ - **`@vestra/icons.slint`** follows the player (main 6182f3d1, #459): the palette button's `search-ai` icon is a magnifier with the AI icon's sparkle, no longer a speech bubble.
32
36
 
33
37
  ## 1.10.1
34
38
 
@@ -138,7 +138,7 @@ export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video
138
138
  * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
139
139
  * Slint with `Icon { name: "store"; }`). The player's tests check that this
140
140
  * list is its icon set. `"sliders"` (three sliders, the player's Adjustments
141
- * and Effects button); `"search-ai"` (a speech bubble with the AI icon's
141
+ * and Effects button); `"search-ai"` (a magnifier with the AI icon's
142
142
  * sparkle, the palette's button while a plugin holds its lead row).
143
143
  *
144
144
  * @example Check in a test that the button's icon exists
package/dist/commands.js CHANGED
@@ -143,7 +143,7 @@ export const MENU_IDS = [
143
143
  * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
144
144
  * Slint with `Icon { name: "store"; }`). The player's tests check that this
145
145
  * list is its icon set. `"sliders"` (three sliders, the player's Adjustments
146
- * and Effects button); `"search-ai"` (a speech bubble with the AI icon's
146
+ * and Effects button); `"search-ai"` (a magnifier with the AI icon's
147
147
  * sparkle, the palette's button while a plugin holds its lead row).
148
148
  *
149
149
  * @example Check in a test that the button's icon exists
Binary file
@@ -172,7 +172,7 @@ export declare class Connection {
172
172
  */
173
173
  hold(event: string, why?: Why, always?: boolean): Disposable;
174
174
  /**
175
- * The SDK's own follower of `event` (SDK 1.11.0-rc.4): a handle that sends
175
+ * The SDK's own follower of `event`: a handle that sends
176
176
  * its values again when the source changes (`plugin.video.view()`, a
177
177
  * shader channel, a processing node). It subscribes a held-only group
178
178
  * while it lives, as {@link Connection.hold} does, but counts as the SDK's
@@ -188,12 +188,15 @@ export declare class Connection {
188
188
  */
189
189
  follow(event: string, why?: Why): Disposable;
190
190
  /**
191
- * Count `event` as listened to while a binding reads its state: the
192
- * binding's reason joins what the player is told while the group is
193
- * subscribed, but it never subscribes a held-only group on its own (a
194
- * bound value that reads `plugin.player.state` shows the newest snapshot
195
- * the plugin has; a stream or an event makes it follow the player).
196
- * Nothing when nothing started the group.
191
+ * A binding (or a command's function field) reads `event`'s state: its
192
+ * reason joins what the player is told while a plugin listener, hold or
193
+ * stream listens to the group, but the read never makes the plugin a
194
+ * listener on its own, whether or not the group is subscribed (by a
195
+ * handle that follows the source, {@link Connection.track}). It never
196
+ * subscribes a held-only group either: a bound value that reads
197
+ * `plugin.player.state` shows the newest snapshot the plugin has; a stream
198
+ * or an event makes it follow the player. Nothing when nothing started
199
+ * the group.
197
200
  */
198
201
  bindingReads(event: string, why: Why): Disposable;
199
202
  /**
@@ -426,7 +426,7 @@ export class Connection {
426
426
  return this.#hold(event, why, always ? "always" : "read");
427
427
  }
428
428
  /**
429
- * The SDK's own follower of `event` (SDK 1.11.0-rc.4): a handle that sends
429
+ * The SDK's own follower of `event`: a handle that sends
430
430
  * its values again when the source changes (`plugin.video.view()`, a
431
431
  * shader channel, a processing node). It subscribes a held-only group
432
432
  * while it lives, as {@link Connection.hold} does, but counts as the SDK's
@@ -472,18 +472,20 @@ export class Connection {
472
472
  };
473
473
  }
474
474
  /**
475
- * Count `event` as listened to while a binding reads its state: the
476
- * binding's reason joins what the player is told while the group is
477
- * subscribed, but it never subscribes a held-only group on its own (a
478
- * bound value that reads `plugin.player.state` shows the newest snapshot
479
- * the plugin has; a stream or an event makes it follow the player).
480
- * Nothing when nothing started the group.
475
+ * A binding (or a command's function field) reads `event`'s state: its
476
+ * reason joins what the player is told while a plugin listener, hold or
477
+ * stream listens to the group, but the read never makes the plugin a
478
+ * listener on its own, whether or not the group is subscribed (by a
479
+ * handle that follows the source, {@link Connection.track}). It never
480
+ * subscribes a held-only group either: a bound value that reads
481
+ * `plugin.player.state` shows the newest snapshot the plugin has; a stream
482
+ * or an event makes it follow the player. Nothing when nothing started
483
+ * the group.
481
484
  */
482
485
  bindingReads(event, why) {
483
486
  const group = this.#events.get(event);
484
487
  if (!group)
485
488
  return { dispose: async () => { } };
486
- group.active++;
487
489
  const token = {};
488
490
  group.whys.set(token, why);
489
491
  this.#tell(event, group);
@@ -493,7 +495,6 @@ export class Connection {
493
495
  if (!reading)
494
496
  return;
495
497
  reading = false;
496
- group.active--;
497
498
  group.whys.delete(token);
498
499
  if (this.#events.get(event) === group)
499
500
  this.#tell(event, group);
@@ -72,7 +72,7 @@ export declare class PlayerService implements StreamSource {
72
72
  * more when the subscription starts, also without `read()`.
73
73
  */
74
74
  /**
75
- * A fact event's fields of the state (1.11.0-rc.2): taken into the copy
75
+ * A fact event's fields of the state: taken into the copy
76
76
  * when `belongs` holds for it, as `accept` takes a state (a precise
77
77
  * pass for the fields that changed); its event sequence is kept, so the
78
78
  * next `source.state` is accepted as before.
@@ -120,14 +120,14 @@ export declare class PlayerService implements StreamSource {
120
120
  /**
121
121
  * `audio.tracks.changed`'s data as the listener gets it (`ScopeImpl.fact`,
122
122
  * SDK 1.11.0): the tracks as {@link PlayerState.audioTracks} lists them.
123
- * The copy takes them first (1.11.0-rc.2), when they are of its source.
123
+ * The copy takes them first, when they are of its source.
124
124
  */
125
125
  export declare function audioTracksChanged(runtime: Runtime, data: unknown): {
126
126
  sourceId: number;
127
127
  audioTracks: AudioTrack[];
128
128
  };
129
129
  /**
130
- * `audio.devices.changed`'s data as the listener gets it (1.11.0-rc.2):
130
+ * `audio.devices.changed`'s data as the listener gets it:
131
131
  * as the player sent it; the copy takes `requested` and `active` into
132
132
  * {@link PlayerState.audioOutput} first.
133
133
  */
@@ -271,7 +271,7 @@ export class PlayerService {
271
271
  * more when the subscription starts, also without `read()`.
272
272
  */
273
273
  /**
274
- * A fact event's fields of the state (1.11.0-rc.2): taken into the copy
274
+ * A fact event's fields of the state: taken into the copy
275
275
  * when `belongs` holds for it, as `accept` takes a state (a precise
276
276
  * pass for the fields that changed); its event sequence is kept, so the
277
277
  * next `source.state` is accepted as before.
@@ -636,7 +636,7 @@ function provideSequence(scope, provider) {
636
636
  /**
637
637
  * `audio.tracks.changed`'s data as the listener gets it (`ScopeImpl.fact`,
638
638
  * SDK 1.11.0): the tracks as {@link PlayerState.audioTracks} lists them.
639
- * The copy takes them first (1.11.0-rc.2), when they are of its source.
639
+ * The copy takes them first, when they are of its source.
640
640
  */
641
641
  export function audioTracksChanged(runtime, data) {
642
642
  const { sourceId, audioTracks } = data;
@@ -646,7 +646,7 @@ export function audioTracksChanged(runtime, data) {
646
646
  return { sourceId, audioTracks: audioTracks.map(audioTrack) };
647
647
  }
648
648
  /**
649
- * `audio.devices.changed`'s data as the listener gets it (1.11.0-rc.2):
649
+ * `audio.devices.changed`'s data as the listener gets it:
650
650
  * as the player sent it; the copy takes `requested` and `active` into
651
651
  * {@link PlayerState.audioOutput} first.
652
652
  */
@@ -601,7 +601,9 @@ export declare class TestHost implements Transport {
601
601
  * Why the plugin listens to each event of {@link TestHost.listening}:
602
602
  * every listener and stream, as the player's log says them (`a listener
603
603
  * added at main.ts:12`, `a stream opened at main.ts:20`), in the order
604
- * they came.
604
+ * they came. A binding's or command field's read of the event's state is
605
+ * listed beside them (with "— use plugin.when" where a condition exists);
606
+ * it is never a reason on its own.
605
607
  *
606
608
  * @since 1.5.40
607
609
  */
@@ -279,7 +279,9 @@ export class TestHost {
279
279
  * Why the plugin listens to each event of {@link TestHost.listening}:
280
280
  * every listener and stream, as the player's log says them (`a listener
281
281
  * added at main.ts:12`, `a stream opened at main.ts:20`), in the order
282
- * they came.
282
+ * they came. A binding's or command field's read of the event's state is
283
+ * listed beside them (with "— use plugin.when" where a condition exists);
284
+ * it is never a reason on its own.
283
285
  *
284
286
  * @since 1.5.40
285
287
  */
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.11.0-rc.4: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
3
+ > @vestra-player/sdk 1.11.0: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
4
4
 
5
5
  ## Read the documentation
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.11.0-rc.4",
3
+ "version": "1.11.0",
4
4
  "description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -55,10 +55,10 @@ export global Icons {
55
55
  // Three sliders with their knobs (the adjust column, `host/adjust`),
56
56
  // the default 14 × 12 box.
57
57
  if name == "sliders" { return "M 1.5 2.5 H 7.6 M 10.4 2.5 H 12.5 M 10.4 2.5 A 1.4 1.4 0 1 1 7.6 2.5 A 1.4 1.4 0 1 1 10.4 2.5 Z M 1.5 6 H 3.1 M 5.9 6 H 12.5 M 5.9 6 A 1.4 1.4 0 1 1 3.1 6 A 1.4 1.4 0 1 1 5.9 6 Z M 1.5 9.5 H 6.6 M 9.4 9.5 H 12.5 M 9.4 9.5 A 1.4 1.4 0 1 1 6.6 9.5 A 1.4 1.4 0 1 1 9.4 9.5 Z"; }
58
- // A speech bubble open at its top right, where the AI icon's sparkle
59
- // breaks out ("ask": the palette's strip cell while a plugin holds its
60
- // first row, `palette.lead`), the default 14 × 12 box.
61
- if name == "search-ai" { return "M 7 3 H 3.25 Q 1.25 3 1.25 5 V 7.75 Q 1.25 9.75 3.25 9.75 V 11.25 L 5.5 9.75 H 8 Q 10 9.75 10 7.75 V 6.75 M 11 0.7 Q 11.29 2.61 13.2 2.9 Q 11.29 3.19 11 5.1 Q 10.71 3.19 8.8 2.9 Q 10.71 2.61 11 0.7 Z"; }
58
+ // A magnifier with the AI icon's four-point sparkle at its top right
59
+ // (the palette's strip cell while a plugin holds its first row,
60
+ // `palette.lead`), the default 14 × 12 box.
61
+ if name == "search-ai" { return "M 8.6 6.4 A 3.5 3.5 0 1 1 1.6 6.4 A 3.5 3.5 0 1 1 8.6 6.4 Z M 7.6 8.9 L 10.2 11.1 M 11.05 0.75 Q 11.336 2.664 13.25 2.95 Q 11.336 3.236 11.05 5.15 Q 10.764 3.236 8.85 2.95 Q 10.764 2.664 11.05 0.75 Z"; }
62
62
  return "";
63
63
  }
64
64
  // Line width.