@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
@@ -10,7 +10,7 @@ import type { ExportJob, MediaSources, Snapshot } from "./snapshots.ts";
10
10
  import type { Resolver } from "./sources.ts";
11
11
  import type { PropValue, View } from "./ui-content.ts";
12
12
  import type { Panel, Window } from "./ui-layout.ts";
13
- import type { Bindings, Commands, Host, Palette, When } from "./commands.ts";
13
+ import type { Bindings, Commands, Host, Palette, Trigger, When } from "./commands.ts";
14
14
  import type { Packages } from "./packages.ts";
15
15
  import type { Mpv, Player, Timeline } from "./playback.ts";
16
16
  import type { AudioFilter, RenderOptions, VideoFilter, MotionEngine, VideoMotion, VideoShaders, VideoUpscaling, VideoView } from "./processing.ts";
@@ -58,7 +58,6 @@ import type { Wire } from "./plugin-wire.ts";
58
58
  * created it; disposing the scope (or stopping the plugin) disposes them in
59
59
  * reverse creation order, so a plugin rarely calls `dispose` itself.
60
60
  *
61
- * @capability None of its own: that of the handle.
62
61
  * @since 1.0.0
63
62
  * @category Plugin
64
63
  */
@@ -67,7 +66,6 @@ export interface Disposable {
67
66
  * Release the resource. Resolves once the player confirmed the release
68
67
  * (or immediately for purely local resources). Never rejects.
69
68
  *
70
- * @capability None of its own: that of the handle.
71
69
  * @throws Never.
72
70
  *
73
71
  * @example Remove a command when its feature is turned off
@@ -96,7 +94,7 @@ export interface Disposable {
96
94
  * | code | meaning |
97
95
  * | --- | --- |
98
96
  * | `stale` | A condition no longer held (the source or the subtitle selection changed); nothing was done. See {@link Conditional}. |
99
- * | `capability` | The manifest does not declare the capability the call needs. |
97
+ * | `capability` | The call is for the player's built-in plugins only (`commands.list`, `commands.run`, `palette.lead`) and this plugin is not one. |
100
98
  * | `invalid` | A bad argument (out of range, malformed, unknown id). |
101
99
  * | `missing` | The target does not exist (an empty panel position, a missing file, an unknown command). |
102
100
  * | `busy` | The player is still doing a previous call of the same kind (a dialog is open, a step is in flight). |
@@ -117,7 +115,7 @@ export interface Disposable {
117
115
  * | `limit` | A player-wide limit was reached (for example the number of commands), a property value is over the limits of {@link PropValue}, a request is longer than the player's 1 MiB message, {@link Commands.run} ran too often, or a client that bypasses the SDK left more than 320 requests or 4 MiB of them unanswered (the player's backstop; the SDK keeps a plugin under it). |
118
116
  * | `reserved` | {@link Packages.validate}, {@link PackageCandidate.install}: the id is `vestra` or starts with `vestra.` (any case), which only the player's built-in plugins use. |
119
117
  * | `versionMismatch` | The package needs a newer player (`minPlayerVersion`). |
120
- * | `ui-prepare` | The player could not prepare a mounted panel or a settings page (its Slint file does not compile, a bound property is not declared, or another plugin's panel holds the slot); `message` has the diagnostics. |
118
+ * | `ui-prepare` | The player could not prepare a mounted panel or a settings page (its Slint file does not compile, or a bound property is not declared); `message` has the diagnostics. A panel shown at once rejects its `ready`; a tab mounted in the background is compiled when it is first shown, and its failure goes to {@link Scope.onError} without a request (see {@link Panel.ready}). |
121
119
  * | `ui` | The player could not apply a property to a tool window or a settings page, or could not build the Options window (a property the Slint file does not declare, a value of the wrong type); `message` has Slint's reason. Also reported to {@link Scope.onError} without a request: a callback whose arguments the player could not convert, a property it could not show again when it rebuilt a view (an image file removed since). |
122
120
  * | `host` | Any other failure inside the player; `message` is the player's reason. |
123
121
  * | `disabled` | The plugin is being stopped; pending requests fail with it. {@link Commands.run}: the command is disabled; `message` has its reason. |
@@ -175,7 +173,6 @@ export type PluginError = Error & {
175
173
  * `child.dispose()` releases its handles and deeper children in reverse
176
174
  * creation order.
177
175
  *
178
- * Capabilities: each module documents the manifest capability it needs.
179
176
  * Reading {@link Scope.window}, {@link Scope.app}, {@link Scope.appearance}
180
177
  * `.theme`, {@link Scope.ui}, {@link Scope.tools}, {@link Scope.storage} and
181
178
  * {@link Scope.system} needs none.
@@ -210,7 +207,6 @@ export type PluginError = Error & {
210
207
  * go: dispose the child and everything it created is released, while the
211
208
  * rest of the plugin keeps running.
212
209
  *
213
- * @capability That of each module (see the modules).
214
210
  * @since 1.0.0
215
211
  * @category Plugin
216
212
  */
@@ -223,22 +219,20 @@ export interface Scope extends Disposable {
223
219
  * while the plugin is stopped. See {@link When}.
224
220
  */
225
221
  readonly when: When;
226
- /** Tool windows from `.slint` files (`ui.window`). */
222
+ /** Tool windows from `.slint` files. */
227
223
  readonly windows: Windows;
228
- /** Docked panels: bottom bar, sidebar and backdrop (`ui.mount`). */
224
+ /** Docked panels: bottom bar, sidebar and backdrop. */
229
225
  readonly panels: Panels;
230
- /** Native file dialogs and confirmation alerts (`ui.dialog`). */
226
+ /** Native file dialogs and confirmation alerts. */
231
227
  readonly dialogs: Dialogs;
232
- /** Playback state and controls (`playback.read`, `events`, `playback.control`). */
228
+ /** Playback state and controls. */
233
229
  readonly player: Player;
234
230
  /**
235
231
  * Video processing: this plugin's filter chain, the display layer, the
236
232
  * GPU render options, this plugin's shaders, the GPU's video upscaler and
237
- * motion smoothing. The first four need `processing.video` and
238
- * `playback.read`; the filter chain also needs `events` (without it the
239
- * SDK never sees the media become ready and the chain stays `waiting`).
240
- * The upscaler needs `video.upscaling` only, motion smoothing
241
- * `video.motion` only.
233
+ * motion smoothing. The filter chain follows the player: call
234
+ * `plugin.player.subscribe()` and `plugin.player.read()` first (without `subscribe()` the SDK never sees
235
+ * the media become ready and the chain stays `waiting`).
242
236
  */
243
237
  readonly video: {
244
238
  /**
@@ -250,38 +244,31 @@ export interface Scope extends Disposable {
250
244
  */
251
245
  filter(id: string): VideoFilter;
252
246
  /**
253
- * The display layer (needs `processing.video`). The first plugin to call
247
+ * The display layer. The first plugin to call
254
248
  * it owns the layer; another plugin's view fails with `conflict` until the
255
249
  * owner disposes or stops.
256
250
  *
257
- * @throws `capability` (throws) The manifest does not declare
258
- * `processing.video`.
259
251
  * @throws `Error` without a code (throws) A second call in the same plugin
260
252
  * while the first view is not disposed.
261
253
  */
262
254
  view(): VideoView;
263
255
  /**
264
- * The GPU renderer's options (needs `processing.video`), owned like the
256
+ * The GPU renderer's options, owned like the
265
257
  * display layer. Under software rendering the handle is `failed` with
266
258
  * `unsupported` after the player's first answer, and `onError` hears it.
267
259
  *
268
- * @throws `capability` (throws) The manifest does not declare
269
- * `processing.video`.
270
260
  * @throws `Error` without a code (throws) A second call in the same plugin
271
261
  * while the first handle is not disposed.
272
262
  */
273
263
  render(): RenderOptions;
274
264
  /**
275
- * This plugin's own GPU shaders named `id` (default `"shaders"`; needs
276
- * `processing.video`). Unlike {@link Scope.video | render()}, every plugin
265
+ * This plugin's own GPU shaders named `id` (default `"shaders"`). Unlike {@link Scope.video | render()}, every plugin
277
266
  * may hold shader handles at the same time; the player joins their lists.
278
267
  * Nothing is sent until the first `set()`.
279
268
  *
280
269
  * @param id - Local name of the handle, 1–128 bytes, unique within
281
270
  * the plugin.
282
271
  * @returns A {@link VideoShaders} owned by this scope.
283
- * @throws `capability` (throws) The manifest does not declare
284
- * `processing.video`.
285
272
  * @throws `invalid` (throws) `id` is empty, longer than 128 bytes or
286
273
  * has control characters.
287
274
  * @throws `Error` without a code (throws) A second handle with the
@@ -289,14 +276,13 @@ export interface Scope extends Disposable {
289
276
  */
290
277
  shaders(id?: string): VideoShaders;
291
278
  /**
292
- * The GPU's video upscaler (NVIDIA RTX Video Super Resolution on Windows;
293
- * needs `video.upscaling`): whether it works here and why not, and turning
279
+ * The GPU's video upscaler (NVIDIA RTX Video Super Resolution on
280
+ * Windows): whether it works here and why not, and turning
294
281
  * it on or off for this plugin.
295
282
  */
296
283
  readonly upscaling: VideoUpscaling;
297
284
  /**
298
- * Motion smoothing with one GPU vendor's frame-rate converter (needs
299
- * `video.motion`): whether it works here and why not, and this
285
+ * Motion smoothing with one GPU vendor's frame-rate converter: whether it works here and why not, and this
300
286
  * plugin's mode. `amd` is AMD AMF's on Windows; `nvidia` is reserved
301
287
  * (every mode reports `engine` until a player has it).
302
288
  *
@@ -309,9 +295,8 @@ export interface Scope extends Disposable {
309
295
  motion(engine: MotionEngine): VideoMotion;
310
296
  };
311
297
  /**
312
- * Audio processing: this plugin's filter chain and delay
313
- * (`processing.audio`, `playback.read` and `events`, as for
314
- * {@link VideoFilter}).
298
+ * Audio processing: this plugin's filter chain and delay (it follows the
299
+ * player as {@link VideoFilter} does).
315
300
  */
316
301
  readonly audio: {
317
302
  /**
@@ -323,15 +308,15 @@ export interface Scope extends Disposable {
323
308
  */
324
309
  filter(id: string): AudioFilter;
325
310
  };
326
- /** Subtitle tracks, uploads and style (`subtitles.read`, `subtitles.control`). */
311
+ /** Subtitle tracks, uploads and style. */
327
312
  readonly subtitles: Subtitles;
328
- /** Frozen snapshots and offline exports (`media.read`, `media.control`). */
313
+ /** Frozen snapshots and offline exports. */
329
314
  readonly media: MediaCapture;
330
- /** Page-URL to stream-URL resolvers (`source.resolve`). */
315
+ /** Page-URL to stream-URL resolvers. */
331
316
  readonly resolvers: Resolvers;
332
- /** The installed plugins; validation, installs (`plugins.manage` for changes). */
317
+ /** The installed plugins; validation, installs. */
333
318
  readonly packages: Packages;
334
- /** On-screen messages over the video (`ui.osd`). */
319
+ /** On-screen messages over the video. */
335
320
  readonly osd: Osd;
336
321
  /** The command palette's lead row (`palette.lead`, built-in plugins only). */
337
322
  readonly palette: Palette;
@@ -339,7 +324,7 @@ export interface Scope extends Disposable {
339
324
  readonly host: Host;
340
325
  /** The system clipboard (`clipboard`). */
341
326
  readonly clipboard: Clipboard;
342
- /** Keeping the computer awake while playing (`playback.control`). */
327
+ /** Keeping the computer awake while playing. */
343
328
  readonly power: Power;
344
329
  /** ffmpeg / ffprobe, run by this plugin's process. */
345
330
  readonly tools: Tools;
@@ -359,21 +344,21 @@ export interface Scope extends Disposable {
359
344
  readonly window: MainWindow;
360
345
  /** The player's version and components, and the system it runs on. */
361
346
  readonly app: App;
362
- /** GPU or software rendering: read the choice, change it (`rendering.manage`). */
347
+ /** GPU or software rendering: read the choice, change it. */
363
348
  readonly rendering: Rendering;
364
- /** Every command's bindings and the user's overrides (`bindings.manage`). */
349
+ /** Every command's bindings and the user's overrides. */
365
350
  readonly bindings: Bindings;
366
351
  /** Runtime images for Slint `image` properties. */
367
352
  readonly ui: Ui;
368
353
  /** Marks on the seek bar, merged from every plugin's layer. */
369
354
  readonly timeline: Timeline;
370
- /** Files dropped on the video area, by extension (`ui.drop`). */
355
+ /** Files dropped on the video area, by extension. */
371
356
  readonly drops: Drops;
372
357
  /** The player's palette and the saved interface language. */
373
358
  readonly appearance: Appearance;
374
359
  /** The interface language of this run (read-only). */
375
360
  readonly i18n: I18n;
376
- /** Pages in the player's options window (`ui.settings`). */
361
+ /** Pages in the player's options window. */
377
362
  readonly settings: Settings;
378
363
  /**
379
364
  * Direct messages to the player: requests by method name, raw events, direct
@@ -389,8 +374,6 @@ export interface Scope extends Disposable {
389
374
  * A child scope; disposing it releases only what was created through it.
390
375
  * The child is itself owned by this scope.
391
376
  *
392
- * @capability None.
393
- *
394
377
  * @example Tie a temporary window and its timer to one feature
395
378
  * A "Live stats" feature opens a window and starts a timer; turning it off
396
379
  * releases both together. Everything made through the child scope, and
@@ -427,8 +410,6 @@ export interface Scope extends Disposable {
427
410
  * through another scope.
428
411
  * @returns `item` itself, for chaining.
429
412
  *
430
- * @capability None.
431
- *
432
413
  * @example Dispose a handle from another scope together with this one
433
414
  * A filter made through the root scope is withdrawn when a child feature
434
415
  * ends. `add` hands an existing disposable to this scope, which then
@@ -482,7 +463,6 @@ export interface Scope extends Disposable {
482
463
  * `DisposeInfo` as its first argument: wrap it (`() => controller.abort()`)
483
464
  * when that matters.
484
465
  *
485
- * @capability None.
486
466
  * @since 1.0.0
487
467
  */
488
468
  onDispose(cleanup: ((info?: DisposeInfo) => void | Promise<void>) | (() => void | Promise<void>)): Disposable;
@@ -506,7 +486,6 @@ export interface Scope extends Disposable {
506
486
  * });
507
487
  * ```
508
488
  *
509
- * @capability None.
510
489
  * @since 1.0.0
511
490
  */
512
491
  onError(listener: (error: PluginError) => void): Disposable;
@@ -518,8 +497,6 @@ export interface Scope extends Disposable {
518
497
  *
519
498
  * Several calls within one microtask are merged into one pass.
520
499
  *
521
- * @capability None.
522
- *
523
500
  * @example Show progress from a long task between awaits
524
501
  * A progress label moves while a long download runs, not only when it
525
502
  * ends. The SDK re-evaluates bound values after each handler and when its
@@ -586,8 +563,6 @@ export interface Scope extends Disposable {
586
563
  * @throws `invalid` (throws) `initial` is not a plain object (`null`, an
587
564
  * array, a class instance).
588
565
  *
589
- * @capability None.
590
- *
591
566
  * @example Show a check's answer without a manual update
592
567
  * A panel shows whether the current file has video once an asynchronous
593
568
  * check answers. The answer is written to a tracked field; only the
@@ -638,7 +613,7 @@ export interface Scope extends Disposable {
638
613
  * Tools ▸ Say hello, or Ctrl+H, shows "Hello from" and the plugin's id.
639
614
  * The player imports `main.ts`, calls its default export with the
640
615
  * `Plugin` object, and keeps the registrations made during activation;
641
- * the manifest declares the capabilities `commands` and `ui.osd`.
616
+ * the manifest says only who the plugin is.
642
617
  * ```ts
643
618
  * import type { Plugin } from "@vestra-player/sdk";
644
619
  *
@@ -657,7 +632,6 @@ export interface Scope extends Disposable {
657
632
  * the modules of {@link Scope}, it carries the plugin's `id` and its
658
633
  * `dataDirectory`.
659
634
  *
660
- * @capability That of each module (see the modules).
661
635
  * @see [Tutorial](../../../docs/tutorial/index.md)
662
636
  * @since 1.0.0
663
637
  * @category Plugin
@@ -671,7 +645,7 @@ export interface Plugin extends Scope {
671
645
  * Each installation has its own directory: it is kept across restarts,
672
646
  * disabling and upgrades, and a reinstall of the same id from a different
673
647
  * source gets a new, empty one. It is deleted only by
674
- * `packages.uninstall(id, { removeData: true })`. No capability.
648
+ * `packages.uninstall(id, { removeData: true })`.
675
649
  *
676
650
  * The path's format is not part of the API: do not derive another
677
651
  * plugin's directory from it (a plugin manager reads
@@ -686,6 +660,42 @@ export interface Plugin extends Scope {
686
660
  * {@link Scope.onDispose} cleanup runs. See {@link StopReason}.
687
661
  */
688
662
  readonly stopReason: StopReason | undefined;
663
+ /**
664
+ * Makes a trigger: a condition the player keeps and evaluates, and the
665
+ * functions it calls when the condition becomes true and false, also
666
+ * waking the plugin from standby. Called only in the synchronous part of
667
+ * `activate()` (before its first `await`). Without a name the trigger is
668
+ * known by its place among the unnamed ones, and a condition it was
669
+ * given is cleared when the plugin is upgraded; with a name it is known
670
+ * by the name and survives an upgrade. At most 64 per plugin.
671
+ *
672
+ * @param name - Unique within the plugin, 1–64 characters.
673
+ * @throws `Error` without a code (throws) Called after the synchronous
674
+ * part of `activate()`, or on a scope made with `plugin.scope()` (a
675
+ * trigger is the plugin's: its condition outlives any scope).
676
+ * @throws `invalid` (throws) A name used twice, or not 1–64 characters.
677
+ * @throws `limit` (throws) A 65th trigger.
678
+ *
679
+ * @example A sleep timer that survives an update
680
+ * A menu item pauses playback 45 minutes later. The trigger is named,
681
+ * so its condition stays with the player through standby and an update,
682
+ * and `enter` disarms it before pausing.
683
+ * ```ts
684
+ * const { when, player, commands } = plugin;
685
+ * const alarm = plugin.trigger("sleep").enter(async () => {
686
+ * alarm.off(); // fire once: the player forgets the condition
687
+ * await player.setPaused(true);
688
+ * });
689
+ * commands.add({
690
+ * id: "in45",
691
+ * path: ["Tools", "Sleep in 45 Minutes"],
692
+ * run: () => alarm.firesOn(when.time({ min: Date.now() + 45 * 60_000 })),
693
+ * });
694
+ * ```
695
+ *
696
+ * @since 1.10.0
697
+ */
698
+ trigger(name?: string): Trigger;
689
699
  }
690
700
  /**
691
701
  * Why the player stopped the plugin ({@link DisposeInfo.reason},
@@ -694,7 +704,7 @@ export interface Plugin extends Scope {
694
704
  * - `quit`: the player quits (or restarts after a lost GPU device). Every
695
705
  * plugin is stopped at the same time, with 1 s in all (300 ms after a lost
696
706
  * device).
697
- * - `disable`: the user, or a plugin with `plugins.manage`, switched the
707
+ * - `disable`: the user, or a plugin that manages plugins, switched the
698
708
  * plugin off. Its session storage is cleared.
699
709
  * - `uninstall`: the user uninstalls it.
700
710
  * - `reload`: it is reloaded (from the plugin manager, or a development
@@ -807,9 +817,9 @@ export interface WindowState {
807
817
  };
808
818
  }
809
819
  /**
810
- * The player's main window. Reading needs no capability; changes need `window.control`.
820
+ * The player's main window: read it, change it.
811
821
  *
812
- * With `events`, `state` follows the window from the first read or
822
+ * After `plugin.player.subscribe()`, `state` follows the window from the first read or
813
823
  * `onChange`; without it, it updates only at start and after this plugin's
814
824
  * `setVideoArea`.
815
825
  *
@@ -836,12 +846,9 @@ export interface WindowState {
836
846
  *
837
847
  * @remarks
838
848
  * `plugin.window` is the player's main window: its size, whether it is
839
- * maximized or fullscreen, picture-in-picture and the video area. Reading it needs no capability;
840
- * changing it needs `window.control`. Changes that last only while the
849
+ * maximized or fullscreen, picture-in-picture and the video area. Changes that last only while the
841
850
  * plugin runs (always on top, pointer auto-hide) revert when it stops.
842
851
  *
843
- * @capability None to read; window.control to change; events to follow
844
- * outside changes.
845
852
  * @since 1.0.0
846
853
  * @category Plugin
847
854
  */
@@ -849,14 +856,12 @@ export interface MainWindow {
849
856
  /** Latest state; zero video area without a native window. */
850
857
  readonly state: WindowState;
851
858
  /**
852
- * The window state changed (needs `events` for outside changes).
853
- *
854
- * @capability events (for outside changes)
859
+ * The window state changed (outside changes after `plugin.player.subscribe()`).
855
860
  *
856
861
  * @example Fit a panel to fullscreen
857
862
  * The plugin's panel uses larger text while the player is fullscreen. The
858
863
  * listener runs after the SDK updated `state` from the player's events
859
- * (with `events`; without it only after this plugin's own changes).
864
+ * (after `plugin.player.subscribe()`; without it only after this plugin's own changes).
860
865
  * ```ts
861
866
  * declare const bar: Panel;
862
867
  * // ---cut---
@@ -877,11 +882,8 @@ export interface MainWindow {
877
882
  * The visible area excludes the menu bar and Dock on macOS; on Windows it
878
883
  * is the whole display. `unavailable` without a user interface too.
879
884
  *
880
- * @capability window.control
881
885
  * @throws `unavailable` (rejects) Fullscreen, or no user interface.
882
886
  * @throws `invalid` (rejects) A size outside 1–16384 logical points.
883
- * @throws `capability` (rejects) The manifest does not declare
884
- * `window.control`.
885
887
  *
886
888
  * @example Make the video area 1280×720 points
887
889
  * The window resizes so that the video column is 1280×720 logical points,
@@ -909,11 +911,8 @@ export interface MainWindow {
909
911
  * Float the player's windows above other applications. Newest call wins; reverts when this plugin stops.
910
912
  * `unavailable` without a user interface.
911
913
  *
912
- * @capability window.control
913
914
  * @throws `unavailable` (rejects) No user interface.
914
915
  * @throws `invalid` (rejects) `onTop` is not a boolean.
915
- * @throws `capability` (rejects) The manifest does not declare
916
- * `window.control`.
917
916
  *
918
917
  * @example Keep the player above other windows
919
918
  * The player's windows (tool windows too) float above other applications
@@ -940,11 +939,8 @@ export interface MainWindow {
940
939
  * playing, in a window too (not only fullscreen). Newest call wins;
941
940
  * reverts to `"fullscreen"` when this plugin stops.
942
941
  *
943
- * @capability window.control
944
942
  * @throws `invalid` (rejects) A mode other than `"fullscreen"` or
945
943
  * `"playing"`.
946
- * @throws `capability` (rejects) The manifest does not declare
947
- * `window.control`.
948
944
  *
949
945
  * @example Hide the pointer over playing video in a window too
950
946
  * The pointer disappears after 3 idle seconds over playing video, not only
@@ -980,15 +976,12 @@ export interface MainWindow {
980
976
  * await plugin.window.setPictureInPicture(!plugin.window.state.pictureInPicture.active);
981
977
  * ```
982
978
  *
983
- * @capability window.control
984
979
  * @throws `unsupported` (rejects) The system has no picture-in-picture
985
980
  * (`supported` is false).
986
981
  * @throws `unavailable` (rejects) No video, or no user interface.
987
982
  * @throws `invalid` (rejects) `on` is not a boolean.
988
983
  * @throws `busy` (rejects) The previous call is still switching.
989
984
  * @throws `failed` (rejects) The system refused.
990
- * @throws `capability` (rejects) The manifest does not declare
991
- * `window.control`.
992
985
  * @since 1.0.0
993
986
  */
994
987
  setPictureInPicture(on: boolean): Promise<void>;
@@ -1020,8 +1013,7 @@ export interface AppInfo {
1020
1013
  };
1021
1014
  }
1022
1015
  /**
1023
- * `plugin.app`: the fixed facts plus the system, read on request. No
1024
- * capability.
1016
+ * `plugin.app`: the fixed facts plus the system, read on request.
1025
1017
  *
1026
1018
  * @example Describe the player and the system for a bug report
1027
1019
  * The plugin builds a line such as "Vestra 0.5.10 on macOS 26.2" to copy
@@ -1040,7 +1032,6 @@ export interface AppInfo {
1040
1032
  * the displays at each call; the operating system's name and version are
1041
1033
  * worked out once, at the first call, and reused.
1042
1034
  *
1043
- * @capability None.
1044
1035
  * @since 1.0.0
1045
1036
  * @category Plugin
1046
1037
  */
@@ -1048,9 +1039,8 @@ export interface App extends AppInfo {
1048
1039
  /**
1049
1040
  * The operating system, the displays and the renderer, read when called
1050
1041
  * (displays come and go; the renderer can fall back from GPU to software
1051
- * once). No capability. CPU and memory: Node's `os` module.
1042
+ * once). CPU and memory: Node's `os` module.
1052
1043
  *
1053
- * @capability None.
1054
1044
  * @throws `busy` (rejects) The player could not start the request (no
1055
1045
  * thread available).
1056
1046
  *
@@ -1112,7 +1102,7 @@ export interface SystemInfo {
1112
1102
  * The plugin adds its HDR command only when the player renders on the GPU,
1113
1103
  * instead of creating the render options just to find out from a failed
1114
1104
  * status. `system()` asks the player, which reports the renderer drawing at
1115
- * that moment; no capability is needed to ask.
1105
+ * that moment.
1116
1106
  * ```ts
1117
1107
  * const { rendering } = await plugin.app.system();
1118
1108
  * if (rendering === "gpu") {
@@ -1140,8 +1130,8 @@ export interface SystemInfo {
1140
1130
  * @example Say why the video is drawn in software
1141
1131
  * An About page explains a software renderer with the player's own words,
1142
1132
  * for example that the graphics driver is on the player's denylist.
1143
- * `system()` reports the renderer and its reason together, with no
1144
- * capability; the message is English text that may name the adapter and
1133
+ * `system()` reports the renderer and its reason together; the message is
1134
+ * English text that may name the adapter and
1145
1135
  * the driver version.
1146
1136
  * ```ts
1147
1137
  * const { rendering, renderingReason } = await plugin.app.system();