@vestra-player/sdk 1.8.0 → 1.10.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 (106) hide show
  1. package/CHANGELOG.md +64 -2
  2. package/README.md +2 -2
  3. package/bin/vestra-plugin.mjs +98 -106
  4. package/capability-scan.json +21 -1
  5. package/dist/api-requests.d.ts +15 -39
  6. package/dist/api-requests.js +28 -50
  7. package/dist/capability-scan.d.ts +1 -1
  8. package/dist/capability-scan.js +8 -9
  9. package/dist/condition-table.d.ts +1889 -0
  10. package/dist/condition-table.js +562 -0
  11. package/dist/docs-tree.json.gz +0 -0
  12. package/dist/docs.d.ts +1 -1
  13. package/dist/docs.js +1 -1
  14. package/dist/i18n-tools.d.ts +7 -0
  15. package/dist/i18n-tools.js +66 -3
  16. package/dist/index.d.ts +4 -5
  17. package/dist/manifest.d.ts +5 -0
  18. package/dist/manifest.js +9 -24
  19. package/dist/member-uses.d.ts +61 -0
  20. package/dist/member-uses.js +160 -0
  21. package/dist/player-runtime.d.ts +4 -2
  22. package/dist/player-runtime.js +4 -2
  23. package/dist/plugin/appearance.d.ts +1 -1
  24. package/dist/plugin/appearance.js +2 -2
  25. package/dist/plugin/bindings.d.ts +1 -1
  26. package/dist/plugin/bindings.js +2 -2
  27. package/dist/plugin/commands.js +1 -12
  28. package/dist/plugin/connection.d.ts +38 -8
  29. package/dist/plugin/connection.js +126 -37
  30. package/dist/plugin/drops.js +1 -1
  31. package/dist/plugin/index.d.ts +7 -0
  32. package/dist/plugin/index.js +22 -15
  33. package/dist/plugin/media.js +0 -12
  34. package/dist/plugin/mpv.js +39 -12
  35. package/dist/plugin/packages.js +1 -2
  36. package/dist/plugin/player/events.d.ts +17 -7
  37. package/dist/plugin/player/events.js +26 -9
  38. package/dist/plugin/player.d.ts +37 -13
  39. package/dist/plugin/player.js +133 -22
  40. package/dist/plugin/scope.d.ts +4 -1
  41. package/dist/plugin/scope.js +8 -0
  42. package/dist/plugin/services.d.ts +4 -4
  43. package/dist/plugin/services.js +7 -29
  44. package/dist/plugin/settings.js +1 -1
  45. package/dist/plugin/shaders.js +0 -2
  46. package/dist/plugin/stream.d.ts +2 -1
  47. package/dist/plugin/stream.js +2 -2
  48. package/dist/plugin/testing/commands.d.ts +3 -10
  49. package/dist/plugin/testing/commands.js +24 -37
  50. package/dist/plugin/testing/index.d.ts +133 -116
  51. package/dist/plugin/testing/index.js +198 -125
  52. package/dist/plugin/testing/media.d.ts +6 -0
  53. package/dist/plugin/testing/media.js +15 -2
  54. package/dist/plugin/testing/processing.js +1 -1
  55. package/dist/plugin/testing/services.js +0 -1
  56. package/dist/plugin/testing/source-events.d.ts +28 -0
  57. package/dist/plugin/testing/source-events.js +66 -0
  58. package/dist/plugin/testing/transport.js +5 -0
  59. package/dist/plugin/testing/triggers.d.ts +82 -0
  60. package/dist/plugin/testing/triggers.js +448 -0
  61. package/dist/plugin/timeline.d.ts +5 -6
  62. package/dist/plugin/timeline.js +7 -11
  63. package/dist/plugin/triggers.d.ts +55 -0
  64. package/dist/plugin/triggers.js +233 -0
  65. package/dist/plugin/types/base.d.ts +77 -87
  66. package/dist/plugin/types/commands.d.ts +384 -68
  67. package/dist/plugin/types/packages.d.ts +17 -55
  68. package/dist/plugin/types/playback.d.ts +382 -152
  69. package/dist/plugin/types/plugin-wire.d.ts +6 -36
  70. package/dist/plugin/types/processing.d.ts +10 -49
  71. package/dist/plugin/types/services.d.ts +11 -70
  72. package/dist/plugin/types/snapshots.d.ts +7 -60
  73. package/dist/plugin/types/sources.d.ts +2 -11
  74. package/dist/plugin/types/subtitles.d.ts +5 -26
  75. package/dist/plugin/types/ui-content.d.ts +1 -16
  76. package/dist/plugin/types/ui-layout.d.ts +53 -79
  77. package/dist/plugin/types/ui-locale.d.ts +5 -23
  78. package/dist/plugin/types/ui-shell.d.ts +13 -59
  79. package/dist/plugin/view/layout.js +1 -1
  80. package/dist/plugin/view.js +0 -2
  81. package/dist/plugin/when.d.ts +78 -4
  82. package/dist/plugin/when.js +182 -14
  83. package/dist/plugin/window.d.ts +1 -1
  84. package/dist/plugin/window.js +1 -1
  85. package/dist/plugin/wire-facade.js +1 -2
  86. package/dist/processing.d.ts +2 -3
  87. package/dist/protocol.d.ts +14 -0
  88. package/dist/protocol.js +14 -0
  89. package/dist/request-queue.js +1 -1
  90. package/dist/slint-version.d.ts +7 -0
  91. package/dist/slint-version.js +7 -0
  92. package/dist/subtitles.d.ts +1 -1
  93. package/dist/ts-plugin.d.ts +8 -15
  94. package/dist/ts-plugin.js +3 -141
  95. package/dist/wire.d.ts +22 -12
  96. package/dist/wire.js +17 -8
  97. package/llms.txt +6 -6
  98. package/package.json +1 -2
  99. package/dist/capabilities.d.ts +0 -107
  100. package/dist/capabilities.js +0 -69
  101. package/dist/capability-check.d.ts +0 -176
  102. package/dist/capability-check.js +0 -461
  103. package/dist/capability-rules.d.ts +0 -125
  104. package/dist/capability-rules.js +0 -192
  105. package/dist/host-capabilities.d.ts +0 -10
  106. package/dist/host-capabilities.js +0 -492
@@ -4,8 +4,7 @@ import type { PackageManifest, PackageSource } from "../types.ts";
4
4
  import type { Json, LayoutSlot, LocalServices, PlaybackStats, Transport, WireSystemInfo } from "../../wire.ts";
5
5
  import { BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS, BUILTIN_COMMANDS, BUILTIN_SUBMENUS, COMMAND_LIMITS, MENU_IDS } from "../../commands.ts";
6
6
  import type { BuiltinCommand, BuiltinSubmenu } from "../../commands.ts";
7
- import { CAPABILITY_INFO, MESSAGE_LIMIT } from "../../capabilities.ts";
8
- import type { CapabilityInfo } from "../../capabilities.ts";
7
+ import { MESSAGE_LIMIT } from "../../protocol.ts";
9
8
  import { OSD_LIMITS } from "../osd.ts";
10
9
  import { TIMELINE_LIMITS } from "../timeline.ts";
11
10
  import { SECRET_LIMITS, SESSION_STORAGE_LIMITS } from "../services.ts";
@@ -21,8 +20,13 @@ import type { MotionMode, MotionReason, RenderingMode, RenderingPreference, Rend
21
20
  import type { MediaJob } from "../../media.ts";
22
21
  import type { LanguagePreference, Locale, Plugin, StopReason, TemplateArgs, TextValue, ThemeId } from "../types.ts";
23
22
  import { LOCALES, LIST_SEPARATORS, TEXT_LIMITS } from "../../i18n.ts";
23
+ import type { KeptTrigger } from "./triggers.ts";
24
+ import { TRIGGER_LIMITS } from "../triggers.ts";
24
25
  /** Throw one of these from `host.handle(...)` to simulate a definite refusal. */
25
26
  export { HostError };
27
+ /** The player's limits on triggers (1.10.0), which the test host enforces as well. */
28
+ export { TRIGGER_LIMITS };
29
+ export type { KeptTrigger };
26
30
  /** The player's command caps, which the test host enforces as well. */
27
31
  export { COMMAND_LIMITS, MENU_IDS };
28
32
  /** The icons and limits of bottom-bar buttons, which the test host checks as well. */
@@ -30,9 +34,6 @@ export { BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS };
30
34
  /** The submenus of the player's built-in plugins, by key path. */
31
35
  export { BUILTIN_COMMANDS, BUILTIN_SUBMENUS };
32
36
  export type { BuiltinCommand, BuiltinSubmenu };
33
- /** The manifest capabilities: what each opens and how the store shows it. */
34
- export { CAPABILITY_INFO };
35
- export type { CapabilityInfo };
36
37
  /** The longest message a plugin may send the player. */
37
38
  export { MESSAGE_LIMIT };
38
39
  /** The player's limits on the on-screen display. */
@@ -132,7 +133,6 @@ type Call = {
132
133
  * callback the way the user's input would; `userClose` closes it the way
133
134
  * the title-bar button would.
134
135
  *
135
- * @capability None.
136
136
  * @since 1.0.0
137
137
  * @category Testing
138
138
  */
@@ -154,8 +154,6 @@ export interface FakeWindow {
154
154
  * name may be kebab-case or camelCase; `args` are the callback arguments.
155
155
  * Follow it with `await host.settle()` before asserting.
156
156
  *
157
- * @capability None.
158
- *
159
157
  * @example Type into a window's search field
160
158
  * The test types "cat" into the window's search box and checks the
161
159
  * plugin's results. `emit` delivers the Slint callback `search-changed`
@@ -179,8 +177,6 @@ export interface FakeWindow {
179
177
  * and the plugin's `window.onClose` listeners run (unlike the plugin's own
180
178
  * `close()`).
181
179
  *
182
- * @capability None.
183
- *
184
180
  * @example Close a window the way the user does
185
181
  * The test closes the plugin's window with its title-bar button and checks
186
182
  * that the plugin stopped its timer. Unlike the plugin's own `close()`,
@@ -241,7 +237,6 @@ export interface FileDialogText {
241
237
  * Read it again after `settle()` to see changes; `run` executes it as the
242
238
  * menu would.
243
239
  *
244
- * @capability None.
245
240
  * @since 1.0.0
246
241
  * @category Testing
247
242
  */
@@ -322,7 +317,6 @@ export interface FakeCommand {
322
317
  * idle. Rejects (with a {@link HostError}) when the command is disabled or
323
318
  * busy, like the player, which does not call `run` then.
324
319
  *
325
- * @capability None.
326
320
  * @throws `command` (rejects) A `HostError`: the command is disabled or
327
321
  * busy (the message says which).
328
322
  *
@@ -353,8 +347,6 @@ export interface FakeCommand {
353
347
  * the command is enabled and not busy, accent-coloured while checked, with
354
348
  * the command's title (and reason) as the tooltip.
355
349
  *
356
- * @capability None.
357
- *
358
350
  * @example Check a bar button's tooltip while it is disabled
359
351
  * The test checks that the Export button shows why it cannot be clicked.
360
352
  * The tooltip is the command's title; while the command is disabled or
@@ -393,7 +385,6 @@ export interface FakeBarButton {
393
385
  * as its menu item would. Rejects (with a {@link HostError}) while the
394
386
  * button is disabled, and once the command is gone.
395
387
  *
396
- * @capability None.
397
388
  * @throws `command` (rejects) A `HostError`: the command is disabled or
398
389
  * busy.
399
390
  * @throws `missing` (rejects) A `HostError`: the command is gone.
@@ -424,8 +415,6 @@ export interface FakeBarButton {
424
415
  * plugin released it or the player retired it. Tests assert on it; nothing
425
416
  * is played.
426
417
  *
427
- * @capability None.
428
- *
429
418
  * @example Check that the stream delivers frames
430
419
  * The test starts the plugin's generator and checks that video and audio
431
420
  * arrive. The counters grow as the SDK pulls frames and sends them over
@@ -499,7 +488,6 @@ export interface MarkdownWire {
499
488
  * const panel: FakePanel = host.mounted("adjust");
500
489
  * assert.deepEqual(panel.locks, { focused: false, dragging: true, popupOpen: false });
501
490
  * ```n *
502
- * @capability None.
503
491
  * @since 1.6.15
504
492
  * @category Testing
505
493
  */
@@ -585,7 +573,6 @@ export type FakePanel = Omit<FakeWindow, "callbacks" | "userClose"> & {
585
573
  * {@link startPlugin}, drive it, `settle()`, and assert on what it
586
574
  * recorded.
587
575
  *
588
- * @capability None.
589
576
  * @see [Test a plugin](../../../docs/guides/testing.md)
590
577
  * @since 1.0.0
591
578
  * @category Testing
@@ -597,7 +584,7 @@ export declare class TestHost implements Transport {
597
584
  * Wire-level; prefer {@link TestHost.sent} for one method.
598
585
  */
599
586
  readonly calls: Call[];
600
- /** The host events the plugin subscribed to (needs `events` etc.). */
587
+ /** The host events the plugin subscribed to. */
601
588
  readonly subscriptions: Set<string>;
602
589
  /**
603
590
  * The subscribed events the plugin really listens to: an `onChange` and
@@ -719,7 +706,6 @@ export declare class TestHost implements Transport {
719
706
  * await host.pressOsdAction(0); // runs the plugin's `reveal` command
720
707
  * ```
721
708
  *
722
- * @capability None.
723
709
  * @since 1.6.9
724
710
  */
725
711
  pressOsdAction(index: number): Promise<void>;
@@ -768,8 +754,6 @@ export declare class TestHost implements Transport {
768
754
  * @param directory - The package directory (holding `locales/`).
769
755
  * @since 1.5.9
770
756
  *
771
- * @capability None.
772
- *
773
757
  * @example Load the translations after changing the language
774
758
  * The test switches the host to German before starting the plugin and
775
759
  * loads that catalog itself (`startPlugin` does the same). Texts are then
@@ -804,8 +788,6 @@ export declare class TestHost implements Transport {
804
788
  * ```
805
789
  *
806
790
  * @since 1.5.9
807
- *
808
- * @capability None.
809
791
  */
810
792
  translate(text: TextValue, args?: TemplateArgs): string;
811
793
  /**
@@ -822,11 +804,9 @@ export declare class TestHost implements Transport {
822
804
  * @param language - `"system"` or a locale.
823
805
  * @since 1.5.9
824
806
  *
825
- * @capability None.
826
- *
827
807
  * @example Simulate the user choosing French for the next start
828
808
  * The plugin hears that the saved interface language changed. The host
829
- * pushes `appearance.changed`, which a plugin with `events` sees in
809
+ * pushes `appearance.changed`, which a plugin sees (after `plugin.player.subscribe()`) in
830
810
  * `appearance.language` once it has read it and subscribed; this run's
831
811
  * language does not change.
832
812
  * ```ts
@@ -1072,7 +1052,6 @@ export declare class TestHost implements Transport {
1072
1052
  * assert.equal(plugin.timeline.ranges[0]?.plugin, "community.clips");
1073
1053
  * ```
1074
1054
  *
1075
- * @capability None.
1076
1055
  * @since 1.6.9
1077
1056
  */
1078
1057
  setTimelineRanges(pluginId: string, ranges: {
@@ -1091,8 +1070,8 @@ export declare class TestHost implements Transport {
1091
1070
  * @example Let another plugin publish chapters
1092
1071
  * The plugin under test sees two chapter marks another plugin put on the
1093
1072
  * timeline. `setTimelineLayer` stores that plugin's whole layer and pushes
1094
- * `timeline.changed`; once the plugin uses `plugin.timeline` (with
1095
- * `events`) the SDK keeps `marks` current from that event, and `settle()`
1073
+ * `timeline.changed`; once the plugin uses `plugin.timeline` (after
1074
+ * `plugin.player.subscribe()`) the SDK keeps `marks` current from that event, and `settle()`
1096
1075
  * lets it arrive.
1097
1076
  * ```ts
1098
1077
  * import assert from "node:assert/strict";
@@ -1106,7 +1085,6 @@ export declare class TestHost implements Transport {
1106
1085
  * assert.equal(plugin.timeline.marks.length, 2);
1107
1086
  * ```
1108
1087
  *
1109
- * @capability None.
1110
1088
  * @since 1.0.0
1111
1089
  */
1112
1090
  setTimelineLayer(pluginId: string, marks: {
@@ -1149,7 +1127,6 @@ export declare class TestHost implements Transport {
1149
1127
  * );
1150
1128
  * ```
1151
1129
  *
1152
- * @capability None.
1153
1130
  * @since 1.0.0
1154
1131
  */
1155
1132
  imagePath(value: Json | undefined): string | null;
@@ -1192,7 +1169,6 @@ export declare class TestHost implements Transport {
1192
1169
  * });
1193
1170
  * ```
1194
1171
  *
1195
- * @capability None.
1196
1172
  * @throws Never: files nobody takes are ignored, as in the player.
1197
1173
  * @since 1.0.0
1198
1174
  */
@@ -1214,17 +1190,15 @@ export declare class TestHost implements Transport {
1214
1190
  * Simulate another plugin switching the palette: updates
1215
1191
  * {@link TestHost.appearance} and pushes `appearance.changed`.
1216
1192
  *
1217
- * @capability None.
1218
- *
1219
1193
  * @example Simulate another plugin switching to the light palette
1220
1194
  * The plugin hears the palette change. The host updates `appearance` and
1221
- * pushes `appearance.changed` to a plugin that listens with `events`.
1195
+ * pushes `appearance.changed` to a plugin that listens (after `plugin.player.subscribe()`).
1222
1196
  * ```ts
1223
1197
  * import assert from "node:assert/strict";
1224
1198
  * declare const host: TestHost;
1225
1199
  * // ---cut---
1226
1200
  * const themes: string[] = [];
1227
- * plugin.player.on("appearance.changed", ({ theme }) => themes.push(theme)); // subscribes (`events`)
1201
+ * plugin.player.on("appearance.changed", ({ theme }) => themes.push(theme)); // subscribes
1228
1202
  * host.setAppearance("vestra-light");
1229
1203
  * await host.settle();
1230
1204
  * assert.deepEqual(themes, ["vestra-light"]);
@@ -1282,7 +1256,6 @@ export declare class TestHost implements Transport {
1282
1256
  * assert.equal(page.props["step"], 10);
1283
1257
  * ```
1284
1258
  *
1285
- * @capability None.
1286
1259
  * @since 1.0.0
1287
1260
  */
1288
1261
  settingsPage(id: string): {
@@ -1314,8 +1287,6 @@ export declare class TestHost implements Transport {
1314
1287
  * Simulate the backdrop's `effective` changing (`false`: a video frame
1315
1288
  * appeared; `true`: there is none again); pushed to the plugin.
1316
1289
  *
1317
- * @capability None.
1318
- *
1319
1290
  * @example Make a video picture replace the backdrop
1320
1291
  * The plugin's backdrop hears that a video frame now covers it. `false`
1321
1292
  * means a picture appeared; the change is pushed like the player's
@@ -1362,8 +1333,6 @@ export declare class TestHost implements Transport {
1362
1333
  * ```
1363
1334
  *
1364
1335
  * @since 1.5.2
1365
- *
1366
- * @capability None.
1367
1336
  */
1368
1337
  mountOther(slot: "bottom" | "sidebar" | "adjust" | "backdrop", plugin: string, options?: {
1369
1338
  title?: string;
@@ -1374,8 +1343,6 @@ export declare class TestHost implements Transport {
1374
1343
  *
1375
1344
  * @since 1.5.2
1376
1345
  *
1377
- * @capability None.
1378
- *
1379
1346
  * @example Let the playlist's tab go away
1380
1347
  * The other plugin's sidebar tab disappears and the plugin's own tab
1381
1348
  * becomes current. When the removed tab was current, the next tab (else
@@ -1397,8 +1364,6 @@ export declare class TestHost implements Transport {
1397
1364
  *
1398
1365
  * @since 1.5.2
1399
1366
  *
1400
- * @capability None.
1401
- *
1402
1367
  * @example Click another plugin's sidebar tab
1403
1368
  * The user switches the sidebar to the playlist; the plugin's panel is in
1404
1369
  * a background tab now. The change is pushed as `window.state`.
@@ -1427,8 +1392,6 @@ export declare class TestHost implements Transport {
1427
1392
  * `video.view()` then fails with `conflict`), or, with `null`, releasing
1428
1393
  * it (values reset to the defaults).
1429
1394
  *
1430
- * @capability None.
1431
- *
1432
1395
  * @example Let another plugin own the display layer
1433
1396
  * The plugin's `video.view()` fails with `conflict` because another plugin
1434
1397
  * took the display layer first. `null` releases it again.
@@ -1467,8 +1430,6 @@ export declare class TestHost implements Transport {
1467
1430
  * `video.render()` then fails with `conflict`), or, with `null`, releasing
1468
1431
  * them (values reset to the defaults).
1469
1432
  *
1470
- * @capability None.
1471
- *
1472
1433
  * @example Let another plugin own the render options
1473
1434
  * The plugin's render options report `conflict` while another plugin owns
1474
1435
  * them; `null` releases them and resets the values to the defaults.
@@ -1512,7 +1473,6 @@ export declare class TestHost implements Transport {
1512
1473
  * assert.equal(render.status.state, "failed");
1513
1474
  * ```
1514
1475
  *
1515
- * @capability None.
1516
1476
  * @since 1.0.0
1517
1477
  */
1518
1478
  failVideoRender(code: "failed" | "unsupported" | "previous-crash", message: string): void;
@@ -1553,8 +1513,6 @@ export declare class TestHost implements Transport {
1553
1513
  * player never pushes it, it refuses the `set` request itself after
1554
1514
  * an abnormal end. To test that, set {@link TestHost.previousCrash}.
1555
1515
  *
1556
- * @capability None.
1557
- *
1558
1516
  * @example Make the plugin's shader fail to compile
1559
1517
  * The plugin's shader handle reports `failed`, as when mpv rejects a
1560
1518
  * shader. The host pushes the failure only to a handle that holds
@@ -1858,8 +1816,6 @@ export declare class TestHost implements Transport {
1858
1816
  * plugin's file resolvers and of {@link TestHost.otherResolvers}, sorted,
1859
1817
  * each once.
1860
1818
  *
1861
- * @capability None.
1862
- *
1863
1819
  * @example Check the file types a resolver adds
1864
1820
  * The test checks the list the plugin will hear in
1865
1821
  * `resolvers.fileTypes`: the extensions of its own file resolvers and of
@@ -1891,7 +1847,7 @@ export declare class TestHost implements Transport {
1891
1847
  * declare const host: TestHost;
1892
1848
  * // ---cut---
1893
1849
  * const heard: string[][] = [];
1894
- * // A listener of the event (`events`): each list the player sends.
1850
+ * // A listener of the event: each list the player sends.
1895
1851
  * plugin.player.on("resolvers.fileTypes", ({ fileTypes }) => heard.push(fileTypes));
1896
1852
  * // Another plugin starts with a resolver for .ch8 files.
1897
1853
  * host.otherResolvers.push({ owner: "example.emulator", extensions: ["ch8"] });
@@ -1900,7 +1856,6 @@ export declare class TestHost implements Transport {
1900
1856
  * assert.deepEqual(heard, [["ch8"]]);
1901
1857
  * ```
1902
1858
  *
1903
- * @capability None.
1904
1859
  * @since 1.5.8
1905
1860
  */
1906
1861
  updateFileTypes(): void;
@@ -2020,8 +1975,6 @@ export declare class TestHost implements Transport {
2020
1975
  * @param name - The property, as mpv names it.
2021
1976
  * @param value - Its new value.
2022
1977
  *
2023
- * @capability None.
2024
- *
2025
1978
  * @example The frame rate behind the filters changes
2026
1979
  * The plugin's listener hears the value the test gives the property.
2027
1980
  * `setMpvProperty` stores it and sends the `mpv.property` event that
@@ -2247,7 +2200,6 @@ export declare class TestHost implements Transport {
2247
2200
  * assert.match(String(host.window("upscale").props.blocker), /Picture Adjustments/);
2248
2201
  * ```
2249
2202
  *
2250
- * @capability None.
2251
2203
  * @since 1.5.43
2252
2204
  */
2253
2205
  upscalingDecoding(cause: UpscalingDecodingCause, plugins?: readonly UpscalingPlugin[]): UpscalingReason;
@@ -2257,8 +2209,6 @@ export declare class TestHost implements Transport {
2257
2209
  * plugin listening with `plugin.video.upscaling.onChange` receives it.
2258
2210
  * Nothing reaches a plugin that does not listen.
2259
2211
  *
2260
- * @capability None.
2261
- *
2262
2212
  * @example Show the new factor in the plugin's window
2263
2213
  * The window resized: the test changes the area and the factor, sends
2264
2214
  * the change, and checks that the plugin's window shows the new factor.
@@ -2337,8 +2287,6 @@ export declare class TestHost implements Transport {
2337
2287
  * plugin listening with `plugin.video.motion("amd").onChange` receives it.
2338
2288
  * Nothing reaches a plugin that does not listen.
2339
2289
  *
2340
- * @capability None.
2341
- *
2342
2290
  * @example The GPU fell behind
2343
2291
  * The player turned the converter off for this video; the plugin's
2344
2292
  * panel shows the reason.
@@ -2455,9 +2403,9 @@ export declare class TestHost implements Transport {
2455
2403
  readonly coreRuns: string[];
2456
2404
  /**
2457
2405
  * The plugin is built into the player (`startPlugin`'s `builtin`). Only
2458
- * then does the host take the built-in-only capabilities
2459
- * (`commands.run`, `palette.lead`); otherwise their calls fail with
2460
- * `capability`, as in the player.
2406
+ * then does the host answer the built-in-only requests
2407
+ * (`commands.list`, `commands.run`, `palette.lead.*`); otherwise they
2408
+ * fail with `capability`, as in the player.
2461
2409
  *
2462
2410
  * @since 1.7.9
2463
2411
  */
@@ -2513,7 +2461,6 @@ export declare class TestHost implements Transport {
2513
2461
  * await stop();
2514
2462
  * ```
2515
2463
  *
2516
- * @capability None.
2517
2464
  * @throws `Error` without a code (rejects) The plugin has no lead row.
2518
2465
  * @since 1.7.9
2519
2466
  */
@@ -2544,7 +2491,6 @@ export declare class TestHost implements Transport {
2544
2491
  * assert.deepEqual(host.coreRuns, ["play-pause"]);
2545
2492
  * ```
2546
2493
  *
2547
- * @capability None.
2548
2494
  * @since 1.0.0
2549
2495
  */
2550
2496
  coreAction(id: string): FakeCommand;
@@ -2588,15 +2534,12 @@ export declare class TestHost implements Transport {
2588
2534
  * host.reset("system.openPath");
2589
2535
  * ```
2590
2536
  *
2591
- * @capability None.
2592
2537
  * @since 1.0.0
2593
2538
  */
2594
2539
  handle(method: string, handler: Handler): void;
2595
2540
  /**
2596
2541
  * Restore the default behaviour of a method replaced with {@link TestHost.handle}.
2597
2542
  *
2598
- * @capability None.
2599
- *
2600
2543
  * @example Restore the default answer after a simulated failure
2601
2544
  * The first write fails, the second succeeds. `reset` removes the handler
2602
2545
  * that `handle` installed, so the method is answered by the test host
@@ -2620,14 +2563,12 @@ export declare class TestHost implements Transport {
2620
2563
  * Deliver a host event to the plugin. Like the player, subscription-based
2621
2564
  * events (`source.state`, `playback.backend`, `window.state`,
2622
2565
  * `timeline.changed`, `appearance.changed`) are delivered only when the
2623
- * plugin subscribed (it declared `events` and listens). Most tests use the
2566
+ * plugin subscribed (it called `plugin.player.subscribe()` and listens). Most tests use the
2624
2567
  * higher-level helpers (`setSource`, `setMainWindow`, ...) instead.
2625
2568
  *
2626
2569
  * @param event - The wire event name.
2627
2570
  * @param data - The event payload (wire-level shape).
2628
2571
  *
2629
- * @capability None.
2630
- *
2631
2572
  * @example Deliver a raw event the helpers do not cover
2632
2573
  * The test pushes a `window.state` event after changing `layout` by hand.
2633
2574
  * Like the player, the host delivers it only when the plugin subscribed;
@@ -2674,7 +2615,6 @@ export declare class TestHost implements Transport {
2674
2615
  * await host.settle();
2675
2616
  * ```
2676
2617
  *
2677
- * @capability None.
2678
2618
  * @since 1.0.0
2679
2619
  */
2680
2620
  setSource(patch: Partial<SourceState>): void;
@@ -2707,7 +2647,6 @@ export declare class TestHost implements Transport {
2707
2647
  * assert.equal(plugin.window.state.maximized, true);
2708
2648
  * ```
2709
2649
  *
2710
- * @capability None.
2711
2650
  * @since 1.0.0
2712
2651
  */
2713
2652
  setMainWindow(patch: Partial<{
@@ -2728,8 +2667,6 @@ export declare class TestHost implements Transport {
2728
2667
  * those switched on, pop out or collapse (reference §6.3). No effect outside
2729
2668
  * fullscreen, or on a column switched off or floating.
2730
2669
  *
2731
- * @capability None.
2732
- *
2733
2670
  * @example Pop the sidebar out in fullscreen
2734
2671
  * The pointer reaches the right edge in fullscreen and the attached
2735
2672
  * sidebar pops out over the video. Outside fullscreen, or with the
@@ -2769,7 +2706,6 @@ export declare class TestHost implements Transport {
2769
2706
  * assert.equal(plugin.player.isCurrent(before), false);
2770
2707
  * ```
2771
2708
  *
2772
- * @capability None.
2773
2709
  * @since 1.0.0
2774
2710
  */
2775
2711
  openElsewhere(source: string, phase?: SourceState["phase"]): void;
@@ -2794,7 +2730,6 @@ export declare class TestHost implements Transport {
2794
2730
  * host.failStream(producer!.id, "producer transport closed");
2795
2731
  * ```
2796
2732
  *
2797
- * @capability None.
2798
2733
  * @since 1.5.7
2799
2734
  */
2800
2735
  failStream(producerId: number, message: string): void;
@@ -2828,7 +2763,6 @@ export declare class TestHost implements Transport {
2828
2763
  * await host.press("Delete", { panel: true }); // while the panel has focus
2829
2764
  * ```
2830
2765
  *
2831
- * @capability None.
2832
2766
  * @throws `command` (rejects) A `HostError`: the command that would run is
2833
2767
  * busy (the player only logs this).
2834
2768
  * @throws `Error` (rejects) Nothing is bound to the key.
@@ -2877,7 +2811,6 @@ export declare class TestHost implements Transport {
2877
2811
  * assert.equal(host.window("picture").props["brightness-down"], "⇧W");
2878
2812
  * ```
2879
2813
  *
2880
- * @capability None.
2881
2814
  * @throws `Error` `command` is neither a command of the plugin nor a
2882
2815
  * core command.
2883
2816
  * @since 1.6.6
@@ -2907,8 +2840,6 @@ export declare class TestHost implements Transport {
2907
2840
  state: "starting" | "running" | "disabled" | "failed" | "stopped";
2908
2841
  /** Why it failed (`state: "failed"`). */
2909
2842
  error: string | null;
2910
- /** Its declared capabilities. */
2911
- capabilities: string[];
2912
2843
  /** The package directory. */
2913
2844
  directory: string;
2914
2845
  /** Shipped with the player: `uninstall` and `install` are `unsupported`. */
@@ -2954,7 +2885,7 @@ export declare class TestHost implements Transport {
2954
2885
  * // ---cut---
2955
2886
  * host.candidates.set("/downloads/someone.demo-1.0.0.vxp", {
2956
2887
  * id: "someone.demo", version: "1.0.0", apiVersion: "vestra/1",
2957
- * entry: "main.js", capabilities: [],
2888
+ * entry: "main.js",
2958
2889
  * });
2959
2890
  * ```
2960
2891
  */
@@ -2976,7 +2907,6 @@ export declare class TestHost implements Transport {
2976
2907
  * host.installKeepsDisabled = false; // every install runs
2977
2908
  * ```
2978
2909
  *
2979
- * @capability None.
2980
2910
  * @since 1.5.55
2981
2911
  */
2982
2912
  installKeepsDisabled: boolean;
@@ -3005,7 +2935,6 @@ export declare class TestHost implements Transport {
3005
2935
  * assert.equal(host.markdown(rows[0]!.body)?.text, "**Hello**");
3006
2936
  * ```
3007
2937
  *
3008
- * @capability None.
3009
2938
  * @since 1.1.0
3010
2939
  */
3011
2940
  markdown(value: Json | undefined): MarkdownWire | null;
@@ -3023,8 +2952,6 @@ export declare class TestHost implements Transport {
3023
2952
  * Replace the plugin list and push `packages.changed` (another plugin
3024
2953
  * started, stopped, was installed or removed).
3025
2954
  *
3026
- * @capability None.
3027
- *
3028
2955
  * @example Simulate another plugin starting
3029
2956
  * The plugin's store window hears that a plugin is running now. The list
3030
2957
  * replaces `packages` and is pushed as `packages.changed`, which the
@@ -3044,7 +2971,6 @@ export declare class TestHost implements Transport {
3044
2971
  * asks this plugin's sequence provider. Rejects with `unavailable` when
3045
2972
  * there is no provider or its flag is false.
3046
2973
  *
3047
- * @capability None.
3048
2974
  * @throws `unavailable` (rejects) A `HostError`: there is no sequence
3049
2975
  * provider, or its flag is false.
3050
2976
  *
@@ -3068,8 +2994,6 @@ export declare class TestHost implements Transport {
3068
2994
  * The plugin's command with this local id. Throws when it is not
3069
2995
  * registered (never added, or disposed).
3070
2996
  *
3071
- * @capability None.
3072
- *
3073
2997
  * @example Read a command's state after a change
3074
2998
  * The test checks that Export becomes enabled once a file is ready. The
3075
2999
  * record is updated as the plugin sends new state; read it after
@@ -3131,7 +3055,6 @@ export declare class TestHost implements Transport {
3131
3055
  * assert.equal(host.window("picture").props["brightness"], 0);
3132
3056
  * ```
3133
3057
  *
3134
- * @capability None.
3135
3058
  * @since 1.0.0
3136
3059
  */
3137
3060
  window(id: string): FakeWindow;
@@ -3156,7 +3079,6 @@ export declare class TestHost implements Transport {
3156
3079
  * await host.settle();
3157
3080
  * ```
3158
3081
  *
3159
- * @capability None.
3160
3082
  * @since 1.0.0
3161
3083
  */
3162
3084
  mounted(slot?: "bottom" | "sidebar" | "adjust" | "backdrop"): FakePanel;
@@ -3174,7 +3096,6 @@ export declare class TestHost implements Transport {
3174
3096
  * assert.deepEqual(host.sent("osd.show").at(-1), { text: "Saved" });
3175
3097
  * ```
3176
3098
  *
3177
- * @capability None.
3178
3099
  * @since 1.0.0
3179
3100
  */
3180
3101
  sent(method: string): Record<string, Json>[];
@@ -3229,7 +3150,6 @@ export declare class TestHost implements Transport {
3229
3150
  * assert.equal(importWindow.props["status-text"], expected);
3230
3151
  * ```
3231
3152
  *
3232
- * @capability None.
3233
3153
  * @throws Never.
3234
3154
  * @since 1.0.0
3235
3155
  */
@@ -3241,8 +3161,6 @@ export declare class TestHost implements Transport {
3241
3161
  * `ENOTEMPTY`, `EBUSY`, `EPERM`) is retried for about 1.5 s, then left
3242
3162
  * for the system to clean, with a warning on the console.
3243
3163
  *
3244
- * @capability None.
3245
- *
3246
3164
  * @example Clean up a host that was never started
3247
3165
  * A test that made a host but failed before `startPlugin` removes the
3248
3166
  * host's temporary directories itself. `stop()` from `startPlugin` calls
@@ -3272,7 +3190,6 @@ export declare class TestHost implements Transport {
3272
3190
  * and start it again on its next use. Filter chains, streams, jobs and the
3273
3191
  * like (which also keep a plugin running) are not listed.
3274
3192
  *
3275
- * @capability None.
3276
3193
  * @since 1.5.40
3277
3194
  *
3278
3195
  * @example Check that a plugin can be stopped while idle
@@ -3289,6 +3206,108 @@ export declare class TestHost implements Transport {
3289
3206
  * ```
3290
3207
  */
3291
3208
  get keepsRunning(): string[];
3209
+ /**
3210
+ * The trigger conditions the player keeps for this plugin
3211
+ * (`plugin.trigger().firesOn`), in the wire form, with their sequence
3212
+ * numbers and whether each holds now. They stay through
3213
+ * {@link TestHost.park}; {@link TestHost.upgrade} clears the unnamed ones.
3214
+ *
3215
+ * @since 1.10.0
3216
+ */
3217
+ get triggers(): readonly KeptTrigger[];
3218
+ /**
3219
+ * The test host's wall clock (Unix milliseconds), which `when.time`
3220
+ * conditions read. It starts at the real time; it moves only with
3221
+ * {@link TestHost.advance}, or when a test sets it.
3222
+ *
3223
+ * @since 1.10.0
3224
+ */
3225
+ get now(): number;
3226
+ /**
3227
+ * Set the clock to `value` (Unix milliseconds). Only the clock moves:
3228
+ * the kept conditions see the new time at their next evaluation, on
3229
+ * {@link TestHost.advance} or a state the test pushes.
3230
+ */
3231
+ set now(value: number);
3232
+ /**
3233
+ * Move the clock by `ms` milliseconds and, while the source plays
3234
+ * (`phase` `ready`, not paused), the position by `rate × ms`. Each
3235
+ * position boundary and time bound a kept condition waits for is passed
3236
+ * in its order: an `enter` or `leave` runs with the clock and the position
3237
+ * where the player would call it, and the test does not wait. The new
3238
+ * position is then pushed as `source.state`.
3239
+ *
3240
+ * @example A silence is entered 2 s before it starts
3241
+ * The source plays from 0, and the plugin's position condition has a
3242
+ * lead of 2 s before a range at 10 s. Advancing 8 s of clock plays 8 s
3243
+ * of media, so the trigger's `enter` runs on the way, at 8 s.
3244
+ * ```ts
3245
+ * import assert from "node:assert/strict";
3246
+ * declare const host: TestHost;
3247
+ * // ---cut---
3248
+ * host.setSource({ phase: "ready", duration: 60, position: 0 });
3249
+ * // … the plugin gave when.position.in([{ start: 10, end: 12 }], { lead: 2 })
3250
+ * await host.advance(8_000); // its enter ran at 8 s
3251
+ * ```
3252
+ *
3253
+ * @throws `TypeError` (rejects) `ms` is not a number of 0 or more.
3254
+ * @since 1.10.0
3255
+ */
3256
+ advance(ms: number): Promise<void>;
3257
+ /**
3258
+ * The player puts the plugin in standby: it is stopped (reason
3259
+ * `idle`); its trigger conditions and the wake events it listens to are
3260
+ * kept. A condition that flips, or a wake event, starts it again
3261
+ * (`activate()` runs anew) and delivers what waited, in order; the
3262
+ * conditions given again by `activate()` change nothing.
3263
+ *
3264
+ * @throws `Error` without a code (rejects) The plugin was not started
3265
+ * with {@link startPlugin}.
3266
+ *
3267
+ * @example A trigger condition outlives standby
3268
+ * The test puts a plugin that armed one trigger in standby, as the
3269
+ * player does when nothing uses it, and checks that the player still
3270
+ * keeps the condition that will start the plugin again.
3271
+ * ```ts
3272
+ * import assert from "node:assert/strict";
3273
+ * declare const host: TestHost;
3274
+ * // ---cut---
3275
+ * await host.park(); // stopped with reason "idle"
3276
+ * assert.equal(host.parked, true);
3277
+ * assert.equal(host.triggers.length, 1);
3278
+ * ```
3279
+ *
3280
+ * @since 1.10.0
3281
+ */
3282
+ park(): Promise<void>;
3283
+ /** The plugin is in standby ({@link TestHost.park}) and not started again yet. */
3284
+ get parked(): boolean;
3285
+ /**
3286
+ * Another version replaces the plugin: it is stopped (reason
3287
+ * `upgrade`), the conditions of its unnamed triggers are cleared, the
3288
+ * named ones kept, and it starts again with `activate` (the new
3289
+ * version's code; default: the same). A name the new version does not
3290
+ * declare is dropped when it starts.
3291
+ *
3292
+ * @throws `Error` without a code (rejects) The plugin was not started
3293
+ * with {@link startPlugin}.
3294
+ *
3295
+ * @example A named sleep timer survives an update
3296
+ * The test arms the plugin's sleep timer from its command, replaces the
3297
+ * plugin with the same code as a new version, and checks that the
3298
+ * player still keeps the condition of the trigger named `sleep`.
3299
+ * ```ts
3300
+ * import assert from "node:assert/strict";
3301
+ * declare const host: TestHost;
3302
+ * // ---cut---
3303
+ * await host.command("in45").run();
3304
+ * await host.upgrade(); // the same activate, as the new version
3305
+ * assert.ok(host.triggers.some((kept) => kept.trigger === "sleep"));
3306
+ * ```
3307
+ *
3308
+ * @since 1.10.0
3309
+ */
3310
+ upgrade(activate?: (plugin: Plugin) => unknown): Promise<void>;
3292
3311
  }
3293
3312
  /**
3294
3313
  * Activate a plugin against a test host, the way the player's runner does:
@@ -3296,18 +3315,16 @@ export declare class TestHost implements Transport {
3296
3315
  * registration started during activation (commands, panels, resolvers, ...),
3297
3316
  * then wait until the host is idle.
3298
3317
  *
3299
- * The manifest id and capabilities come from `directory/manifest.json`
3300
- * unless `capabilities` is given; then `id` (default `"test.plugin"`) and
3301
- * `capabilities` are used and no manifest is read. The test host does not
3302
- * apply the player's capability table to every request: the members that
3303
- * check a capability on the plugin's side (`plugin.media.sources` and its
3304
- * `open`, which also needs `playback.control`, `plugin.secrets`, timeline
3305
- * marks, video shaders and views, among others) fail with `capability` as in
3306
- * the player, but a call the player refuses for an undeclared capability can
3307
- * succeed here. `vestra-plugin check` (and the TypeScript plugin) reports
3308
- * those calls from the sources.
3318
+ * The manifest id comes from `directory/manifest.json` unless `id` is
3319
+ * given; then no manifest is read (and without `directory` none is read
3320
+ * either: the id is `"test.plugin"`). Nothing in the manifest changes how
3321
+ * the plugin runs: event delivery and the start-up reads are the plugin's
3322
+ * own calls (`plugin.player.subscribe()`, `plugin.player.read()`), as in
3323
+ * the player.
3309
3324
  *
3310
- * Rejects when `manifest.json` cannot be read or parsed, when `activate`
3325
+ * Rejects when `manifest.json` cannot be read or parsed, when it still has
3326
+ * `capabilities` (removed in 1.9.0; the message says what to call
3327
+ * instead), when `activate`
3311
3328
  * throws, or when a registration made during activation fails (for example
3312
3329
  * `limit`, `conflict`, `invalid`). Stricter than the player's runner for
3313
3330
  * commands: there the SDK logs a command declaration the player refuses during
@@ -3369,7 +3386,6 @@ export declare class TestHost implements Transport {
3369
3386
  * player's runner does and returns the host to drive, the `plugin` object
3370
3387
  * to call directly, and `stop` to end it like the player.
3371
3388
  *
3372
- * @capability None.
3373
3389
  * @see [Test a plugin](../../../docs/guides/testing.md)
3374
3390
  * @since 1.0.0
3375
3391
  * @category Testing
@@ -3381,10 +3397,11 @@ export declare function startPlugin(activate: (plugin: Plugin) => unknown, optio
3381
3397
  * files resolve against it. Default: the current working directory.
3382
3398
  */
3383
3399
  directory?: string | URL;
3384
- /** The manifest id when `capabilities` is given. Default `"test.plugin"`. */
3400
+ /**
3401
+ * The plugin's id; then `manifest.json` is not read. Default: the
3402
+ * manifest's id, or `"test.plugin"` without `directory`.
3403
+ */
3385
3404
  id?: string;
3386
- /** Use these capabilities instead of reading `manifest.json`. */
3387
- capabilities?: string[];
3388
3405
  /**
3389
3406
  * Run the plugin as one built into the player
3390
3407
  * ({@link TestHost.builtin}): only then do `commands.run` and