@vestra-player/sdk 1.7.1 → 1.7.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 (88) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -9
  3. package/bin/vestra-plugin.mjs +4 -4
  4. package/dist/api-requests.d.ts +8 -8
  5. package/dist/api-requests.js +8 -8
  6. package/dist/capability-check.d.ts +15 -15
  7. package/dist/capability-check.js +4 -4
  8. package/dist/capability-rules.d.ts +4 -5
  9. package/dist/capability-rules.js +4 -5
  10. package/dist/commands.d.ts +34 -44
  11. package/dist/commands.js +21 -27
  12. package/dist/docs-tree.json.gz +0 -0
  13. package/dist/docs.d.ts +1 -1
  14. package/dist/docs.js +13 -3
  15. package/dist/i18n-tools.js +1 -1
  16. package/dist/i18n.js +1 -1
  17. package/dist/media.d.ts +7 -7
  18. package/dist/palettes.d.ts +5 -5
  19. package/dist/palettes.js +5 -5
  20. package/dist/plugin/appearance.js +1 -1
  21. package/dist/plugin/bindings.d.ts +2 -3
  22. package/dist/plugin/bindings.js +2 -3
  23. package/dist/plugin/commands.js +10 -11
  24. package/dist/plugin/connection.d.ts +18 -19
  25. package/dist/plugin/connection.js +23 -24
  26. package/dist/plugin/index.d.ts +5 -5
  27. package/dist/plugin/index.js +1 -1
  28. package/dist/plugin/osd.d.ts +1 -1
  29. package/dist/plugin/osd.js +1 -1
  30. package/dist/plugin/passes.d.ts +4 -4
  31. package/dist/plugin/passes.js +4 -4
  32. package/dist/plugin/patch.d.ts +8 -8
  33. package/dist/plugin/patch.js +12 -12
  34. package/dist/plugin/player/events.js +5 -5
  35. package/dist/plugin/resolvers.js +3 -3
  36. package/dist/plugin/scope.d.ts +4 -4
  37. package/dist/plugin/scope.js +4 -4
  38. package/dist/plugin/services.d.ts +2 -3
  39. package/dist/plugin/services.js +2 -3
  40. package/dist/plugin/shaders.js +5 -6
  41. package/dist/plugin/state.js +10 -10
  42. package/dist/plugin/testing/commands.d.ts +4 -5
  43. package/dist/plugin/testing/commands.js +4 -5
  44. package/dist/plugin/testing/i18n.d.ts +1 -1
  45. package/dist/plugin/testing/i18n.js +1 -1
  46. package/dist/plugin/testing/index.d.ts +147 -165
  47. package/dist/plugin/testing/index.js +137 -155
  48. package/dist/plugin/testing/internals.d.ts +2 -2
  49. package/dist/plugin/testing/internals.js +2 -2
  50. package/dist/plugin/timeline.d.ts +1 -1
  51. package/dist/plugin/timeline.js +2 -2
  52. package/dist/plugin/types/base.d.ts +90 -111
  53. package/dist/plugin/types/commands.d.ts +142 -174
  54. package/dist/plugin/types/packages.d.ts +48 -63
  55. package/dist/plugin/types/playback.d.ts +45 -59
  56. package/dist/plugin/types/plugin-wire.d.ts +38 -45
  57. package/dist/plugin/types/processing.d.ts +52 -65
  58. package/dist/plugin/types/services.d.ts +18 -25
  59. package/dist/plugin/types/snapshots.d.ts +34 -46
  60. package/dist/plugin/types/sources.d.ts +14 -16
  61. package/dist/plugin/types/subtitles.d.ts +7 -8
  62. package/dist/plugin/types/ui-content.d.ts +111 -116
  63. package/dist/plugin/types/ui-layout.d.ts +52 -63
  64. package/dist/plugin/types/ui-locale.d.ts +41 -45
  65. package/dist/plugin/types/ui-shell.d.ts +69 -87
  66. package/dist/plugin/values.d.ts +15 -18
  67. package/dist/plugin/values.js +16 -19
  68. package/dist/plugin/view/base.d.ts +2 -2
  69. package/dist/plugin/view/base.js +7 -8
  70. package/dist/plugin/view/layout.d.ts +2 -2
  71. package/dist/plugin/view/panel.js +2 -4
  72. package/dist/plugin/view/writer.d.ts +8 -8
  73. package/dist/plugin/view/writer.js +37 -39
  74. package/dist/plugin/when.d.ts +3 -3
  75. package/dist/plugin/wire-facade.js +6 -7
  76. package/dist/processing.d.ts +26 -30
  77. package/dist/processing.js +4 -4
  78. package/dist/source-resolvers.d.ts +2 -2
  79. package/dist/source.d.ts +1 -2
  80. package/dist/subtitles.d.ts +1 -1
  81. package/dist/ts-plugin.d.ts +5 -5
  82. package/dist/wire.d.ts +63 -70
  83. package/dist/wire.js +21 -25
  84. package/llms.txt +7 -10
  85. package/package.json +1 -1
  86. package/slint/vestra/bar-buttons.slint +6 -8
  87. package/slint/vestra/focus.slint +1 -1
  88. package/slint/vestra/widgets.slint +2 -4
@@ -11,8 +11,7 @@ class PanelHandle extends ViewBase {
11
11
  #locks = { focused: false, dragging: false, popupOpen: false };
12
12
  #interaction;
13
13
  constructor(scope, slot, file, options) {
14
- // One panel per slot (SDK 1.6.15, player 0.7.6; a player before 0.7.6
15
- // refuses a second panel with `conflict`).
14
+ // One panel per slot.
16
15
  if (scope.runtime.views.has(`panel:${slot}`))
17
16
  throw new Error(`this plugin already has a panel in the ${slot}`);
18
17
  super(scope);
@@ -102,8 +101,7 @@ class PanelHandle extends ViewBase {
102
101
  const state = this.state;
103
102
  // A switch, the same in every mode (user ruling 2026-11-08): off when
104
103
  // on and current, else on at this tab. `reveal: false`: in fullscreen
105
- // nothing pops out, the right edge reveals it (player 0.7.6; older
106
- // players ignore it and pop it out).
104
+ // nothing pops out, the right edge reveals it.
107
105
  if (state?.preferred && state.active)
108
106
  await layoutOf(this.scope.runtime).set(this.#slot, { visible: false });
109
107
  else
@@ -44,14 +44,14 @@ export declare class ViewWriter {
44
44
  */
45
45
  track(): void;
46
46
  /**
47
- * Initial properties in wire form. A released image is left out (the
48
- * property keeps its default) and reported, like a failed write. With a
49
- * player that takes row patches, the arrays of one request carry at most
50
- * {@link CHUNK_BYTES} of rows together (SDK 1.5.46): an array over that
51
- * goes with its first rows, and the first flush sends the rest as patches.
52
- * An array over the value limits is refused here, as the player would
53
- * refuse it whole: left out and reported (a panel, a settings page), or,
54
- * with `refuse` (a window's `show`), thrown.
47
+ * Initial properties in wire form. A released image is left out (the property
48
+ * keeps its default) and reported, like a failed write. With a player that
49
+ * takes row patches, the arrays of one request carry at most
50
+ * {@link CHUNK_BYTES} of rows together: an array over that goes with its
51
+ * first rows, and the first flush sends the rest as patches. An array over
52
+ * the value limits is refused here, as the player would refuse it whole: left
53
+ * out and reported (a panel, a settings page), or, with `refuse` (a window's
54
+ * `show`), thrown.
55
55
  */
56
56
  wired(values: Record<string, PropValue>, refuse?: boolean): Record<string, Json>;
57
57
  /**
@@ -8,26 +8,25 @@
8
8
  * bindings: the binder (`binder.ts`, L2) puts values in, the view
9
9
  * (`base.ts`) says where a write goes.
10
10
  *
11
- * Two modes (SDK 1.7.0, refactor Step 2). Until the view's first `bind()`
12
- * (`track()`), the writer serves `set()` alone: each value is sent whole
13
- * (limits checked, large arrays in parts with `more`, one write in
14
- * flight per view), only the properties `set()` named are looked at, and
15
- * no row-patch base is kept, so nothing is diffed. Once tracked it is the
16
- * binder's: every value is compared with what was sent and arrays become
17
- * row patches where one applies; a `set()` then takes the same path, so
18
- * mixed use stays consistent. Patch planning stays here, used only in the
19
- * tracked mode: it needs what was sent and the player's base, which are
20
- * this writer's, and moving it above would split one property's write
21
- * state across two layers.
11
+ * Two modes (refactor Step 2). Until the view's first `bind()` (`track()`), the
12
+ * writer serves `set()` alone: each value is sent whole (limits checked, large
13
+ * arrays in parts with `more`, one write in flight per view), only the
14
+ * properties `set()` named are looked at, and no row-patch base is kept, so
15
+ * nothing is diffed. Once tracked it is the binder's: every value is compared
16
+ * with what was sent and arrays become row patches where one applies; a `set()`
17
+ * then takes the same path, so mixed use stays consistent. Patch planning stays
18
+ * here, used only in the tracked mode: it needs what was sent and the player's
19
+ * base, which are this writer's, and moving it above would split one property's
20
+ * write state across two layers.
22
21
  *
23
- * A third track (SDK 1.7.0, refactor Step 3): properties written directly
24
- * through `plugin.wire.view(v)` (`direct`, `directRows`). Such a property
25
- * is the plugin's alone: its `PropertyWrite`s and `RowOp`s go out as
26
- * given, with only one write in flight per property, a `seq` when the
27
- * player takes patches, and large writes in parts; nothing is encoded,
28
- * compared or checked against the limits. One track per property: a
29
- * property written directly cannot be `set()` or bound, and the other
30
- * way round (`invalid`), so `#sent` and `#bases` never go stale.
22
+ * A third track (refactor Step 3): properties written directly through
23
+ * `plugin.wire.view(v)` (`direct`, `directRows`). Such a property is the
24
+ * plugin's alone: its `PropertyWrite`s and `RowOp`s go out as given, with only
25
+ * one write in flight per property, a `seq` when the player takes patches, and
26
+ * large writes in parts; nothing is encoded, compared or checked against the
27
+ * limits. One track per property: a property written directly cannot be `set()`
28
+ * or bound, and the other way round (`invalid`), so `#sent` and `#bases` never
29
+ * go stale.
31
30
  */
32
31
  import { HostError } from "../../wire.js";
33
32
  import { MarkdownHandle } from "../markdown.js";
@@ -335,11 +334,11 @@ export class ViewWriter {
335
334
  */
336
335
  #cut = new Map();
337
336
  /**
338
- * Not bound: initial arrays the view shows the first rows of, by key,
339
- * whose next write inserts only the rest (SDK 1.7.0).
337
+ * Not bound: initial arrays the view shows the first rows of, by key, whose
338
+ * next write inserts only the rest.
340
339
  */
341
340
  #rest = new Map();
342
- /** Properties written directly (`plugin.wire.view(v)`, SDK 1.7.0). */
341
+ /** Properties written directly (`plugin.wire.view(v)`). */
343
342
  #direct = new Map();
344
343
  /** Direct properties a binding produced: reported once each. */
345
344
  #refused = new Set();
@@ -365,14 +364,14 @@ export class ViewWriter {
365
364
  return this.#target.patches();
366
365
  }
367
366
  /**
368
- * Initial properties in wire form. A released image is left out (the
369
- * property keeps its default) and reported, like a failed write. With a
370
- * player that takes row patches, the arrays of one request carry at most
371
- * {@link CHUNK_BYTES} of rows together (SDK 1.5.46): an array over that
372
- * goes with its first rows, and the first flush sends the rest as patches.
373
- * An array over the value limits is refused here, as the player would
374
- * refuse it whole: left out and reported (a panel, a settings page), or,
375
- * with `refuse` (a window's `show`), thrown.
367
+ * Initial properties in wire form. A released image is left out (the property
368
+ * keeps its default) and reported, like a failed write. With a player that
369
+ * takes row patches, the arrays of one request carry at most
370
+ * {@link CHUNK_BYTES} of rows together: an array over that goes with its
371
+ * first rows, and the first flush sends the rest as patches. An array over
372
+ * the value limits is refused here, as the player would refuse it whole: left
373
+ * out and reported (a panel, a settings page), or, with `refuse` (a window's
374
+ * `show`), thrown.
376
375
  */
377
376
  wired(values, refuse = false) {
378
377
  const out = {};
@@ -697,7 +696,7 @@ export class ViewWriter {
697
696
  if (Array.isArray(value) && this.#patches) {
698
697
  // Row by row: the same work as one `JSON.stringify`, and the rows to
699
698
  // diff against those last sent. Rows that cannot change (deep-frozen
700
- // objects bound again, SDK 1.5.47) are taken from `settledRows`.
699
+ // objects bound again) are taken from `settledRows`.
701
700
  const encoded = encodeRows(value);
702
701
  const { enc } = encoded;
703
702
  const signature = () => `[${enc.join(",")}]`;
@@ -739,13 +738,12 @@ export class ViewWriter {
739
738
  };
740
739
  }
741
740
  /**
742
- * Write one property: a row patch when the player takes them and one
743
- * applies (else the whole value); a `stale` patch is followed by the whole
744
- * value at once. The base is forgotten on any failure, so the next write
745
- * of the property is whole. A write larger than one request
746
- * ({@link CHUNK_BYTES} of rows, SDK 1.5.46) is sent in parts: a whole
747
- * array as its first rows and `insert` patches of the rest, a patch as
748
- * several, each applying on the one before.
741
+ * Write one property: a row patch when the player takes them and one applies
742
+ * (else the whole value); a `stale` patch is followed by the whole value at
743
+ * once. The base is forgotten on any failure, so the next write of the
744
+ * property is whole. A write larger than one request ({@link CHUNK_BYTES} of
745
+ * rows) is sent in parts: a whole array as its first rows and `insert`
746
+ * patches of the rest, a patch as several, each applying on the one before.
749
747
  */
750
748
  async #send(pending) {
751
749
  const { key, value } = pending;
@@ -859,7 +857,7 @@ export class ViewWriter {
859
857
  throw rowTooLarge(key, largest);
860
858
  // Every part but the last carries `more`: the player holds them
861
859
  // and writes the whole value at the last, so a list it shows is
862
- // written once (player 0.6.0).
860
+ // written once.
863
861
  await this.#target.write(key, {
864
862
  value: wireValue(rows.slice(0, count)),
865
863
  seq,
@@ -1,7 +1,7 @@
1
1
  /**
2
- * `plugin.when`: conditions on the player's own state that the player
3
- * evaluates for a command's `enabled` and `checked` (player 0.5.21). The
4
- * wire form is `commands.register` / `commands.update` `when`.
2
+ * `plugin.when`: conditions on the player's own state that the player evaluates
3
+ * for a command's `enabled` and `checked`. The wire form is `commands.register`
4
+ * / `commands.update` `when`.
5
5
  */
6
6
  import type { Condition, LanguagePreference, PlayerState, ThemeId, When } from "./types.ts";
7
7
  /** A condition in the wire form: an object of exactly one key. */
@@ -1,11 +1,10 @@
1
1
  /**
2
- * `plugin.wire` (SDK 1.7.0; doc/specs/sdk-refactor.md §3.3 and §4 Step 3
3
- * in the player repository): the protocol (L0) and the primitives (L1)
4
- * behind one experimental member, for the plugin's own direct messages.
5
- * Not to be confused with `src/wire.ts` (later `src/wire/`), the L0 code
6
- * itself: this file hands out access to it, and is the only file under
7
- * `src/plugin/` that sends a request by a method name it was given
8
- * (`scripts/check-layers.mjs`, rule 7).
2
+ * `plugin.wire` (doc/specs/sdk-refactor.md §3.3 and §4 Step 3 in the player
3
+ * repository): the protocol (L0) and the primitives (L1) behind one
4
+ * experimental member, for the plugin's own direct messages. Not to be confused
5
+ * with `src/wire.ts` (later `src/wire/`), the L0 code itself: this file hands
6
+ * out access to it, and is the only file under `src/plugin/` that sends a
7
+ * request by a method name it was given (`scripts/check-layers.mjs`, rule 7).
9
8
  *
10
9
  * - `request`: `Connection.request`, the transport as is; the player
11
10
  * checks capabilities. The subscriptions are guarded, refused with
@@ -112,18 +112,16 @@ export type VideoNode =
112
112
  * Deinterlacing. `interlaced` and `all` are FFmpeg BWDIF in the chain;
113
113
  * `field` doubles the frame rate.
114
114
  *
115
- * `when: "auto"` (player 0.5.4) is the player's own deinterlacer instead:
116
- * decided per frame from the decoder's interlaced flag, with the decoder's
117
- * hardware deinterlacer where frames stay on the GPU; progressive frames
118
- * pass untouched. It needs no frames in memory, so a chain with only this
119
- * node keeps zero-copy hardware decoding (any other node still needs a
120
- * copy back to memory). It always outputs one frame per field, so it
121
- * takes `output: "field"` only (`"frame"` fails with `invalid`). It runs
122
- * before every plugin's chain wherever it is written, and is shared: on
123
- * while any plugin's chain has one. A chain with it has no other
124
- * `deinterlace` node. Snapshots and exports deinterlace the same frames
125
- * with BWDIF at field rate. Players before 0.5.4 refuse `auto` with
126
- * `invalid`.
115
+ * `when: "auto"` is the player's own deinterlacer instead: decided per frame
116
+ * from the decoder's interlaced flag, with the decoder's hardware
117
+ * deinterlacer where frames stay on the GPU; progressive frames pass
118
+ * untouched. It needs no frames in memory, so a chain with only this node
119
+ * keeps zero-copy hardware decoding (any other node still needs a copy back
120
+ * to memory). It always outputs one frame per field, so it takes
121
+ * `output: "field"` only (`"frame"` fails with `invalid`). It runs before
122
+ * every plugin's chain wherever it is written, and is shared: on while any
123
+ * plugin's chain has one. A chain with it has no other `deinterlace` node.
124
+ * Snapshots and exports deinterlace the same frames with BWDIF at field rate.
127
125
  */
128
126
  | {
129
127
  /** The node type. */
@@ -163,13 +161,12 @@ export type VideoNode =
163
161
  fps: number;
164
162
  }
165
163
  /**
166
- * A convolution matrix of your own per plane (FFmpeg `convolution`, SDK
167
- * 1.5.39, player 0.5.20): sharpen, blur, emboss or detect edges with a
168
- * 3×3, 5×5 or 7×7 kernel, or a row or column kernel. `planes[i]` is
169
- * plane `i` of the decoded picture: for the usual YUV video 0 is luma
170
- * (brightness), 1 and 2 are the colour planes, 3 is alpha. A missing
171
- * entry or `null` leaves that plane as it is; at least one entry has a
172
- * matrix. Players before 0.5.20 refuse the kind with `invalid`.
164
+ * A convolution matrix of your own per plane (FFmpeg `convolution`): sharpen,
165
+ * blur, emboss or detect edges with a 3×3, 5×5 or 7×7 kernel, or a row or
166
+ * column kernel. `planes[i]` is plane `i` of the decoded picture: for the
167
+ * usual YUV video 0 is luma (brightness), 1 and 2 are the colour planes, 3 is
168
+ * alpha. A missing entry or `null` leaves that plane as it is; at least one
169
+ * entry has a matrix.
173
170
  */
174
171
  | {
175
172
  /** The node type. */
@@ -178,13 +175,12 @@ export type VideoNode =
178
175
  planes: (ConvolutionPlane | null)[];
179
176
  }
180
177
  /**
181
- * Recolour the picture with a 3D look-up table (FFmpeg `lut3d`, SDK
182
- * 1.5.39, player 0.5.20): a `.cube` file the plugin ships in its package
183
- * or wrote to its {@link Plugin.dataDirectory}. The player reads the file
184
- * when the chain is set (and again for each new source, snapshot or
185
- * export), so it must stay there while the chain uses it. The table is
186
- * applied to RGB; the player converts the picture to RGB and back.
187
- * Players before 0.5.20 refuse the kind with `invalid`.
178
+ * Recolour the picture with a 3D look-up table (FFmpeg `lut3d`): a `.cube`
179
+ * file the plugin ships in its package or wrote to its
180
+ * {@link Plugin.dataDirectory}. The player reads the file when the chain is
181
+ * set (and again for each new source, snapshot or export), so it must stay
182
+ * there while the chain uses it. The table is applied to RGB; the player
183
+ * converts the picture to RGB and back.
188
184
  */
189
185
  | {
190
186
  /** The node type. */
@@ -258,10 +254,10 @@ export type ConvolutionPlane = {
258
254
  bias: number;
259
255
  };
260
256
  /**
261
- * The player's bounds for the video primitives of SDK 1.5.39 (player
262
- * 0.5.20): `convolution` and `lut3d` {@link VideoNode}s and the shader
263
- * channel (`plugin.video.shaders()`). Values beyond them fail with
264
- * `invalid`; more shaders than `shaders` fail with `limit`.
257
+ * The player's bounds for the video primitives: `convolution` and `lut3d`
258
+ * {@link VideoNode}s and the shader channel (`plugin.video.shaders()`). Values
259
+ * beyond them fail with `invalid`; more shaders than `shaders` fail with
260
+ * `limit`.
265
261
  *
266
262
  * @example Refuse a shader list the player would not take
267
263
  * The plugin checks a shader list against the player's limit before it
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import { isAbsolute } from "node:path";
6
6
  /**
7
- * The player's bounds for the video primitives of SDK 1.5.39 (player
8
- * 0.5.20): `convolution` and `lut3d` {@link VideoNode}s and the shader
9
- * channel (`plugin.video.shaders()`). Values beyond them fail with
10
- * `invalid`; more shaders than `shaders` fail with `limit`.
7
+ * The player's bounds for the video primitives: `convolution` and `lut3d`
8
+ * {@link VideoNode}s and the shader channel (`plugin.video.shaders()`). Values
9
+ * beyond them fail with `invalid`; more shaders than `shaders` fail with
10
+ * `limit`.
11
11
  *
12
12
  * @example Refuse a shader list the player would not take
13
13
  * The plugin checks a shader list against the player's limit before it
@@ -63,8 +63,8 @@ export type ResolvedMedia = {
63
63
  audio?: ResolvedResource;
64
64
  };
65
65
  /**
66
- * A resolver declaration on the wire: a web resolver (`schemes` + `hosts`)
67
- * or, from player 0.4.1, a file resolver (`extensions`), never both.
66
+ * A resolver declaration on the wire: a web resolver (`schemes` + `hosts`) or,
67
+ * a file resolver (`extensions`), never both.
68
68
  */
69
69
  export type SourceResolverDeclaration = {
70
70
  id: string;
package/dist/source.d.ts CHANGED
@@ -32,8 +32,7 @@ export type SourceIntent = {
32
32
  seconds: number;
33
33
  /**
34
34
  * Land on the last keyframe at or before `seconds` instead of the
35
- * exact time (player 0.5.3). Sent only when true: older players
36
- * ignore the field and seek exactly.
35
+ * exact time.
37
36
  */
38
37
  keyframes?: boolean;
39
38
  } | {
@@ -187,7 +187,7 @@ export declare function subtitleClient(transport: Transport): {
187
187
  expected: SubtitleStamp;
188
188
  inputOrigin?: SubtitleTrack;
189
189
  format?: "srt" | "ass";
190
- /** Source text is data; a text value is shown translated (player 0.4.3). */
190
+ /** Source text is data; a text value is shown translated. */
191
191
  title?: string | TextJson;
192
192
  select?: "primary" | "secondary" | "none";
193
193
  }) => Promise<SubtitleState>;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * The TypeScript language-service plugin `@vestra-player/sdk/ts-plugin`: the
3
3
  * capability checker of `vestra-plugin check` in the editor. A use of an API
4
- * member whose capability `manifest.json` does not declare is an error at
5
- * the member, with the quick fix "Add '<capability>' to manifest.json".
6
- * A call whose capability depends on a name the checker cannot read
7
- * (`plugin.wire.request(method)` with a computed method, SDK 1.7.0) is a
8
- * warning (`CAPABILITY_UNCHECKED`).
4
+ * member whose capability `manifest.json` does not declare is an error at the
5
+ * member, with the quick fix "Add '<capability>' to manifest.json". A call
6
+ * whose capability depends on a name the checker cannot read
7
+ * (`plugin.wire.request(method)` with a computed method) is a warning
8
+ * (`CAPABILITY_UNCHECKED`).
9
9
  *
10
10
  * A project enables it in its tsconfig.json:
11
11
  *