@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
@@ -16,8 +16,6 @@ export interface PackageManifest {
16
16
  apiVersion: string;
17
17
  /** Entry module path inside the package. */
18
18
  entry: string;
19
- /** Declared capabilities. */
20
- capabilities: string[];
21
19
  /** Display name, 1–64 characters. */
22
20
  name?: string;
23
21
  /** Author, 1–64 characters. */
@@ -116,18 +114,15 @@ export interface InstallOptions {
116
114
  * Installing starts a {@link PackageChange}; the player keeps only the 32
117
115
  * most recent candidates.
118
116
  *
119
- * @capability plugins.manage
120
- *
121
117
  * @example Show what a package asks for before installing it
122
- * Before installing, the plugin shows the package's name and the
123
- * capabilities it declares. The candidate's `manifest` is the manifest
124
- * as the player read it.
118
+ * Before installing, the plugin shows the package's id and version. The
119
+ * candidate's `manifest` is the manifest as the player read it.
125
120
  * ```ts
126
121
  * declare const directory: string;
127
122
  * // ---cut---
128
123
  * const candidate = await plugin.packages.validate(directory);
129
- * const { id, version, capabilities } = candidate.manifest;
130
- * await plugin.osd.show("{} {}: {}", [id, version, capabilities.join(", ")]);
124
+ * const { id, version } = candidate.manifest;
125
+ * await plugin.osd.show("{} {}", [id, version]);
131
126
  * ```
132
127
  *
133
128
  * @since 1.0.0
@@ -151,7 +146,6 @@ export interface PackageCandidate {
151
146
  * update keeps a disabled plugin disabled unless `enabled` says otherwise
152
147
  * (see {@link InstallOptions.enabled}).
153
148
  *
154
- * @capability plugins.manage
155
149
  * @throws `invalid` (rejects) An option is malformed: a `source` the
156
150
  * player does not accept, or a `replace` or `enabled` that is not a
157
151
  * boolean.
@@ -166,8 +160,6 @@ export interface PackageCandidate {
166
160
  * needed).
167
161
  * @throws `stale` (rejects) The candidate is older than the 32 the player
168
162
  * keeps.
169
- * @throws `capability` (rejects) The manifest does not declare
170
- * `plugins.manage`.
171
163
  *
172
164
  * @example Replace a plugin installed from another source
173
165
  * The new package replaces the installed plugin even though it came from
@@ -213,8 +205,6 @@ export type PackageChangeStatus = "preparing" | "activating" | "restoring" | "co
213
205
  * resolves with the terminal status and does not reject for a failed
214
206
  * change: `message` says why.
215
207
  *
216
- * @capability plugins.manage
217
- *
218
208
  * @example Report each step of an install
219
209
  * The OSD shows each step of the install and the end result. `onChange`
220
210
  * runs for every new status; `done` resolves when the change is over.
@@ -237,8 +227,6 @@ export interface PackageChange {
237
227
  /**
238
228
  * The status changed.
239
229
  *
240
- * @capability plugins.manage
241
- *
242
230
  * @example Close a progress window when the change ends
243
231
  * The plugin's progress window closes once the install is over, whatever
244
232
  * the outcome. The listener receives each new status; the terminal ones
@@ -269,10 +257,6 @@ export interface PackageChange {
269
257
  /**
270
258
  * Ask to cancel (it may be `tooLate`).
271
259
  *
272
- * @capability plugins.manage
273
- * @throws `capability` (rejects) The manifest does not declare
274
- * `plugins.manage`.
275
- *
276
260
  * @example Cancel an install the user no longer wants
277
261
  * The install stops if it has not gone too far. `cancel` asks the player;
278
262
  * the change then ends `cancelled`. When the change had already committed
@@ -286,6 +270,7 @@ export interface PackageChange {
286
270
  * console.log(await change.done); // "cancelled"; "committed" when it was too late
287
271
  * ```
288
272
  *
273
+ * @throws `disabled` (rejects) The plugin is stopping.
289
274
  * @since 1.0.0
290
275
  */
291
276
  cancel(): Promise<void>;
@@ -307,8 +292,6 @@ export interface PluginInfo {
307
292
  state: "starting" | "running" | "disabled" | "failed" | "stopped";
308
293
  /** Why it failed (`state: "failed"`). */
309
294
  error: string | null;
310
- /** Declared capabilities. */
311
- capabilities: string[];
312
295
  /**
313
296
  * The package directory (read its `manifest.json` for display fields).
314
297
  * A built-in's directory is inside the player installation
@@ -407,8 +390,8 @@ export interface PluginWarning {
407
390
  owner?: string;
408
391
  }
409
392
  /**
410
- * `plugin.packages`: the plugins the player knows. `list` and `onChange`
411
- * need no capability; everything else needs `plugins.manage`.
393
+ * `plugin.packages`: the plugins the player knows, and installing,
394
+ * enabling, reloading and uninstalling them.
412
395
  *
413
396
  * @example Install a plugin from an unpacked package
414
397
  * The plugin installs a package directory it downloaded and unpacked, and
@@ -428,25 +411,22 @@ export interface PluginWarning {
428
411
  *
429
412
  * @remarks
430
413
  * The plugins the player knows: installed, built-in and this run's
431
- * development loads. Reading the list needs no capability; installing,
432
- * enabling, reloading and uninstalling need `plugins.manage` and act on
433
- * other plugins, never on the calling one. Built-in plugins update with
414
+ * development loads. Installing, enabling,
415
+ * reloading and uninstalling act on other plugins, never on the calling one. Built-in plugins update with
434
416
  * the player and cannot be installed, disabled or uninstalled.
435
417
  *
436
- * @capability None for `list` and `onChange`; plugins.manage for the rest.
437
418
  * @since 1.0.0
438
419
  * @category Packages
439
420
  */
440
421
  export interface Packages {
441
422
  /**
442
- * Validate a package directory (`plugins.manage`). A package whose id is
423
+ * Validate a package directory. A package whose id is
443
424
  * reserved for the built-in plugins (`vestra` or `vestra.*`) fails with
444
425
  * `reserved`.
445
426
  *
446
427
  * The player keeps the 32 most recent candidates of all plugins; an older
447
428
  * one's `install` fails with `stale` (validate again).
448
429
  *
449
- * @capability plugins.manage
450
430
  * @throws `host` (rejects) Not a package directory, or a manifest that
451
431
  * breaks the rules (another `apiVersion` included); `message` says why.
452
432
  * @throws `invalid` (rejects) A bad request (a path that is not a string).
@@ -456,8 +436,6 @@ export interface Packages {
456
436
  * @throws `versionMismatch` (rejects) The package's `minPlayerVersion` is
457
437
  * newer than the player.
458
438
  * @throws `disabled` (rejects) The calling plugin is stopping.
459
- * @throws `capability` (rejects) The manifest does not declare
460
- * `plugins.manage`.
461
439
  *
462
440
  * @example Check a package directory before installing it
463
441
  * The plugin checks a folder it unpacked and installs it if the player
@@ -479,12 +457,11 @@ export interface Packages {
479
457
  */
480
458
  validate(directory: string): Promise<PackageCandidate>;
481
459
  /**
482
- * Validate a `.vxp` package file (`plugins.manage`): the same checks as
460
+ * Validate a `.vxp` package file: the same checks as
483
461
  * {@link Packages.validate} after unpacking. Check the file's sha256 yourself
484
462
  * before calling when you know it. A reserved id fails with `reserved`, as in
485
463
  * {@link Packages.validate}.
486
464
  *
487
- * @capability plugins.manage
488
465
  * @throws `invalid` (rejects) The path does not end in `.vxp`, or the
489
466
  * archive cannot be unpacked (over 64 MB, too many files, a damaged zip,
490
467
  * an unsafe path).
@@ -496,8 +473,6 @@ export interface Packages {
496
473
  * @throws `versionMismatch` (rejects) The package's `minPlayerVersion` is
497
474
  * newer than the player.
498
475
  * @throws `disabled` (rejects) The calling plugin is stopping.
499
- * @throws `capability` (rejects) The manifest does not declare
500
- * `plugins.manage`.
501
476
  *
502
477
  * @example Install a downloaded package file
503
478
  * A `.vxp` the plugin downloaded is checked and installed. The player
@@ -515,11 +490,9 @@ export interface Packages {
515
490
  */
516
491
  validateArchive(file: string): Promise<PackageCandidate>;
517
492
  /**
518
- * Every plugin: running, installed, and this run's development loads. No capability.
493
+ * Every plugin: running, installed, and this run's development loads.
519
494
  *
520
- * @capability None.
521
- * @throws `Error` (rejects) Only when the player cannot be asked; no
522
- * capability is needed.
495
+ * @throws `Error` (rejects) Only when the player cannot be asked.
523
496
  *
524
497
  * @example Show which plugins are running
525
498
  * The plugin lists the running plugins by name. `list` asks the player
@@ -535,9 +508,7 @@ export interface Packages {
535
508
  */
536
509
  list(): Promise<PluginInfo[]>;
537
510
  /**
538
- * The new list after any start, stop, failure, install or uninstall. No capability.
539
- *
540
- * @capability None.
511
+ * The new list after any start, stop, failure, install or uninstall.
541
512
  *
542
513
  * @example Refresh a plugin list after any change
543
514
  * A store window's list updates when a plugin starts, stops, fails, is
@@ -550,19 +521,16 @@ export interface Packages {
550
521
  */
551
522
  onChange(listener: (plugins: PluginInfo[]) => void): Disposable;
552
523
  /**
553
- * Stop or start a plugin (`plugins.manage`). An installed plugin stays
524
+ * Stop or start a plugin. An installed plugin stays
554
525
  * disabled across launches; a development load only for this run.
555
526
  * `invalid` to disable oneself, `missing` unknown.
556
527
  * `busy` while it is being installed or reloaded. `unsupported` to disable a built-in
557
528
  * ({@link PluginInfo.builtin}): users manage third-party plugins only.
558
529
  *
559
- * @capability plugins.manage
560
530
  * @throws `invalid` (rejects) Disabling the calling plugin itself.
561
531
  * @throws `missing` (rejects) An unknown id.
562
532
  * @throws `busy` (rejects) The plugin is being installed or reloaded.
563
533
  * @throws `unsupported` (rejects) A built-in plugin.
564
- * @throws `capability` (rejects) The manifest does not declare
565
- * `plugins.manage`.
566
534
  *
567
535
  * @example Turn a third-party plugin off
568
536
  * The plugin stops another plugin and keeps it disabled across launches
@@ -576,7 +544,7 @@ export interface Packages {
576
544
  */
577
545
  setEnabled(id: string, enabled: boolean): Promise<void>;
578
546
  /**
579
- * Restart a plugin (`plugins.manage`): stop it and start it again from the
547
+ * Restart a plugin: stop it and start it again from the
580
548
  * same package with the same data directory, for example to recover one
581
549
  * that misbehaves. Built-ins included. A stopped or failed plugin is just
582
550
  * started. The disabled flag is never written, so a reload never leaves
@@ -593,14 +561,11 @@ export interface Packages {
593
561
  * @player 0.5.1
594
562
  * @since 1.5.19
595
563
  *
596
- * @capability plugins.manage
597
564
  * @throws `invalid` (rejects) The calling plugin itself, or a disabled
598
565
  * plugin.
599
566
  * @throws `missing` (rejects) An unknown id.
600
567
  * @throws `busy` (rejects) The plugin is being installed or reloaded.
601
568
  * @throws `unsupported` (rejects) A player before 0.5.1.
602
- * @throws `capability` (rejects) The manifest does not declare
603
- * `plugins.manage`.
604
569
  *
605
570
  * @example Restart a plugin that misbehaves
606
571
  * The other plugin is stopped and started again from the same package and
@@ -612,13 +577,12 @@ export interface Packages {
612
577
  */
613
578
  reload(id: string): Promise<void>;
614
579
  /**
615
- * Remove an installed plugin (`plugins.manage`); `removeData` also deletes
580
+ * Remove an installed plugin; `removeData` also deletes
616
581
  * its data directory, otherwise reinstalling it from the same source
617
582
  * reconnects to its data. Its user bindings stay (as orphans).
618
583
  * `unsupported` for built-ins and development loads, `missing`
619
584
  * unknown, `invalid` for oneself.
620
585
  *
621
- * @capability plugins.manage
622
586
  * @throws `unsupported` (rejects) A built-in plugin or a development load.
623
587
  * @throws `missing` (rejects) An unknown id.
624
588
  * @throws `invalid` (rejects) The calling plugin itself.
@@ -626,8 +590,6 @@ export interface Packages {
626
590
  * plugin is being installed or reloaded.
627
591
  * @throws `revisionConflict` (rejects) The installed revision of that
628
592
  * plugin changed meanwhile; call `uninstall` again.
629
- * @throws `capability` (rejects) The manifest does not declare
630
- * `plugins.manage`.
631
593
  *
632
594
  * @example Uninstall a plugin together with its data
633
595
  * The other plugin is removed and its data directory deleted, so a later