@vestra-player/sdk 1.7.1 → 1.7.3

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 (93) hide show
  1. package/CHANGELOG.md +20 -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 +141 -155
  48. package/dist/plugin/testing/internals.d.ts +9 -2
  49. package/dist/plugin/testing/internals.js +9 -2
  50. package/dist/plugin/testing/layout.d.ts +46 -3
  51. package/dist/plugin/testing/layout.js +102 -7
  52. package/dist/plugin/testing/services.js +10 -2
  53. package/dist/plugin/testing/slint-types.d.ts +75 -0
  54. package/dist/plugin/testing/slint-types.js +974 -0
  55. package/dist/plugin/timeline.d.ts +1 -1
  56. package/dist/plugin/timeline.js +2 -2
  57. package/dist/plugin/types/base.d.ts +90 -111
  58. package/dist/plugin/types/commands.d.ts +142 -174
  59. package/dist/plugin/types/packages.d.ts +48 -63
  60. package/dist/plugin/types/playback.d.ts +45 -59
  61. package/dist/plugin/types/plugin-wire.d.ts +38 -45
  62. package/dist/plugin/types/processing.d.ts +52 -65
  63. package/dist/plugin/types/services.d.ts +18 -25
  64. package/dist/plugin/types/snapshots.d.ts +34 -46
  65. package/dist/plugin/types/sources.d.ts +14 -16
  66. package/dist/plugin/types/subtitles.d.ts +7 -8
  67. package/dist/plugin/types/ui-content.d.ts +111 -116
  68. package/dist/plugin/types/ui-layout.d.ts +52 -63
  69. package/dist/plugin/types/ui-locale.d.ts +41 -45
  70. package/dist/plugin/types/ui-shell.d.ts +69 -87
  71. package/dist/plugin/values.d.ts +15 -18
  72. package/dist/plugin/values.js +16 -19
  73. package/dist/plugin/view/base.d.ts +2 -2
  74. package/dist/plugin/view/base.js +7 -8
  75. package/dist/plugin/view/layout.d.ts +2 -2
  76. package/dist/plugin/view/panel.js +2 -4
  77. package/dist/plugin/view/writer.d.ts +8 -8
  78. package/dist/plugin/view/writer.js +37 -39
  79. package/dist/plugin/when.d.ts +3 -3
  80. package/dist/plugin/wire-facade.js +6 -7
  81. package/dist/processing.d.ts +26 -30
  82. package/dist/processing.js +4 -4
  83. package/dist/source-resolvers.d.ts +2 -2
  84. package/dist/source.d.ts +1 -2
  85. package/dist/subtitles.d.ts +1 -1
  86. package/dist/ts-plugin.d.ts +5 -5
  87. package/dist/wire.d.ts +63 -70
  88. package/dist/wire.js +21 -25
  89. package/llms.txt +7 -10
  90. package/package.json +1 -1
  91. package/slint/vestra/bar-buttons.slint +6 -8
  92. package/slint/vestra/focus.slint +1 -1
  93. package/slint/vestra/widgets.slint +2 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.3
4
+
5
+ **Who must change: plugins whose tests wrote a value of the wrong type — their test now fails the way the player already failed.** No API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
6
+
7
+ - **The test host checks property values against the plugin's Slint files**, as the player does (its conversion, then `ui_values::set`): `ui.open`, `ui.set`, `ui.mount`, `ui.setMount`, `settings.register` and `settings.set` refuse a value the player refuses, with the player's code and message. Twice a plugin passed every check and test and then failed in the player when its window opened: `high-tint: wrong type: high-tint is a string where the declaration has a brush` (a string for a `brush`), and `segments: wrong type: segments is an array that does not match the declared an array type` (rows whose struct has a field the declared struct does not). The rules are Slint's: a struct may leave fields out but not add any; any number fits `int`, `float`, `length` and the other number types, a numeric string does not; an image only as a `plugin.ui.image` reference; no value fits `brush`, `color` or an enum; inside an array without Markdown documents `null` is an empty image, so it fits where an image is declared and nowhere else, and outside one it fits nothing; a Markdown document's rows (`MarkdownBlock` structs) must fit the declared row type, an empty document has none. A property the exported component or global does not declare (or declares `private`) is `no such property`, an `out` property is `not writable (an out property)`, except that a write which only repeats the value an `out` property holds does nothing, as the player compares before it writes (not when a window opens). The words name the first field that differs as far as the property's current value shows the declared type, as the player's do. Before any of that, the player's conversion refuses a struct field name not in Slint's canonical spelling (`outer: UI object field "a_b" is not in Slint canonical spelling`, code `host`), at any depth and whatever the declaration says.
8
+ - Codes and words follow the player per request: `ui.open` fails with `host` (`name: wrong type: …`, `name: no such property`); `ui.set` with `ui` and `ui.setMount` with `host`, an undeclared property as just `no such property` (the player reads the property first); a row patch whose result the view refuses is refused the same way. A panel's or settings page's initial value with a field name not in Slint's spelling is left out and reported with `ui.error` (`onError`, code `host`), as the player refuses it when the request comes; the panel mounts and the page registers. A panel's initial value of a type the panel refuses is reported with `ui.error` (code `ui`, `name: name: wrong type: …`); the panel mounts and shows its default, and that value stays stored, as in the player. Stricter than the player for settings pages: their values are checked when written, where the player checks them when the Options window shows the page and then fails to show it.
9
+ - **How**: a small parser reads the `struct`, `enum`, `import` and `export` declarations and the `property` declarations of the exported component (a window) or global (a panel, a settings page), wherever they stand in its body (after `states`, `transitions` or `@children` too), following imports, `export *`, `@vestra/…` (the SDK's own `slint/vestra`), nested and anonymous structs. A view's types are kept while none of the files they were read from changed. What it cannot read is declared loosely, so it never refuses what the player takes: a type name it cannot resolve (from `std-widgets.slint`, or a name declared nowhere) takes any value, as does a struct where it holds itself (Slint refuses such a file; the test host resolves each struct once and stops there); a component that inherits a component of the plugin's own or one it imports takes undeclared names; a file it cannot read, or a window file without exactly one exported component, is not checked. A host without a package directory (no `startPlugin`) checks the field names only.
10
+ - The SDK's own test fixtures now declare the properties their tests write (`test/slint-types.test.ts` is new: a string for a brush, a wrong struct field in an array, numbers, images, `null`, nested, imported, self-holding and mutually exported structs, declarations after `states` and `@children`, a changed imported file, Markdown rows, field name spelling in writes and initial values, a deep struct type used in many places, unknown and `out` properties, a refused window patch, panels and settings pages, and a refused 20,000-row write that fails once, promptly, the panel keeping its last good value). The machinery tests whose rows no Slint struct would hold (holes, documents, mixed shapes) declare a row type the test host does not resolve, which takes any rows. The examples pass unchanged, and none of the player's built-in plugins writes a value its Slint refuses.
11
+ - A note for test authors: `assert.deepEqual` of a large array that differs builds a diff that can take gigabytes and minutes; compare the length or use `util.isDeepStrictEqual` in an `assert.ok` for lists of thousands of rows.
12
+
13
+ ## 1.7.2
14
+
15
+ **Who must change: nobody.** A documentation release: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged. The documentation goes from seven groups to four, and the remarks about players that were never released are gone.
16
+
17
+ - **Four groups**: **Tutorial** (one page: what a plugin is, the three ways to write one with `examples/three-ways`, where things live, running, testing and publishing), **Guides** (one task per page: the former how-to guides, plus Open a tool window and remember its state, Add settings and translations, Process video with a shader or a filter, and Design rules, which folds in the former guidelines), **Reference** and **Examples**. The Explanation, Upgrading and Guidelines groups and the five tutorials are gone; their content is in the Tutorial, the Guides or the Reference, or was dropped. `docs/how-to/` is now `docs/guides/`, with the same file names.
18
+ - **Old addresses keep working**: every removed or renamed page (Explanation, Concepts, How-to guides, Tutorials, Upgrading, Guidelines, each explanation, tutorial, guideline and upgrading page, Translate a plugin) redirects to the closest new page on the site, and its old title stays a name of that page in the documentation tree (`vestra-plugin docs /Guides/Concepts` opens the Tutorial). Paths in the tree: `/Guides/Tutorial`, `/Guides/Guides/<page>`, `/Guides/Reference/<page>`, `/Guides/Examples/<page>`.
19
+ - **No version history in the documentation**: sentences about older players, earlier SDKs and what changed in which release are removed from the pages and from the doc comments (`@since` and `@player` tags stay); `minPlayerVersion` is described in one sentence ("set it to the player you tested with"). The CHANGELOG keeps the history.
20
+ - **Reference trimmed**: the hand-written text of the Reference pages is about a third shorter; the Manifest page's "Player versions" table and its generator are gone, as are the "Introduced in" columns of Events and Messages (they held only "—") and the release-notes generator of the Upgrading group. Platforms lists current facts only.
21
+ - **Checks** (`npm run docs:check`): page shapes `tutorial`, `guide` (`**Goal:**`, `## Steps`, an optional `## Complete example`, `## See also`), `troubleshooting`, `reference` and `example`; line limits tutorial 400, guide 220. The rules are in `docs/maintaining.md`, "Documentation structure".
22
+
3
23
  ## 1.7.1
4
24
 
5
25
  **Who must change: nobody.** Tables follow the playlist's trimmed list keys: a data refresh of `BUILTIN_COMMANDS`; no API change, `apiVersion` stays `vestra/1`. A plugin whose tests compare a key against the table sees the player's current one.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  </p>
11
11
  <p align="center">
12
12
  <a href="https://vestrasys.github.io/vestra-player-sdk/">Documentation</a> ·
13
- <a href="https://vestrasys.github.io/vestra-player-sdk/documents/Getting_started.html">Getting started</a> ·
13
+ <a href="https://vestrasys.github.io/vestra-player-sdk/documents/Tutorial.html">Tutorial</a> ·
14
14
  <a href="https://github.com/vestrasys/vestra-player-sdk/tree/main/examples">Examples</a> ·
15
15
  <a href="https://github.com/vestrasys/vestra-player-sdk/blob/main/CHANGELOG.md">Changelog</a> ·
16
16
  <a href="https://vestrasys.github.io/vestra-player-sdk/llms.txt">llms.txt</a>
@@ -57,7 +57,7 @@ export default async function activate(plugin: Plugin) {
57
57
  }
58
58
  ```
59
59
 
60
- Run `npx vestra-plugin pack` to check and package it, or start the player with `--plugin <folder>` to try it right away. This is [`examples/hello`](https://github.com/vestrasys/vestra-player-sdk/tree/main/examples/hello); the [Tutorials](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorials.html) build a plugin in four lessons: [Getting started](https://vestrasys.github.io/vestra-player-sdk/documents/Getting_started.html) (a menu item and an on-screen message), then a window, settings and translations, and tests, packing and publishing.
60
+ Run `npx vestra-plugin pack` to check and package it, or start the player with `--plugin <folder>` to try it right away. This is [`examples/hello`](https://github.com/vestrasys/vestra-player-sdk/tree/main/examples/hello); the [Tutorial](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorial.html) explains what a plugin is, shows the three ways to write one, and runs, tests and publishes it.
61
61
 
62
62
  ## Examples
63
63
 
@@ -79,18 +79,15 @@ Complete, tested plugins in [`examples/`](https://github.com/vestrasys/vestra-pl
79
79
 
80
80
  The [documentation site](https://vestrasys.github.io/vestra-player-sdk/) is the one place for everything a plugin author needs:
81
81
 
82
- - **[Tutorials](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorials.html)**: four lessons that build one plugin, starting with [Getting started](https://vestrasys.github.io/vestra-player-sdk/documents/Getting_started.html): a menu item, a window, settings and translations, tests and the store; then a lesson on writing your own blur kernel (a GPU shader and a convolution node).
83
- - **[How-to guides](https://vestrasys.github.io/vestra-player-sdk/documents/How-to_guides.html)**: one task each (goal, steps, complete example): playback, storage, subtitles, sliders, window state, the GPU switch, menu state that needs no running plugin (`plugin.when`), translating, testing, publishing; and troubleshooting.
84
- - **[Reference](https://vestrasys.github.io/vestra-player-sdk/documents/Reference.html)**: capabilities, manifest fields, limits, menus and bindings, platforms, theme, error codes, translations, the test host, and the [command line](https://vestrasys.github.io/vestra-player-sdk/documents/Command_line.html) (`vestra-plugin check`, `test`, `build`, `pack`, `i18n extract`, `i18n check`).
85
- - **[Explanation](https://vestrasys.github.io/vestra-player-sdk/documents/Explanation.html)**: how a plugin runs, commands and key bindings, playback, video and audio processing, the interface, GPU and software rendering, the player's Rust core and how it runs and talks to plugins.
86
- - **[Guidelines](https://vestrasys.github.io/vestra-player-sdk/documents/Guidelines.html)**: rules for every plugin, the interface and the menus.
82
+ - **[Tutorial](https://vestrasys.github.io/vestra-player-sdk/documents/Tutorial.html)**: one page: what a plugin is (a process that talks to the player), the three ways to write one with an example each, where things live, and running, testing and publishing.
83
+ - **[Guides](https://vestrasys.github.io/vestra-player-sdk/documents/Guides.html)**: one task each (goal, steps, often a complete example): windows, settings and translations, playback, storage, window state, sliders, subtitles, video filters, the GPU switch, menu state that needs no running plugin (`plugin.when`), testing, publishing, your own store, documentation for coding agents; the design rules every plugin follows; and troubleshooting.
84
+ - **[Reference](https://vestrasys.github.io/vestra-player-sdk/documents/Reference.html)**: capabilities, manifest fields, limits, menus and bindings, platforms, theme, error codes, events, messages, translations, the test host, and the [command line](https://vestrasys.github.io/vestra-player-sdk/documents/Command_line.html) (`vestra-plugin check`, `test`, `build`, `pack`, `i18n extract`, `i18n check`).
87
85
  - **[Examples](https://vestrasys.github.io/vestra-player-sdk/documents/Examples.html)**: the walkthroughs above.
88
- - **[Upgrading](https://vestrasys.github.io/vestra-player-sdk/documents/Upgrading.html)**: what to change when a release deprecates or removes something, with the migration checklists and every release's "who must change".
89
86
  - **[API](https://vestrasys.github.io/vestra-player-sdk/modules/_vestra-player_sdk.html)**: every type and member of `@vestra-player/sdk` and `@vestra-player/sdk/testing`.
90
87
 
91
88
  ## Compatibility
92
89
 
93
- Every 1.x release implements the plugin API `vestra/1`: minor releases only add backwards-compatible API, and a breaking change gets a new `apiVersion` and a new major version. Plugins run on the Node.js 26 that the player ships. API added after SDK 1.0 may need a newer player; [Player versions](https://vestrasys.github.io/vestra-player-sdk/documents/Manifest.html#player-versions) lists which API needs which player, for the manifest's `minPlayerVersion`. `@vestra-player/sdk/runtime` is for the player only and not covered by semver.
90
+ Every 1.x release implements the plugin API `vestra/1`: minor releases only add backwards-compatible API, and a breaking change gets a new `apiVersion` and a new major version. Plugins run on the Node.js 26 that the player ships. Set the manifest's `minPlayerVersion` to the player you tested with. `@vestra-player/sdk/runtime` is for the player only and not covered by semver.
94
91
 
95
92
  ## Contributing · License
96
93
 
@@ -28,7 +28,7 @@
28
28
  * one member's whole documentation; --search <query> lists
29
29
  * matching paths; at most 8 KB per answer, --page N for the rest
30
30
  *
31
- * Translations (docs/how-to/i18n.md). English is the source text; each
31
+ * Translations (docs/guides/i18n.md). English is the source text; each
32
32
  * language is a gettext file locales/<lang>.po:
33
33
  *
34
34
  * i18n extract find the texts to translate (@tr in .slint files, the
@@ -452,9 +452,9 @@ function slintCode(text) {
452
452
  /**
453
453
  * A `for` over an array the plugin binds (an `in` or `in-out` property of
454
454
  * array type of a component or global in the same file), outside a
455
- * `ListView`, in the plugin's .slint files: a reminder, not a failure
456
- * (SDK 1.5.46). Such a `for` builds every row of the array up front; since
457
- * player 0.6.0 a plugin may bind a whole long list, which belongs in a
455
+ * `ListView`, in the plugin's .slint files: a reminder, not a failure.
456
+ * Such a `for` builds every row of the array up front; a plugin may bind a
457
+ * whole long list, which belongs in a
458
458
  * `ListView` (it builds only the rows on screen). A text scan: imported
459
459
  * components and `@children` are not followed.
460
460
  */
@@ -44,14 +44,14 @@ export declare const API_REQUESTS: Readonly<Record<string, readonly ApiRequest[]
44
44
  */
45
45
  export declare const SUBSCRIBED_EVENTS: readonly string[];
46
46
  /**
47
- * Members whose requests depend on an argument (SDK 1.7.0), which
48
- * `API_REQUESTS` cannot list: the event name of a listener (`event`: a
49
- * subscribed event's `events.subscribe`, nothing for the others) or the
50
- * method name of a request (`method`: that method, with the string
51
- * fields of the second argument as its parameters). The capability check
52
- * reads the argument when its type is one string (a literal, a constant),
53
- * and reports the call as unchecked otherwise (a computed name, a union of
54
- * several, the member taken by destructuring or as a value).
47
+ * Members whose requests depend on an argument, which `API_REQUESTS` cannot
48
+ * list: the event name of a listener (`event`: a subscribed event's
49
+ * `events.subscribe`, nothing for the others) or the method name of a request
50
+ * (`method`: that method, with the string fields of the second argument as its
51
+ * parameters). The capability check reads the argument when its type is one
52
+ * string (a literal, a constant), and reports the call as unchecked otherwise
53
+ * (a computed name, a union of several, the member taken by destructuring or as
54
+ * a value).
55
55
  *
56
56
  * @internal
57
57
  */
@@ -176,14 +176,14 @@ export const SUBSCRIBED_EVENTS = Object.freeze([
176
176
  "video.upscaling.changed",
177
177
  ]);
178
178
  /**
179
- * Members whose requests depend on an argument (SDK 1.7.0), which
180
- * `API_REQUESTS` cannot list: the event name of a listener (`event`: a
181
- * subscribed event's `events.subscribe`, nothing for the others) or the
182
- * method name of a request (`method`: that method, with the string
183
- * fields of the second argument as its parameters). The capability check
184
- * reads the argument when its type is one string (a literal, a constant),
185
- * and reports the call as unchecked otherwise (a computed name, a union of
186
- * several, the member taken by destructuring or as a value).
179
+ * Members whose requests depend on an argument, which `API_REQUESTS` cannot
180
+ * list: the event name of a listener (`event`: a subscribed event's
181
+ * `events.subscribe`, nothing for the others) or the method name of a request
182
+ * (`method`: that method, with the string fields of the second argument as its
183
+ * parameters). The capability check reads the argument when its type is one
184
+ * string (a literal, a constant), and reports the call as unchecked otherwise
185
+ * (a computed name, a union of several, the member taken by destructuring or as
186
+ * a value).
187
187
  *
188
188
  * @internal
189
189
  */
@@ -15,13 +15,13 @@
15
15
  * (their object comes from a call that is checked) and options that need
16
16
  * more (a `processed` capture, a file resolver).
17
17
  *
18
- * Members whose capability depends on an argument (SDK 1.7.0:
19
- * `plugin.player.on` and `plugin.wire.on` by event name,
20
- * `plugin.wire.request` by method name, `ARGUMENT_APIS`) are checked by
21
- * that argument when its type fixes it to one string (a literal, a
22
- * constant); otherwise (a computed name, a union of several, the member
23
- * taken by destructuring or as a value) the call is reported as unchecked
24
- * ({@link checkCapabilities}), and the player still checks it.
18
+ * Members whose capability depends on an argument (`plugin.player.on` and
19
+ * `plugin.wire.on` by event name, `plugin.wire.request` by method name,
20
+ * `ARGUMENT_APIS`) are checked by that argument when its type fixes it to one
21
+ * string (a literal, a constant); otherwise (a computed name, a union of
22
+ * several, the member taken by destructuring or as a value) the call is
23
+ * reported as unchecked ({@link checkCapabilities}), and the player still
24
+ * checks it.
25
25
  *
26
26
  * The TypeScript module is passed in, never imported: the CLI uses the
27
27
  * SDK's own compiler, the editor its TypeScript server's.
@@ -70,10 +70,10 @@ export interface CheckOptions {
70
70
  readonly rules?: CapabilityRules;
71
71
  }
72
72
  /**
73
- * @internal A call whose capability the checker cannot tell (SDK 1.7.0): a
74
- * member of `ARGUMENT_APIS` (`plugin.wire.request`, `player.on`,
75
- * `wire.on`) whose name argument is not a string the types fix, or a method
76
- * the player's table does not know. The player still checks it at run time.
73
+ * @internal A call whose capability the checker cannot tell: a member of
74
+ * `ARGUMENT_APIS` (`plugin.wire.request`, `player.on`, `wire.on`) whose name
75
+ * argument is not a string the types fix, or a method the player's table does
76
+ * not know. The player still checks it at run time.
77
77
  */
78
78
  export interface UncheckedCall {
79
79
  readonly file: string;
@@ -96,10 +96,10 @@ export interface UncheckedCall {
96
96
  */
97
97
  export declare function findUndeclaredCapabilities(ts: typeof TS, program: TS.Program, options: CheckOptions): CapabilityFinding[];
98
98
  /**
99
- * The capability check (SDK 1.7.0): the uses of members whose capability
100
- * the manifest does not declare (`findings`, as
101
- * {@link findUndeclaredCapabilities}), and the calls whose capability
102
- * depends on a name the checker cannot read (`unchecked`).
99
+ * The capability check: the uses of members whose capability the manifest does
100
+ * not declare (`findings`, as {@link findUndeclaredCapabilities}), and the
101
+ * calls whose capability depends on a name the checker cannot read
102
+ * (`unchecked`).
103
103
  *
104
104
  * A call of `plugin.player.on` or `plugin.wire.on` is checked by its event
105
105
  * name, one of `plugin.wire.request` by its method name and the string
@@ -134,10 +134,10 @@ export function findUndeclaredCapabilities(ts, program, options) {
134
134
  return checkCapabilities(ts, program, options).findings;
135
135
  }
136
136
  /**
137
- * The capability check (SDK 1.7.0): the uses of members whose capability
138
- * the manifest does not declare (`findings`, as
139
- * {@link findUndeclaredCapabilities}), and the calls whose capability
140
- * depends on a name the checker cannot read (`unchecked`).
137
+ * The capability check: the uses of members whose capability the manifest does
138
+ * not declare (`findings`, as {@link findUndeclaredCapabilities}), and the
139
+ * calls whose capability depends on a name the checker cannot read
140
+ * (`unchecked`).
141
141
  *
142
142
  * A call of `plugin.player.on` or `plugin.wire.on` is checked by its event
143
143
  * name, one of `plugin.wire.request` by its method name and the string
@@ -87,11 +87,10 @@ export interface MemberNeed {
87
87
  */
88
88
  export declare function memberNeeds(api: string, capabilities: readonly string[], rules?: CapabilityRules): MemberNeed[] | undefined;
89
89
  /**
90
- * The requests of a call to a member of `ARGUMENT_APIS` (SDK 1.7.0), given
91
- * the value of its first argument and the string fields of its second:
92
- * a subscribed event's `events.subscribe`, nothing for an event that
93
- * arrives unasked, or the named method. `undefined`: a method the player's
94
- * table does not know (not checked).
90
+ * The requests of a call to a member of `ARGUMENT_APIS`, given the value of its
91
+ * first argument and the string fields of its second: a subscribed event's
92
+ * `events.subscribe`, nothing for an event that arrives unasked, or the named
93
+ * method. `undefined`: a method the player's table does not know (not checked).
95
94
  *
96
95
  * @param kind - What the argument names (`ARGUMENT_APIS`).
97
96
  * @param name - The event or method name.
@@ -73,11 +73,10 @@ export function memberNeeds(api, capabilities, rules = RULES) {
73
73
  return requestsNeed(requests, capabilities, rules);
74
74
  }
75
75
  /**
76
- * The requests of a call to a member of `ARGUMENT_APIS` (SDK 1.7.0), given
77
- * the value of its first argument and the string fields of its second:
78
- * a subscribed event's `events.subscribe`, nothing for an event that
79
- * arrives unasked, or the named method. `undefined`: a method the player's
80
- * table does not know (not checked).
76
+ * The requests of a call to a member of `ARGUMENT_APIS`, given the value of its
77
+ * first argument and the string fields of its second: a subscribed event's
78
+ * `events.subscribe`, nothing for an event that arrives unasked, or the named
79
+ * method. `undefined`: a method the player's table does not know (not checked).
81
80
  *
82
81
  * @param kind - What the argument names (`ARGUMENT_APIS`).
83
82
  * @param name - The event or method name.
@@ -101,15 +101,12 @@ export declare const COMMAND_LIMITS: {
101
101
  };
102
102
  /**
103
103
  * The player's built-in top-level menus, by id. Write `@<id>` as the first
104
- * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`) to put a
105
- * command into that menu whatever language the player's menus are in. The
106
- * player stores the menu's title (视频 today); later segments are titles.
107
- * Needs player 0.3.0 (`"minPlayerVersion": "0.3.0"`); older players show
108
- * `@video` as a menu of its own. `reset` (SDK 1.5.51) needs player 0.6.3:
109
- * the Reset menu, directly below Settings, gathers every command that puts
110
- * something back to its default; older players refuse `@reset` with
111
- * `invalid`. The player's tests check that this list agrees with the
112
- * player's.
104
+ * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`)
105
+ * to put a command into that menu whatever language the player's menus are in.
106
+ * Later segments are titles.
107
+ * `reset`: the Reset menu, directly below Settings, gathers every command that
108
+ * puts something back to its default. The player's tests check that this list
109
+ * agrees with the player's.
113
110
  *
114
111
  * @example Put a command into the built-in Video menu
115
112
  * "Blur" appears in the player's Video menu in every interface language.
@@ -133,12 +130,11 @@ export declare const COMMAND_LIMITS: {
133
130
  */
134
131
  export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video", "audio", "screen", "settings", "reset"];
135
132
  /**
136
- * The icons a bottom-bar button may name (`CommandOptions.button.icon`):
137
- * every icon of the player's V-Line set, `@vestra/icons.slint` (draw one
138
- * in your own Slint with `Icon { name: "store"; }`). The player's tests check
139
- * that this list is its icon set. `"sliders"` (three sliders, the player's
140
- * Adjustments and Effects button) is new in player 0.7.6 (SDK 1.6.11); older players refuse
141
- * it as a button icon with `invalid`.
133
+ * The icons a bottom-bar button may name (`CommandOptions.button.icon`): every
134
+ * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
135
+ * Slint with `Icon { name: "store"; }`). The player's tests check that this
136
+ * list is its icon set. `"sliders"` (three sliders, the player's Adjustments
137
+ * and Effects button).
142
138
  *
143
139
  * @example Check in a test that the button's icon exists
144
140
  * The test fails before release if the plugin's bar button names an icon
@@ -158,13 +154,11 @@ export declare const MENU_IDS: readonly ["open", "playback", "subtitles", "video
158
154
  */
159
155
  export declare const BAR_BUTTON_ICONS: readonly ["play", "pause", "stop", "back", "forward", "open", "volume", "mute", "playlist", "detach", "attach", "close", "failed", "move-top", "move-up", "move-down", "move-bottom", "search", "chapter", "bookmark", "check-task", "check-box", "menu-check", "submenu", "scroll-up", "scroll-down", "caret-down", "sort-asc", "sort-desc", "tag-remove", "preview-play", "add", "remove", "sort", "fullscreen", "exit-fullscreen", "store", "ai", "sliders"];
160
156
  /**
161
- * The player's limits on bottom-bar buttons (`CommandOptions.button`), the
162
- * same values as the player's (its tests check that they agree). A button
163
- * past `perPlugin` has none (its command still registers and its menu entry
164
- * stays). `total` is what the strip holds: the `total` lowest by order,
165
- * plugin id and declaration order; the rest are in the strip's » menu, in
166
- * the same order (older players keep the `total` highest and leave the
167
- * others out).
157
+ * The player's limits on bottom-bar buttons (`CommandOptions.button`), the same
158
+ * values as the player's (its tests check that they agree). A button past
159
+ * `perPlugin` has none (its command still registers and its menu entry stays).
160
+ * `total` is what the strip holds: the `total` lowest by order, plugin id and
161
+ * declaration order; the rest are in the strip's » menu, in the same order.
168
162
  *
169
163
  * @since 1.5.29
170
164
  *
@@ -210,8 +204,8 @@ export interface BuiltinSubmenu {
210
204
  * @example Add an item to the built-in Snapshot submenu
211
205
  * "Copy Snapshot" appears in Snapshot ▸ next to the built-in capture
212
206
  * plugin's items. Paths merge by their English keys, so a command whose
213
- * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu
214
- * since player 0.7.6) lands in the same submenu whatever the interface
207
+ * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu)
208
+ * lands in the same submenu whatever the interface
215
209
  * language.
216
210
  * ```ts
217
211
  * import type { Plugin } from "@vestra-player/sdk";
@@ -297,22 +291,21 @@ export type CommandState = {
297
291
  enabled: boolean;
298
292
  checked: boolean | null;
299
293
  busy: boolean;
300
- /** Source text, or a text value (player 0.4.3). */
294
+ /** Source text, or a text value. */
301
295
  reason: string | TextJson | ListJson | null;
302
296
  };
303
297
  /**
304
- * A command's conditions (SDK 1.5.40, player 0.5.21): `enabled` and
305
- * `checked` evaluated by the player (`plugin.when`). Older players ignore
306
- * the field and show the state as sent.
298
+ * A command's conditions: `enabled` and `checked` evaluated by the player
299
+ * (`plugin.when`).
307
300
  */
308
301
  export type CommandWhen = {
309
302
  enabled?: ConditionJson;
310
303
  checked?: ConditionJson;
311
304
  };
312
305
  export type CommandDeclaration = {
313
- /** Source text, or a text value (player 0.4.3). */
306
+ /** Source text, or a text value. */
314
307
  title: string | TextJson;
315
- /** Complete primary menu path INCLUDING its leaf; empty = not in the main menu. Segments may be text values (player 0.4.3). */
308
+ /** Complete primary menu path INCLUDING its leaf; empty = not in the main menu. Segments may be text values. */
316
309
  path: (string | TextJson)[];
317
310
  /** Sibling order, ascending; a submenu takes its first command's order (a built-in menu keeps a fixed one). */
318
311
  order: number;
@@ -327,30 +320,27 @@ export type CommandDeclaration = {
327
320
  /** Fire again on keyboard auto-repeat while held. */
328
321
  repeat: boolean;
329
322
  /**
330
- * A bottom-bar button (player 0.5.10): an icon name, or an image in the
331
- * `plugin.ui.image` wire form. Sent only when set: older players refuse
332
- * unknown declaration fields.
323
+ * A bottom-bar button: an icon name, or an image in the `plugin.ui.image`
324
+ * wire form.
333
325
  */
334
326
  button?: {
335
327
  icon: string | Json;
336
328
  order: number;
337
329
  };
338
330
  /**
339
- * The command's category, source text or a text value (player 0.7.6).
340
- * Sent only when set: older players refuse unknown declaration fields.
331
+ * The command's category, source text or a text value.
341
332
  */
342
333
  category?: string | TextJson;
343
334
  /**
344
- * The local id of the command that opens where this one lives (player
345
- * 0.7.6). Sent only when set, like `category`.
335
+ * The local id of the command that opens where this one lives. Sent only when
336
+ * set, like `category`.
346
337
  */
347
338
  home?: string;
348
339
  };
349
340
  /**
350
- * `commands.keys` (player 0.7.6): each of the plugin's own commands, by
351
- * local id, and (SDK 1.6.16) each of the player's own as `host/<id>`, with
352
- * the labels of its current keys; the answer to the request and the data of
353
- * the event of that name.
341
+ * `commands.keys`: each of the plugin's own commands, by local id, and each of
342
+ * the player's own as `host/<id>`, with the labels of its current keys; the
343
+ * answer to the request and the data of the event of that name.
354
344
  *
355
345
  * @remarks
356
346
  * The player's wire shape (`commands.keys`), part of the protocol, which is not
@@ -372,9 +362,9 @@ export declare function commandClient(transport: Transport): {
372
362
  /** Remove the command from the menu and the binding table; the id is free again. */
373
363
  unregister: (id: string) => Promise<void>;
374
364
  /**
375
- * The key labels of the plugin's own commands, as menus show them
376
- * (player 0.7.6); later changes come as the `commands.keys` event, in
377
- * the same shape. `revision` orders answers and events.
365
+ * The key labels of the plugin's own commands, as menus show them; later
366
+ * changes come as the `commands.keys` event, in the same shape. `revision`
367
+ * orders answers and events.
378
368
  */
379
369
  keys: () => Promise<CommandKeys>;
380
370
  update: (id: string, revision: number, state: CommandState, when?: CommandWhen) => Promise<{
package/dist/commands.js CHANGED
@@ -97,15 +97,12 @@ export const COMMAND_LIMITS = {
97
97
  };
98
98
  /**
99
99
  * The player's built-in top-level menus, by id. Write `@<id>` as the first
100
- * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`) to put a
101
- * command into that menu whatever language the player's menus are in. The
102
- * player stores the menu's title (视频 today); later segments are titles.
103
- * Needs player 0.3.0 (`"minPlayerVersion": "0.3.0"`); older players show
104
- * `@video` as a menu of its own. `reset` (SDK 1.5.51) needs player 0.6.3:
105
- * the Reset menu, directly below Settings, gathers every command that puts
106
- * something back to its default; older players refuse `@reset` with
107
- * `invalid`. The player's tests check that this list agrees with the
108
- * player's.
100
+ * segment of a command path (`["@video", "Blur"]`, see `CommandOptions.path`)
101
+ * to put a command into that menu whatever language the player's menus are in.
102
+ * Later segments are titles.
103
+ * `reset`: the Reset menu, directly below Settings, gathers every command that
104
+ * puts something back to its default. The player's tests check that this list
105
+ * agrees with the player's.
109
106
  *
110
107
  * @example Put a command into the built-in Video menu
111
108
  * "Blur" appears in the player's Video menu in every interface language.
@@ -138,12 +135,11 @@ export const MENU_IDS = [
138
135
  "reset",
139
136
  ];
140
137
  /**
141
- * The icons a bottom-bar button may name (`CommandOptions.button.icon`):
142
- * every icon of the player's V-Line set, `@vestra/icons.slint` (draw one
143
- * in your own Slint with `Icon { name: "store"; }`). The player's tests check
144
- * that this list is its icon set. `"sliders"` (three sliders, the player's
145
- * Adjustments and Effects button) is new in player 0.7.6 (SDK 1.6.11); older players refuse
146
- * it as a button icon with `invalid`.
138
+ * The icons a bottom-bar button may name (`CommandOptions.button.icon`): every
139
+ * icon of the player's V-Line set, `@vestra/icons.slint` (draw one in your own
140
+ * Slint with `Icon { name: "store"; }`). The player's tests check that this
141
+ * list is its icon set. `"sliders"` (three sliders, the player's Adjustments
142
+ * and Effects button).
147
143
  *
148
144
  * @example Check in a test that the button's icon exists
149
145
  * The test fails before release if the plugin's bar button names an icon
@@ -203,13 +199,11 @@ export const BAR_BUTTON_ICONS = [
203
199
  "sliders",
204
200
  ];
205
201
  /**
206
- * The player's limits on bottom-bar buttons (`CommandOptions.button`), the
207
- * same values as the player's (its tests check that they agree). A button
208
- * past `perPlugin` has none (its command still registers and its menu entry
209
- * stays). `total` is what the strip holds: the `total` lowest by order,
210
- * plugin id and declaration order; the rest are in the strip's » menu, in
211
- * the same order (older players keep the `total` highest and leave the
212
- * others out).
202
+ * The player's limits on bottom-bar buttons (`CommandOptions.button`), the same
203
+ * values as the player's (its tests check that they agree). A button past
204
+ * `perPlugin` has none (its command still registers and its menu entry stays).
205
+ * `total` is what the strip holds: the `total` lowest by order, plugin id and
206
+ * declaration order; the rest are in the strip's » menu, in the same order.
213
207
  *
214
208
  * @since 1.5.29
215
209
  *
@@ -236,8 +230,8 @@ export const BAR_BUTTON_LIMITS = {
236
230
  * @example Add an item to the built-in Snapshot submenu
237
231
  * "Copy Snapshot" appears in Snapshot ▸ next to the built-in capture
238
232
  * plugin's items. Paths merge by their English keys, so a command whose
239
- * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu
240
- * since player 0.7.6) lands in the same submenu whatever the interface
233
+ * path starts with the submenu's keys (`["Snapshot"]`, a top-level submenu)
234
+ * lands in the same submenu whatever the interface
241
235
  * language.
242
236
  * ```ts
243
237
  * import type { Plugin } from "@vestra-player/sdk";
@@ -663,9 +657,9 @@ export function commandClient(transport) {
663
657
  /** Remove the command from the menu and the binding table; the id is free again. */
664
658
  unregister: (id) => transport.request("commands.unregister", { id }),
665
659
  /**
666
- * The key labels of the plugin's own commands, as menus show them
667
- * (player 0.7.6); later changes come as the `commands.keys` event, in
668
- * the same shape. `revision` orders answers and events.
660
+ * The key labels of the plugin's own commands, as menus show them; later
661
+ * changes come as the `commands.keys` event, in the same shape. `revision`
662
+ * orders answers and events.
669
663
  */
670
664
  keys: () => transport.request("commands.keys", {}),
671
665
  update: (id, revision, state, when) => transport.request("commands.update", {
Binary file
package/dist/docs.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface DocsOptions {
19
19
  *
20
20
  * `/` lists Overview, Guides and API. `/Guides/<group>/<page title>` is a
21
21
  * page of the documentation site (its file name works too:
22
- * `/Guides/How-to/testing`); `/API/<category>/<symbol>/<member>` is a
22
+ * `/Guides/Guides/testing`); `/API/<category>/<symbol>/<member>` is a
23
23
  * declaration with its signature, parameters, return value, errors,
24
24
  * capability, player version and examples. Matching ignores case, spaces
25
25
  * and punctuation; a leading `/` and a `.md` suffix are optional; `.`
package/dist/docs.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * docs("/") the top level
9
9
  * docs("/API/Media") a category: its symbols
10
10
  * docs("/API/Media/Snapshot/dispose") a member: its whole documentation
11
- * docs("/Guides/How-to/Test a plugin") a guide page
11
+ * docs("/Guides/Guides/Test a plugin") a guide page
12
12
  * searchDocs("snapshot export") matching paths
13
13
  * ```
14
14
  *
@@ -71,7 +71,8 @@ function tree() {
71
71
  };
72
72
  const root = nodes[0];
73
73
  assign(root);
74
- loaded = { version: data.version, root, nodes };
74
+ const moved = new Map(Object.entries(data.m ?? {}).map(([key, index]) => [key, nodes[index]]));
75
+ loaded = { version: data.version, root, nodes, moved };
75
76
  return loaded;
76
77
  }
77
78
  const bytes = (text) => Buffer.byteLength(text, "utf8");
@@ -193,6 +194,15 @@ function resolve(segments) {
193
194
  const none = { node: root, jumps: 0, inexact: 0, dropped: 0 };
194
195
  if (!segments.length)
195
196
  return { node: root, jumped: false };
197
+ // A page of an old group (`/Guides/How-to/testing`, `/Guides/Explanation/plugins`)
198
+ // opens the page it moved to, as the site's redirects do.
199
+ const old = loose(segments[0]) === "guides" ? segments.slice(1) : segments;
200
+ if (old.length === 2) {
201
+ const page = old[1].replace(/\.md$/i, "");
202
+ const moved = tree().moved.get(`${loose(old[0])}/${loose(page)}`);
203
+ if (moved)
204
+ return { node: moved, jumped: false };
205
+ }
196
206
  const attempts = [segments];
197
207
  const dotted = segments.flatMap((segment) => segment.split(".").filter(Boolean));
198
208
  if (dotted.length !== segments.length)
@@ -438,7 +448,7 @@ function notFound(asked, segments, page) {
438
448
  *
439
449
  * `/` lists Overview, Guides and API. `/Guides/<group>/<page title>` is a
440
450
  * page of the documentation site (its file name works too:
441
- * `/Guides/How-to/testing`); `/API/<category>/<symbol>/<member>` is a
451
+ * `/Guides/Guides/testing`); `/API/<category>/<symbol>/<member>` is a
442
452
  * declaration with its signature, parameters, return value, errors,
443
453
  * capability, player version and examples. Matching ignores case, spaces
444
454
  * and punctuation; a leading `/` and a `.md` suffix are optional; `.`
@@ -8,7 +8,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
8
8
  };
9
9
  /**
10
10
  * `vestra-plugin i18n extract` and `vestra-plugin i18n check`, and the
11
- * catalog step of `vestra-plugin build` (docs/how-to/i18n.md): find the
11
+ * catalog step of `vestra-plugin build` (docs/guides/i18n.md): find the
12
12
  * translatable texts of a plugin, keep `locales/messages.pot` and
13
13
  * `locales/<lang>.po` up to date, warn about what cannot be translated, and
14
14
  * compile the `.po` files the player reads.
package/dist/i18n.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * `locales/<lang>.json` a package carries, template formatting and the
5
5
  * Slint `@tr` scanner. Used by `vestra-plugin i18n`, `vestra-plugin build`
6
6
  * and {@link TestHost}; not part of the plugin API (plugins write no
7
- * translation code: see docs/how-to/i18n.md).
7
+ * translation code: see docs/guides/i18n.md).
8
8
  * Internal: the player's runner and tests reach it through
9
9
  * `@vestra-player/sdk/runtime`, `LOCALES` through `./testing`.
10
10
  */
package/dist/media.d.ts CHANGED
@@ -160,7 +160,7 @@ export type MediaJob = {
160
160
  duration: string;
161
161
  };
162
162
  };
163
- /** A stream copy (player 0.7.6): what was copied and from where. */
163
+ /** A stream copy: what was copied and from where. */
164
164
  copy?: {
165
165
  container: "mp4" | "mkv";
166
166
  videoCodec: string;
@@ -177,9 +177,9 @@ export type MediaJob = {
177
177
  };
178
178
  outcome: null | {
179
179
  destination: string;
180
- /** Clips (player 0.7.6): first frame, source seconds. */
180
+ /** Clips: first frame, source seconds. */
181
181
  start?: number;
182
- /** Clips (player 0.7.6): end of the last frame, source seconds. */
182
+ /** Clips: end of the last frame, source seconds. */
183
183
  end?: number;
184
184
  } | {
185
185
  error: {
@@ -190,8 +190,8 @@ export type MediaJob = {
190
190
  cancelled: true;
191
191
  };
192
192
  /**
193
- * Player 0.7.6: seconds of a clip written and to write while FFmpeg runs;
194
- * `null` (or absent from older players) while unknown.
193
+ * Seconds of a clip written and to write while FFmpeg runs; `null` while
194
+ * unknown.
195
195
  */
196
196
  progress?: {
197
197
  done: number;
@@ -246,10 +246,10 @@ export declare function mediaClients(transport: Transport): {
246
246
  } | {
247
247
  kind: "rawMp4" | "processedMp4";
248
248
  end: number;
249
- /** Player 0.7.6. */
249
+ /** The encoder settings used. */
250
250
  encoding?: WireEncoding;
251
251
  } | {
252
- /** Stream copy, player 0.7.6. */
252
+ /** Stream copy. */
253
253
  kind: "rawCopy";
254
254
  end: number;
255
255
  container?: "auto" | "mp4" | "mkv";