@vestra-player/sdk 1.8.0 → 1.9.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +2 -2
  3. package/bin/vestra-plugin.mjs +11 -100
  4. package/capability-scan.json +3 -1
  5. package/dist/api-requests.d.ts +11 -36
  6. package/dist/api-requests.js +18 -47
  7. package/dist/capability-scan.d.ts +1 -1
  8. package/dist/capability-scan.js +8 -9
  9. package/dist/docs-tree.json.gz +0 -0
  10. package/dist/docs.d.ts +1 -1
  11. package/dist/docs.js +1 -1
  12. package/dist/index.d.ts +4 -5
  13. package/dist/manifest.d.ts +5 -0
  14. package/dist/manifest.js +9 -24
  15. package/dist/member-uses.d.ts +61 -0
  16. package/dist/member-uses.js +160 -0
  17. package/dist/player-runtime.d.ts +1 -2
  18. package/dist/player-runtime.js +1 -2
  19. package/dist/plugin/appearance.d.ts +1 -1
  20. package/dist/plugin/appearance.js +2 -2
  21. package/dist/plugin/bindings.d.ts +1 -1
  22. package/dist/plugin/bindings.js +2 -2
  23. package/dist/plugin/commands.js +1 -12
  24. package/dist/plugin/connection.d.ts +26 -7
  25. package/dist/plugin/connection.js +68 -36
  26. package/dist/plugin/drops.js +1 -1
  27. package/dist/plugin/index.js +9 -15
  28. package/dist/plugin/media.js +0 -12
  29. package/dist/plugin/mpv.js +0 -7
  30. package/dist/plugin/packages.js +1 -2
  31. package/dist/plugin/player/events.d.ts +4 -3
  32. package/dist/plugin/player/events.js +7 -6
  33. package/dist/plugin/player.d.ts +21 -13
  34. package/dist/plugin/player.js +56 -21
  35. package/dist/plugin/services.d.ts +4 -4
  36. package/dist/plugin/services.js +7 -29
  37. package/dist/plugin/settings.js +1 -1
  38. package/dist/plugin/shaders.js +0 -2
  39. package/dist/plugin/stream.d.ts +2 -1
  40. package/dist/plugin/stream.js +2 -2
  41. package/dist/plugin/testing/commands.d.ts +3 -10
  42. package/dist/plugin/testing/commands.js +6 -15
  43. package/dist/plugin/testing/index.d.ts +26 -116
  44. package/dist/plugin/testing/index.js +30 -104
  45. package/dist/plugin/testing/processing.js +1 -1
  46. package/dist/plugin/testing/services.js +0 -1
  47. package/dist/plugin/timeline.d.ts +2 -3
  48. package/dist/plugin/timeline.js +4 -8
  49. package/dist/plugin/types/base.d.ts +40 -86
  50. package/dist/plugin/types/commands.d.ts +10 -67
  51. package/dist/plugin/types/packages.d.ts +17 -55
  52. package/dist/plugin/types/playback.d.ts +126 -144
  53. package/dist/plugin/types/plugin-wire.d.ts +6 -36
  54. package/dist/plugin/types/processing.d.ts +10 -49
  55. package/dist/plugin/types/services.d.ts +11 -70
  56. package/dist/plugin/types/snapshots.d.ts +7 -60
  57. package/dist/plugin/types/sources.d.ts +2 -11
  58. package/dist/plugin/types/subtitles.d.ts +5 -26
  59. package/dist/plugin/types/ui-content.d.ts +1 -16
  60. package/dist/plugin/types/ui-layout.d.ts +53 -79
  61. package/dist/plugin/types/ui-locale.d.ts +5 -23
  62. package/dist/plugin/types/ui-shell.d.ts +13 -59
  63. package/dist/plugin/view/layout.js +1 -1
  64. package/dist/plugin/view.js +0 -2
  65. package/dist/plugin/window.d.ts +1 -1
  66. package/dist/plugin/window.js +1 -1
  67. package/dist/plugin/wire-facade.js +1 -2
  68. package/dist/processing.d.ts +2 -3
  69. package/dist/protocol.d.ts +14 -0
  70. package/dist/protocol.js +14 -0
  71. package/dist/request-queue.js +1 -1
  72. package/dist/subtitles.d.ts +1 -1
  73. package/dist/ts-plugin.d.ts +8 -15
  74. package/dist/ts-plugin.js +3 -141
  75. package/dist/wire.d.ts +7 -12
  76. package/dist/wire.js +6 -8
  77. package/llms.txt +4 -4
  78. package/package.json +1 -2
  79. package/dist/capabilities.d.ts +0 -107
  80. package/dist/capabilities.js +0 -69
  81. package/dist/capability-check.d.ts +0 -176
  82. package/dist/capability-check.js +0 -461
  83. package/dist/capability-rules.d.ts +0 -125
  84. package/dist/capability-rules.js +0 -192
  85. package/dist/host-capabilities.d.ts +0 -10
  86. package/dist/host-capabilities.js +0 -492
@@ -70,7 +70,8 @@ import { join } from "node:path";
70
70
  import { fileURLToPath } from "node:url";
71
71
  import { HostError } from "../../wire.js";
72
72
  import { BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS, BUILTIN_COMMANDS, BUILTIN_SUBMENUS, COMMAND_LIMITS, MENU_IDS, } from "../../commands.js";
73
- import { CAPABILITY_INFO, MESSAGE_LIMIT } from "../../capabilities.js";
73
+ import { CAPABILITIES_REMOVED } from "../../manifest.js";
74
+ import { MESSAGE_LIMIT } from "../../protocol.js";
74
75
  import { OSD_LIMITS } from "../osd.js";
75
76
  import { TIMELINE_LIMITS } from "../timeline.js";
76
77
  import { SECRET_LIMITS, SESSION_STORAGE_LIMITS } from "../services.js";
@@ -85,7 +86,7 @@ import { PATCH_FEATURE } from "../patch.js";
85
86
  import { LOCALES, LIST_SEPARATORS, loadPackageCatalog, TEXT_LIMITS, } from "../../i18n.js";
86
87
  import { Internals } from "./internals.js";
87
88
  import { on, emit, settle, close, keepsRunning, transportHandlers, tick, takenErrors, tellResidency, } from "./transport.js";
88
- import { bindingClaims, bindingKey, keysChanged, press, barButtons, commandsHandlers, builtinHandlers, runPaletteLead, pluginCapabilities, } from "./commands.js";
89
+ import { bindingClaims, bindingKey, keysChanged, press, barButtons, commandsHandlers, builtinHandlers, runPaletteLead, } from "./commands.js";
89
90
  import { registerCoreActions, windowFacts, coreActionsHandlers, } from "./core-actions.js";
90
91
  import { translate, i18nHandlers } from "./i18n.js";
91
92
  import { mountOther, unmountOther, mounted, setTimelineRanges, setTimelineLayer, layoutHandlers, } from "./layout.js";
@@ -104,8 +105,6 @@ export { COMMAND_LIMITS, MENU_IDS };
104
105
  export { BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS };
105
106
  /** The submenus of the player's built-in plugins, by key path. */
106
107
  export { BUILTIN_COMMANDS, BUILTIN_SUBMENUS };
107
- /** The manifest capabilities: what each opens and how the store shows it. */
108
- export { CAPABILITY_INFO };
109
108
  /** The longest message a plugin may send the player. */
110
109
  export { MESSAGE_LIMIT };
111
110
  /** The player's limits on the on-screen display. */
@@ -245,7 +244,6 @@ export { LOCALES };
245
244
  * {@link startPlugin}, drive it, `settle()`, and assert on what it
246
245
  * recorded.
247
246
  *
248
- * @capability None.
249
247
  * @see [Test a plugin](../../../docs/guides/testing.md)
250
248
  * @since 1.0.0
251
249
  * @category Testing
@@ -257,7 +255,7 @@ export class TestHost {
257
255
  * Wire-level; prefer {@link TestHost.sent} for one method.
258
256
  */
259
257
  calls = [];
260
- /** The host events the plugin subscribed to (needs `events` etc.). */
258
+ /** The host events the plugin subscribed to. */
261
259
  subscriptions = new Set();
262
260
  /**
263
261
  * The subscribed events the plugin really listens to: an `onChange` and
@@ -362,7 +360,6 @@ export class TestHost {
362
360
  * await host.pressOsdAction(0); // runs the plugin's `reveal` command
363
361
  * ```
364
362
  *
365
- * @capability None.
366
363
  * @since 1.6.9
367
364
  */
368
365
  async pressOsdAction(index) {
@@ -425,8 +422,6 @@ export class TestHost {
425
422
  * @param directory - The package directory (holding `locales/`).
426
423
  * @since 1.5.9
427
424
  *
428
- * @capability None.
429
- *
430
425
  * @example Load the translations after changing the language
431
426
  * The test switches the host to German before starting the plugin and
432
427
  * loads that catalog itself (`startPlugin` does the same). Texts are then
@@ -463,8 +458,6 @@ export class TestHost {
463
458
  * ```
464
459
  *
465
460
  * @since 1.5.9
466
- *
467
- * @capability None.
468
461
  */
469
462
  translate(text, args) {
470
463
  return translate(this, this.#inner, text, args);
@@ -483,11 +476,9 @@ export class TestHost {
483
476
  * @param language - `"system"` or a locale.
484
477
  * @since 1.5.9
485
478
  *
486
- * @capability None.
487
- *
488
479
  * @example Simulate the user choosing French for the next start
489
480
  * The plugin hears that the saved interface language changed. The host
490
- * pushes `appearance.changed`, which a plugin with `events` sees in
481
+ * pushes `appearance.changed`, which a plugin sees (after `plugin.player.subscribe()`) in
491
482
  * `appearance.language` once it has read it and subscribed; this run's
492
483
  * language does not change.
493
484
  * ```ts
@@ -705,7 +696,6 @@ export class TestHost {
705
696
  * assert.equal(plugin.timeline.ranges[0]?.plugin, "community.clips");
706
697
  * ```
707
698
  *
708
- * @capability None.
709
699
  * @since 1.6.9
710
700
  */
711
701
  setTimelineRanges(pluginId, ranges) {
@@ -721,8 +711,8 @@ export class TestHost {
721
711
  * @example Let another plugin publish chapters
722
712
  * The plugin under test sees two chapter marks another plugin put on the
723
713
  * timeline. `setTimelineLayer` stores that plugin's whole layer and pushes
724
- * `timeline.changed`; once the plugin uses `plugin.timeline` (with
725
- * `events`) the SDK keeps `marks` current from that event, and `settle()`
714
+ * `timeline.changed`; once the plugin uses `plugin.timeline` (after
715
+ * `plugin.player.subscribe()`) the SDK keeps `marks` current from that event, and `settle()`
726
716
  * lets it arrive.
727
717
  * ```ts
728
718
  * import assert from "node:assert/strict";
@@ -736,7 +726,6 @@ export class TestHost {
736
726
  * assert.equal(plugin.timeline.marks.length, 2);
737
727
  * ```
738
728
  *
739
- * @capability None.
740
729
  * @since 1.0.0
741
730
  */
742
731
  setTimelineLayer(pluginId, marks) {
@@ -770,7 +759,6 @@ export class TestHost {
770
759
  * );
771
760
  * ```
772
761
  *
773
- * @capability None.
774
762
  * @since 1.0.0
775
763
  */
776
764
  imagePath(value) {
@@ -816,7 +804,6 @@ export class TestHost {
816
804
  * });
817
805
  * ```
818
806
  *
819
- * @capability None.
820
807
  * @throws Never: files nobody takes are ignored, as in the player.
821
808
  * @since 1.0.0
822
809
  */
@@ -829,17 +816,15 @@ export class TestHost {
829
816
  * Simulate another plugin switching the palette: updates
830
817
  * {@link TestHost.appearance} and pushes `appearance.changed`.
831
818
  *
832
- * @capability None.
833
- *
834
819
  * @example Simulate another plugin switching to the light palette
835
820
  * The plugin hears the palette change. The host updates `appearance` and
836
- * pushes `appearance.changed` to a plugin that listens with `events`.
821
+ * pushes `appearance.changed` to a plugin that listens (after `plugin.player.subscribe()`).
837
822
  * ```ts
838
823
  * import assert from "node:assert/strict";
839
824
  * declare const host: TestHost;
840
825
  * // ---cut---
841
826
  * const themes: string[] = [];
842
- * plugin.player.on("appearance.changed", ({ theme }) => themes.push(theme)); // subscribes (`events`)
827
+ * plugin.player.on("appearance.changed", ({ theme }) => themes.push(theme)); // subscribes
843
828
  * host.setAppearance("vestra-light");
844
829
  * await host.settle();
845
830
  * assert.deepEqual(themes, ["vestra-light"]);
@@ -883,7 +868,6 @@ export class TestHost {
883
868
  * assert.equal(page.props["step"], 10);
884
869
  * ```
885
870
  *
886
- * @capability None.
887
871
  * @since 1.0.0
888
872
  */
889
873
  settingsPage(id) {
@@ -898,8 +882,6 @@ export class TestHost {
898
882
  * Simulate the backdrop's `effective` changing (`false`: a video frame
899
883
  * appeared; `true`: there is none again); pushed to the plugin.
900
884
  *
901
- * @capability None.
902
- *
903
885
  * @example Make a video picture replace the backdrop
904
886
  * The plugin's backdrop hears that a video frame now covers it. `false`
905
887
  * means a picture appeared; the change is pushed like the player's
@@ -950,8 +932,6 @@ export class TestHost {
950
932
  * ```
951
933
  *
952
934
  * @since 1.5.2
953
- *
954
- * @capability None.
955
935
  */
956
936
  mountOther(slot, plugin, options = {}) {
957
937
  return mountOther(this, this.#inner, slot, plugin, options);
@@ -962,8 +942,6 @@ export class TestHost {
962
942
  *
963
943
  * @since 1.5.2
964
944
  *
965
- * @capability None.
966
- *
967
945
  * @example Let the playlist's tab go away
968
946
  * The other plugin's sidebar tab disappears and the plugin's own tab
969
947
  * becomes current. When the removed tab was current, the next tab (else
@@ -987,8 +965,6 @@ export class TestHost {
987
965
  *
988
966
  * @since 1.5.2
989
967
  *
990
- * @capability None.
991
- *
992
968
  * @example Click another plugin's sidebar tab
993
969
  * The user switches the sidebar to the playlist; the plugin's panel is in
994
970
  * a background tab now. The change is pushed as `window.state`.
@@ -1022,8 +998,6 @@ export class TestHost {
1022
998
  * `video.view()` then fails with `conflict`), or, with `null`, releasing
1023
999
  * it (values reset to the defaults).
1024
1000
  *
1025
- * @capability None.
1026
- *
1027
1001
  * @example Let another plugin own the display layer
1028
1002
  * The plugin's `video.view()` fails with `conflict` because another plugin
1029
1003
  * took the display layer first. `null` releases it again.
@@ -1056,8 +1030,6 @@ export class TestHost {
1056
1030
  * `video.render()` then fails with `conflict`), or, with `null`, releasing
1057
1031
  * them (values reset to the defaults).
1058
1032
  *
1059
- * @capability None.
1060
- *
1061
1033
  * @example Let another plugin own the render options
1062
1034
  * The plugin's render options report `conflict` while another plugin owns
1063
1035
  * them; `null` releases them and resets the values to the defaults.
@@ -1105,7 +1077,6 @@ export class TestHost {
1105
1077
  * assert.equal(render.status.state, "failed");
1106
1078
  * ```
1107
1079
  *
1108
- * @capability None.
1109
1080
  * @since 1.0.0
1110
1081
  */
1111
1082
  failVideoRender(code, message) {
@@ -1143,8 +1114,6 @@ export class TestHost {
1143
1114
  * player never pushes it, it refuses the `set` request itself after
1144
1115
  * an abnormal end. To test that, set {@link TestHost.previousCrash}.
1145
1116
  *
1146
- * @capability None.
1147
- *
1148
1117
  * @example Make the plugin's shader fail to compile
1149
1118
  * The plugin's shader handle reports `failed`, as when mpv rejects a
1150
1119
  * shader. The host pushes the failure only to a handle that holds
@@ -1342,8 +1311,6 @@ export class TestHost {
1342
1311
  * plugin's file resolvers and of {@link TestHost.otherResolvers}, sorted,
1343
1312
  * each once.
1344
1313
  *
1345
- * @capability None.
1346
- *
1347
1314
  * @example Check the file types a resolver adds
1348
1315
  * The test checks the list the plugin will hear in
1349
1316
  * `resolvers.fileTypes`: the extensions of its own file resolvers and of
@@ -1384,7 +1351,7 @@ export class TestHost {
1384
1351
  * declare const host: TestHost;
1385
1352
  * // ---cut---
1386
1353
  * const heard: string[][] = [];
1387
- * // A listener of the event (`events`): each list the player sends.
1354
+ * // A listener of the event: each list the player sends.
1388
1355
  * plugin.player.on("resolvers.fileTypes", ({ fileTypes }) => heard.push(fileTypes));
1389
1356
  * // Another plugin starts with a resolver for .ch8 files.
1390
1357
  * host.otherResolvers.push({ owner: "example.emulator", extensions: ["ch8"] });
@@ -1393,7 +1360,6 @@ export class TestHost {
1393
1360
  * assert.deepEqual(heard, [["ch8"]]);
1394
1361
  * ```
1395
1362
  *
1396
- * @capability None.
1397
1363
  * @since 1.5.8
1398
1364
  */
1399
1365
  updateFileTypes() {
@@ -1507,8 +1473,6 @@ export class TestHost {
1507
1473
  * @param name - The property, as mpv names it.
1508
1474
  * @param value - Its new value.
1509
1475
  *
1510
- * @capability None.
1511
- *
1512
1476
  * @example The frame rate behind the filters changes
1513
1477
  * The plugin's listener hears the value the test gives the property.
1514
1478
  * `setMpvProperty` stores it and sends the `mpv.property` event that
@@ -1728,7 +1692,6 @@ export class TestHost {
1728
1692
  * assert.match(String(host.window("upscale").props.blocker), /Picture Adjustments/);
1729
1693
  * ```
1730
1694
  *
1731
- * @capability None.
1732
1695
  * @since 1.5.43
1733
1696
  */
1734
1697
  upscalingDecoding(cause, plugins = []) {
@@ -1740,8 +1703,6 @@ export class TestHost {
1740
1703
  * plugin listening with `plugin.video.upscaling.onChange` receives it.
1741
1704
  * Nothing reaches a plugin that does not listen.
1742
1705
  *
1743
- * @capability None.
1744
- *
1745
1706
  * @example Show the new factor in the plugin's window
1746
1707
  * The window resized: the test changes the area and the factor, sends
1747
1708
  * the change, and checks that the plugin's window shows the new factor.
@@ -1816,8 +1777,6 @@ export class TestHost {
1816
1777
  * plugin listening with `plugin.video.motion("amd").onChange` receives it.
1817
1778
  * Nothing reaches a plugin that does not listen.
1818
1779
  *
1819
- * @capability None.
1820
- *
1821
1780
  * @example The GPU fell behind
1822
1781
  * The player turned the converter off for this video; the plugin's
1823
1782
  * panel shows the reason.
@@ -1958,9 +1917,9 @@ export class TestHost {
1958
1917
  // ------------------------------------------------------------ built-in only
1959
1918
  /**
1960
1919
  * The plugin is built into the player (`startPlugin`'s `builtin`). Only
1961
- * then does the host take the built-in-only capabilities
1962
- * (`commands.run`, `palette.lead`); otherwise their calls fail with
1963
- * `capability`, as in the player.
1920
+ * then does the host answer the built-in-only requests
1921
+ * (`commands.list`, `commands.run`, `palette.lead.*`); otherwise they
1922
+ * fail with `capability`, as in the player.
1964
1923
  *
1965
1924
  * @since 1.7.9
1966
1925
  */
@@ -2016,7 +1975,6 @@ export class TestHost {
2016
1975
  * await stop();
2017
1976
  * ```
2018
1977
  *
2019
- * @capability None.
2020
1978
  * @throws `Error` without a code (rejects) The plugin has no lead row.
2021
1979
  * @since 1.7.9
2022
1980
  */
@@ -2046,7 +2004,6 @@ export class TestHost {
2046
2004
  * assert.deepEqual(host.coreRuns, ["play-pause"]);
2047
2005
  * ```
2048
2006
  *
2049
- * @capability None.
2050
2007
  * @since 1.0.0
2051
2008
  */
2052
2009
  coreAction(id) {
@@ -2127,7 +2084,6 @@ export class TestHost {
2127
2084
  * host.reset("system.openPath");
2128
2085
  * ```
2129
2086
  *
2130
- * @capability None.
2131
2087
  * @since 1.0.0
2132
2088
  */
2133
2089
  handle(method, handler) {
@@ -2136,8 +2092,6 @@ export class TestHost {
2136
2092
  /**
2137
2093
  * Restore the default behaviour of a method replaced with {@link TestHost.handle}.
2138
2094
  *
2139
- * @capability None.
2140
- *
2141
2095
  * @example Restore the default answer after a simulated failure
2142
2096
  * The first write fails, the second succeeds. `reset` removes the handler
2143
2097
  * that `handle` installed, so the method is answered by the test host
@@ -2163,14 +2117,12 @@ export class TestHost {
2163
2117
  * Deliver a host event to the plugin. Like the player, subscription-based
2164
2118
  * events (`source.state`, `playback.backend`, `window.state`,
2165
2119
  * `timeline.changed`, `appearance.changed`) are delivered only when the
2166
- * plugin subscribed (it declared `events` and listens). Most tests use the
2120
+ * plugin subscribed (it called `plugin.player.subscribe()` and listens). Most tests use the
2167
2121
  * higher-level helpers (`setSource`, `setMainWindow`, ...) instead.
2168
2122
  *
2169
2123
  * @param event - The wire event name.
2170
2124
  * @param data - The event payload (wire-level shape).
2171
2125
  *
2172
- * @capability None.
2173
- *
2174
2126
  * @example Deliver a raw event the helpers do not cover
2175
2127
  * The test pushes a `window.state` event after changing `layout` by hand.
2176
2128
  * Like the player, the host delivers it only when the plugin subscribed;
@@ -2219,7 +2171,6 @@ export class TestHost {
2219
2171
  * await host.settle();
2220
2172
  * ```
2221
2173
  *
2222
- * @capability None.
2223
2174
  * @since 1.0.0
2224
2175
  */
2225
2176
  setSource(patch) {
@@ -2254,7 +2205,6 @@ export class TestHost {
2254
2205
  * assert.equal(plugin.window.state.maximized, true);
2255
2206
  * ```
2256
2207
  *
2257
- * @capability None.
2258
2208
  * @since 1.0.0
2259
2209
  */
2260
2210
  setMainWindow(patch) {
@@ -2266,8 +2216,6 @@ export class TestHost {
2266
2216
  * those switched on, pop out or collapse (reference §6.3). No effect outside
2267
2217
  * fullscreen, or on a column switched off or floating.
2268
2218
  *
2269
- * @capability None.
2270
- *
2271
2219
  * @example Pop the sidebar out in fullscreen
2272
2220
  * The pointer reaches the right edge in fullscreen and the attached
2273
2221
  * sidebar pops out over the video. Outside fullscreen, or with the
@@ -2317,7 +2265,6 @@ export class TestHost {
2317
2265
  * assert.equal(plugin.player.isCurrent(before), false);
2318
2266
  * ```
2319
2267
  *
2320
- * @capability None.
2321
2268
  * @since 1.0.0
2322
2269
  */
2323
2270
  openElsewhere(source, phase = "ready") {
@@ -2351,7 +2298,6 @@ export class TestHost {
2351
2298
  * host.failStream(producer!.id, "producer transport closed");
2352
2299
  * ```
2353
2300
  *
2354
- * @capability None.
2355
2301
  * @since 1.5.7
2356
2302
  */
2357
2303
  failStream(producerId, message) {
@@ -2387,7 +2333,6 @@ export class TestHost {
2387
2333
  * await host.press("Delete", { panel: true }); // while the panel has focus
2388
2334
  * ```
2389
2335
  *
2390
- * @capability None.
2391
2336
  * @throws `command` (rejects) A `HostError`: the command that would run is
2392
2337
  * busy (the player only logs this).
2393
2338
  * @throws `Error` (rejects) Nothing is bound to the key.
@@ -2440,7 +2385,6 @@ export class TestHost {
2440
2385
  * assert.equal(host.window("picture").props["brightness-down"], "⇧W");
2441
2386
  * ```
2442
2387
  *
2443
- * @capability None.
2444
2388
  * @throws `Error` `command` is neither a command of the plugin nor a
2445
2389
  * core command.
2446
2390
  * @since 1.6.6
@@ -2493,7 +2437,7 @@ export class TestHost {
2493
2437
  * // ---cut---
2494
2438
  * host.candidates.set("/downloads/someone.demo-1.0.0.vxp", {
2495
2439
  * id: "someone.demo", version: "1.0.0", apiVersion: "vestra/1",
2496
- * entry: "main.js", capabilities: [],
2440
+ * entry: "main.js",
2497
2441
  * });
2498
2442
  * ```
2499
2443
  */
@@ -2515,7 +2459,6 @@ export class TestHost {
2515
2459
  * host.installKeepsDisabled = false; // every install runs
2516
2460
  * ```
2517
2461
  *
2518
- * @capability None.
2519
2462
  * @since 1.5.55
2520
2463
  */
2521
2464
  installKeepsDisabled = true;
@@ -2544,7 +2487,6 @@ export class TestHost {
2544
2487
  * assert.equal(host.markdown(rows[0]!.body)?.text, "**Hello**");
2545
2488
  * ```
2546
2489
  *
2547
- * @capability None.
2548
2490
  * @since 1.1.0
2549
2491
  */
2550
2492
  markdown(value) {
@@ -2563,8 +2505,6 @@ export class TestHost {
2563
2505
  * Replace the plugin list and push `packages.changed` (another plugin
2564
2506
  * started, stopped, was installed or removed).
2565
2507
  *
2566
- * @capability None.
2567
- *
2568
2508
  * @example Simulate another plugin starting
2569
2509
  * The plugin's store window hears that a plugin is running now. The list
2570
2510
  * replaces `packages` and is pushed as `packages.changed`, which the
@@ -2587,7 +2527,6 @@ export class TestHost {
2587
2527
  * asks this plugin's sequence provider. Rejects with `unavailable` when
2588
2528
  * there is no provider or its flag is false.
2589
2529
  *
2590
- * @capability None.
2591
2530
  * @throws `unavailable` (rejects) A `HostError`: there is no sequence
2592
2531
  * provider, or its flag is false.
2593
2532
  *
@@ -2613,8 +2552,6 @@ export class TestHost {
2613
2552
  * The plugin's command with this local id. Throws when it is not
2614
2553
  * registered (never added, or disposed).
2615
2554
  *
2616
- * @capability None.
2617
- *
2618
2555
  * @example Read a command's state after a change
2619
2556
  * The test checks that Export becomes enabled once a file is ready. The
2620
2557
  * record is updated as the plugin sends new state; read it after
@@ -2683,7 +2620,6 @@ export class TestHost {
2683
2620
  * assert.equal(host.window("picture").props["brightness"], 0);
2684
2621
  * ```
2685
2622
  *
2686
- * @capability None.
2687
2623
  * @since 1.0.0
2688
2624
  */
2689
2625
  window(id) {
@@ -2713,7 +2649,6 @@ export class TestHost {
2713
2649
  * await host.settle();
2714
2650
  * ```
2715
2651
  *
2716
- * @capability None.
2717
2652
  * @since 1.0.0
2718
2653
  */
2719
2654
  mounted(slot) {
@@ -2733,7 +2668,6 @@ export class TestHost {
2733
2668
  * assert.deepEqual(host.sent("osd.show").at(-1), { text: "Saved" });
2734
2669
  * ```
2735
2670
  *
2736
- * @capability None.
2737
2671
  * @since 1.0.0
2738
2672
  */
2739
2673
  sent(method) {
@@ -2792,7 +2726,6 @@ export class TestHost {
2792
2726
  * assert.equal(importWindow.props["status-text"], expected);
2793
2727
  * ```
2794
2728
  *
2795
- * @capability None.
2796
2729
  * @throws Never.
2797
2730
  * @since 1.0.0
2798
2731
  */
@@ -2806,8 +2739,6 @@ export class TestHost {
2806
2739
  * `ENOTEMPTY`, `EBUSY`, `EPERM`) is retried for about 1.5 s, then left
2807
2740
  * for the system to clean, with a warning on the console.
2808
2741
  *
2809
- * @capability None.
2810
- *
2811
2742
  * @example Clean up a host that was never started
2812
2743
  * A test that made a host but failed before `startPlugin` removes the
2813
2744
  * host's temporary directories itself. `stop()` from `startPlugin` calls
@@ -2840,7 +2771,6 @@ export class TestHost {
2840
2771
  * and start it again on its next use. Filter chains, streams, jobs and the
2841
2772
  * like (which also keep a plugin running) are not listed.
2842
2773
  *
2843
- * @capability None.
2844
2774
  * @since 1.5.40
2845
2775
  *
2846
2776
  * @example Check that a plugin can be stopped while idle
@@ -2880,18 +2810,16 @@ export class TestHost {
2880
2810
  * registration started during activation (commands, panels, resolvers, ...),
2881
2811
  * then wait until the host is idle.
2882
2812
  *
2883
- * The manifest id and capabilities come from `directory/manifest.json`
2884
- * unless `capabilities` is given; then `id` (default `"test.plugin"`) and
2885
- * `capabilities` are used and no manifest is read. The test host does not
2886
- * apply the player's capability table to every request: the members that
2887
- * check a capability on the plugin's side (`plugin.media.sources` and its
2888
- * `open`, which also needs `playback.control`, `plugin.secrets`, timeline
2889
- * marks, video shaders and views, among others) fail with `capability` as in
2890
- * the player, but a call the player refuses for an undeclared capability can
2891
- * succeed here. `vestra-plugin check` (and the TypeScript plugin) reports
2892
- * those calls from the sources.
2813
+ * The manifest id comes from `directory/manifest.json` unless `id` is
2814
+ * given; then no manifest is read (and without `directory` none is read
2815
+ * either: the id is `"test.plugin"`). Nothing in the manifest changes how
2816
+ * the plugin runs: event delivery and the start-up reads are the plugin's
2817
+ * own calls (`plugin.player.subscribe()`, `plugin.player.read()`), as in
2818
+ * the player.
2893
2819
  *
2894
- * Rejects when `manifest.json` cannot be read or parsed, when `activate`
2820
+ * Rejects when `manifest.json` cannot be read or parsed, when it still has
2821
+ * `capabilities` (removed in 1.9.0; the message says what to call
2822
+ * instead), when `activate`
2895
2823
  * throws, or when a registration made during activation fails (for example
2896
2824
  * `limit`, `conflict`, `invalid`). Stricter than the player's runner for
2897
2825
  * commands: there the SDK logs a command declaration the player refuses during
@@ -2953,7 +2881,6 @@ export class TestHost {
2953
2881
  * player's runner does and returns the host to drive, the `plugin` object
2954
2882
  * to call directly, and `stop` to end it like the player.
2955
2883
  *
2956
- * @capability None.
2957
2884
  * @see [Test a plugin](../../../docs/guides/testing.md)
2958
2885
  * @since 1.0.0
2959
2886
  * @category Testing
@@ -2965,16 +2892,15 @@ export async function startPlugin(activate, options = {}) {
2965
2892
  const directory = options.directory instanceof URL
2966
2893
  ? fileURLToPath(options.directory)
2967
2894
  : (options.directory ?? process.cwd());
2968
- let manifest = {
2969
- id: options.id ?? "test.plugin",
2970
- capabilities: options.capabilities ?? [],
2971
- };
2972
- if (options.directory && !options.capabilities) {
2895
+ let manifest = { id: options.id ?? "test.plugin" };
2896
+ if (options.directory && options.id === undefined) {
2973
2897
  const read = JSON.parse(readFileSync(join(directory, "manifest.json"), "utf8"));
2974
- manifest = { id: read.id, capabilities: read.capabilities };
2898
+ // As `vestra-plugin check` and the player: the field is gone.
2899
+ if (read && typeof read === "object" && "capabilities" in read)
2900
+ throw new Error(CAPABILITIES_REMOVED);
2901
+ manifest = { id: read.id };
2975
2902
  }
2976
2903
  host.manifestId = manifest.id;
2977
- pluginCapabilities.set(host, manifest.capabilities);
2978
2904
  if (options.builtin)
2979
2905
  host.builtin = true;
2980
2906
  host.loadCatalog(directory);
@@ -423,7 +423,7 @@ export function processingHandlers(host, inner) {
423
423
  host.setVideoRenderOwner(null);
424
424
  return null;
425
425
  },
426
- // The player's capability layer and `video_shaders.rs`.
426
+ // The player's request layer and `video_shaders.rs`.
427
427
  "video.shaders.set": (p) => {
428
428
  const idProblem = shaderIdProblem(p.id);
429
429
  if (idProblem)
@@ -436,7 +436,6 @@ export function servicesHandlers(host, inner) {
436
436
  origin: "installed",
437
437
  state: enabled ? "running" : "disabled",
438
438
  error: null,
439
- capabilities: [...manifest.capabilities],
440
439
  directory: `/test-host/packages/${manifest.id}`,
441
440
  builtin: false,
442
441
  source,
@@ -39,8 +39,8 @@ export declare const TIMELINE_LIMITS: Readonly<{
39
39
  readonly titleChars: 100;
40
40
  }>;
41
41
  /**
42
- * One per plugin: read before activation (with `playback.read`), then kept
43
- * current from `timeline.changed` (with `events`) once the plugin uses it
42
+ * One per plugin: read by `plugin.player.read()`, then kept
43
+ * current from `timeline.changed` (after `plugin.player.subscribe()`) once the plugin uses it
44
44
  * (or listens to that event with `player.on`).
45
45
  */
46
46
  export declare class TimelineService {
@@ -49,7 +49,6 @@ export declare class TimelineService {
49
49
  ranges: readonly TimelineRange[];
50
50
  layer: boolean;
51
51
  constructor(runtime: Runtime);
52
- init(): Promise<void>;
53
52
  start(): void;
54
53
  accept(lists: WireTimeline): void;
55
54
  read(): Promise<void>;
@@ -51,8 +51,8 @@ const viewRanges = (ranges) => Object.freeze(ranges.map((range) => Object.freeze
51
51
  plugin: range.plugin,
52
52
  })));
53
53
  /**
54
- * One per plugin: read before activation (with `playback.read`), then kept
55
- * current from `timeline.changed` (with `events`) once the plugin uses it
54
+ * One per plugin: read by `plugin.player.read()`, then kept
55
+ * current from `timeline.changed` (after `plugin.player.subscribe()`) once the plugin uses it
56
56
  * (or listens to that event with `player.on`).
57
57
  */
58
58
  export class TimelineService {
@@ -63,10 +63,8 @@ export class TimelineService {
63
63
  layer = false;
64
64
  constructor(runtime) {
65
65
  this.#runtime = runtime;
66
- }
67
- async init() {
68
- if (this.#runtime.can("playback.read"))
69
- await this.read();
66
+ // `plugin.player.read()` reads the lists through the connection.
67
+ runtime.rereads.set("timeline.changed", () => this.read());
70
68
  }
71
69
  start() {
72
70
  if (this.#started)
@@ -119,8 +117,6 @@ export function timeline(scope) {
119
117
  layer() {
120
118
  if (service().layer)
121
119
  throw new Error("a plugin has one timeline layer; reuse it");
122
- if (!scope.runtime.can("timeline.marks"))
123
- throw failure("capability", "timeline.marks must be declared in manifest");
124
120
  service().layer = true;
125
121
  return new Layer(scope);
126
122
  },