@vestra-player/sdk 1.5.57 → 1.5.58

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.58
4
+
5
+ **Who must change: nobody.** Documentation only: no change to the TypeScript API, the wire or `TestHost`, `apiVersion` stays `vestra/1`, no new capability, no player version needed. Plugin authors should read what the player's new plugin supervisor does with their plugin (player 0.6.6, and the defaults planned for 0.6.7), and check that `activate` never waits for its own commands or views.
6
+
7
+ - **The plugin supervisor, as a plugin sees it** ([How the player runs and talks to plugins](docs/explanation/host-and-node.md), [How a plugin runs](docs/explanation/plugins.md)). Player 0.6.6: a failed start is tried up to three more times; a built-in that crashes starts again by itself after 3 s, 6 s…; the fifth crash within 10 minutes stops a plugin until it is reloaded; an own process's JavaScript heap is capped at 512 MB (V8's heap only, not `Buffer` contents or addons), and passing it ends the process with "<name> ran out of memory"; a process that ended by itself gets no `runtime.stop`; without on-demand start a third-party plugin is listed as failed on its first crash, as before; at quit every plugin is stopped at once with 1 s in all; and two processes of one plugin never use its data directory at the same time. With on-demand start (lazy activation, `VESTRA_LAZY=1` in 0.6.6): a crashed plugin keeps its entries, shown disabled with the reason during a pause of 1 s, 2 s, 4 s…, and starts again on its next use (a resident plugin by itself); third-party plugins start a few at a time, clicks first; every start holds its clicks, resolutions, drops and view callbacks until `runtime.ready` (so an `activate` that awaits its own command or view callback waits until the start timeout); at most 64 are held per plugin, and one that cannot be taken is answered ("<name> is busy", "… could not start", "… is disabled") instead of dropped; busy work (a `busy` command, a dialog, a settings page shown, a resolution) keeps a plugin running with no time limit, and its idle time counts from when the work ends. Planned for player 0.6.7: on-demand start for everyone; a process budget for the machine's memory and the system's memory pressure put idle plugins in standby early, with the stop reason `idle`; idle time 30 s, start timeout 60 s, 5 s grace for a disable, uninstall, reload, upgrade or standby, a 5-minute cap on a player request awaiting the plugin's reply (a resolution; declared busy work stays uncapped), and a resident plugin never goes to standby. The source excerpts of host code that no longer exists (the lazy-activation trigger list, the 15-second activation record, the 250 ms idle poll, the stop's 5 ms poll) are replaced by descriptions of the current behaviour.
8
+ - **[Reference: limits › Plugin processes](docs/reference/limits.md#plugin-processes)**: heap cap, start timeout, retries, start limit, restart pauses, stop graces, quit, idle time, request timeout, start slots (`min(4, max(2, cores / 2))` plus a reserve for clicks), held triggers (64), waiting starts (256), the process budget (`clamp(physical MiB / 2 × 0.30 / 85, 3, 16)`) and the memory pressure thresholds (both planned for 0.6.7), for player 0.6.6 and as planned for 0.6.7.
9
+ - **`StopReason`** lists when each reason comes with the supervisor: `quit` also after a lost GPU device, `disable` clears session storage, `idle` also for the process budget and memory pressure (planned for 0.6.7; never for a busy plugin), `failed` also for a start timeout (possibly while `activate` runs) and, planned for 0.6.7, an unanswered request; a crash or running out of memory is no stop at all. The stop reasons are no longer described as planned: they shipped in player 0.6.4. **`PluginInfo.process`** `"idle"` also covers the pause after a crash before a plugin starts again. `Plugin`, `DisposeInfo` and [Store a plugin's data](docs/how-to/store-data.md) give the new stop graces.
10
+ - **`appearance.changed` says what changed** (player 0.6.6): `"changed": ["theme"]` or `["language"]` beside `theme` and `language`. This SDK does not read it yet; a later release uses it so that a plugin woken by a language change no longer hears its unchanged theme once.
11
+
3
12
  ## 1.5.57
4
13
 
5
14
  **Who must change: nobody.** The first npm release with 1.5.56's fix: no change to the TypeScript API or the wire, `apiVersion` stays `vestra/1`, no new capability, no player version needed.
Binary file
@@ -524,8 +524,10 @@ export interface Scope extends Disposable {
524
524
  * (menus, windows, panels, filters, subtitle layers, snapshots, jobs,
525
525
  * resolvers, streams); pending requests then fail with `disabled` and the
526
526
  * root scope is disposed for local cleanup (timers, signals, sockets). A
527
- * process that has not exited after 300 ms is killed. Media the plugin
528
- * opened with {@link Player.open} keeps playing.
527
+ * process that has not exited after its grace is killed: 300 ms in player
528
+ * 0.6.6 (2 s when it goes to standby), planned to be 5 s from player 0.6.7
529
+ * (300 ms after a fault); at quit all plugins together get 1 s. Media the
530
+ * plugin opened with {@link Player.open} keeps playing.
529
531
  *
530
532
  * @example Write a minimal plugin with one menu item
531
533
  * Tools ▸ Say hello, or Ctrl+H, shows "Hello from" and the plugin's id.
@@ -575,8 +577,8 @@ export interface Plugin extends Scope {
575
577
  */
576
578
  readonly dataDirectory: string;
577
579
  /**
578
- * Why the player stops this plugin (SDK 1.5.54; the reasons are planned
579
- * for player 0.6.4): set when the stop begins, before any
580
+ * Why the player stops this plugin (SDK 1.5.54, player 0.6.4): set when
581
+ * the stop begins, before any
580
582
  * {@link Scope.onDispose} cleanup runs. `undefined` while the plugin
581
583
  * runs, and for every stop by an older player (one whose own SDK is older
582
584
  * than 1.5.54 does not have the property at all). See {@link StopReason}.
@@ -587,23 +589,40 @@ export interface Plugin extends Scope {
587
589
  * Why the player stopped the plugin ({@link DisposeInfo.reason},
588
590
  * {@link Plugin.stopReason}).
589
591
  *
590
- * - `quit`: the player quits.
591
- * - `disable`: the user disabled the plugin.
592
+ * - `quit`: the player quits (or restarts after a lost GPU device). Every
593
+ * plugin is stopped at the same time, with 1 s in all (300 ms after a
594
+ * lost device; player 0.6.6).
595
+ * - `disable`: the user, or a plugin with `plugins.manage`, switched the
596
+ * plugin off. Its session storage is cleared.
592
597
  * - `uninstall`: the user uninstalls it.
593
598
  * - `reload`: it is reloaded (from the plugin manager, or a development
594
599
  * load with `--plugin`).
595
600
  * - `upgrade`: an install or update replaces the running version; also a
596
601
  * new version stopped because its install was cancelled (the previous
597
602
  * version comes back).
598
- * - `idle`: lazy activation parks it; its next use starts it again
603
+ * - `idle`: the plugin goes to standby and its next use starts it again;
604
+ * its menu items, keys, settings pages, resolvers and drop targets stay,
605
+ * and so does its session storage
599
606
  * ([Idle plugins](../../docs/explanation/plugins.md#idle-plugins-are-stopped)).
600
- * Lazy activation is off by default (`VESTRA_LAZY=1` turns it on); when
601
- * on, it parks a plugin after a while without use, and parks one whose
602
- * first run it judges lazy right after it is ready.
607
+ * Only with on-demand start (lazy activation), off by default up to
608
+ * player 0.6.6 (`VESTRA_LAZY=1` turns it on) and planned for everyone in
609
+ * player 0.6.7. It comes after the idle time without use (60 s; 30 s
610
+ * planned for 0.6.7), right after a first run that holds nothing live,
611
+ * and when the player's limit on third-party processes or low system
612
+ * memory puts an idle plugin in standby early (planned for 0.6.7). A busy
613
+ * plugin never gets it; a resident one (it held something live when it
614
+ * became ready) only after the idle time, and from player 0.6.7 (planned)
615
+ * never.
603
616
  * - `failed`: the player stops it for a fault it can still tell the plugin
604
- * about (planned to cover a malformed request, an unreadable or
605
- * oversized line, an activation timeout, an uncaught exception the
606
- * shared process attributes to this plugin).
617
+ * about: a malformed request, an unreadable or oversized line, a start
618
+ * that is not ready within the start timeout (15 s; 60 s planned for
619
+ * player 0.6.7; the stop may come while `activate` still runs), an
620
+ * uncaught exception the shared process attributes to this plugin, and,
621
+ * planned for player 0.6.7, a request from the player (a resolution) it
622
+ * leaves unanswered for 5 minutes. From player 0.6.6 the player may
623
+ * start it again afterwards (a built-in or resident plugin by itself, a
624
+ * plugin with on-demand start on its next use), until the fifth fault
625
+ * within 10 minutes.
607
626
  * - `host-lost`: the plugin's runner saw its pipe to the player close
608
627
  * without a stop: the player crashed or was killed. Requests are refused
609
628
  * with `disabled`; clean up locally only. Player 0.6.4 sends `quit` on a
@@ -614,20 +633,22 @@ export interface Plugin extends Scope {
614
633
  * {@link Scope.onDispose} cleanups do not run. That is the case when its
615
634
  * own process is killed because its input queue is full or a write to it
616
635
  * failed, when its own process fails to activate (the runner exits without
617
- * cleaning up), when the process has already exited, and when the shared
618
- * runner is restarted as a whole (a hang, a fault it cannot attribute, an
619
- * unreadable line of its own, a member's full input queue, the runner
620
- * exiting): every member is killed with it. Keep state that must survive
621
- * such an end in storage as it changes, not only in a cleanup.
622
- *
623
- * Planned for player 0.6.4: the player sends the reason with
624
- * `runtime.stop` and its runner reports `host-lost`; the exact list may
625
- * still change with that release. Players up to 0.6.3 give no reason for
626
- * any stop, a lost player included (`undefined`); so does a stop that
627
- * does not come from the player (a `TestHost` `stop()` without a reason).
628
- * A value this SDK does not know reads as `undefined`.
629
- *
630
- * @player 0.6.4 (planned); older players give no reason (`undefined`).
636
+ * cleaning up), when the process ended by itself (it crashed, or its
637
+ * JavaScript heap passed the 512 MB cap of player 0.6.6 and V8 ended it:
638
+ * "ran out of memory"), and when the shared runner is restarted as a whole
639
+ * (a hang, a fault it cannot attribute, an unreadable line of its own, a
640
+ * member's full input queue, the runner exiting): every member is killed
641
+ * with it. Keep state that must survive such an end in storage as it
642
+ * changes, not only in a cleanup. Timings and restarts are in
643
+ * [How the player runs and talks to plugins](../../docs/explanation/host-and-node.md#crashes-and-restarts).
644
+ *
645
+ * Player 0.6.4 and later send the reason with `runtime.stop`, and their
646
+ * runner reports `host-lost`. Players up to 0.6.3 give no reason for any
647
+ * stop, a lost player included (`undefined`); so does a stop that does not
648
+ * come from the player (a `TestHost` `stop()` without a reason). A value
649
+ * this SDK does not know reads as `undefined`.
650
+ *
651
+ * @player 0.6.4; older players give no reason (`undefined`).
631
652
  * @since 1.5.54
632
653
  * @category Plugin
633
654
  */
@@ -647,8 +668,9 @@ export interface DisposeInfo {
647
668
  */
648
669
  readonly stopping: boolean;
649
670
  /**
650
- * Why the player stops the plugin (planned for player 0.6.4); `undefined` while
651
- * `stopping` is false, and for every stop by an older player.
671
+ * Why the player stops the plugin (player 0.6.4; the causes are listed at
672
+ * {@link StopReason}); `undefined` while `stopping` is false, and for
673
+ * every stop by an older player.
652
674
  */
653
675
  readonly reason?: StopReason;
654
676
  }
@@ -8813,11 +8835,19 @@ export interface PluginInfo {
8813
8835
  display?: PluginDisplay;
8814
8836
  /**
8815
8837
  * For `state: "running"`: `"running"` while its process runs, `"idle"`
8816
- * while the player stopped it because nothing used it (lazy activation:
8817
- * it starts again on its next use, its menu items, keys, settings pages,
8818
- * resolvers and drop targets stay). Absent in other states and from
8819
- * players before 0.5.18. A change between the two alone does not fire
8820
- * {@link Packages.onChange}.
8838
+ * while the plugin is switched on but has no process. That is standby
8839
+ * with on-demand start (lazy activation): nothing used it for the idle
8840
+ * time, or the player's limit on third-party processes or low system
8841
+ * memory stopped it early (planned for player 0.6.7); it starts again on its next
8842
+ * use, and its menu items, keys, settings pages, resolvers and drop
8843
+ * targets stay. From player 0.6.6 it is also the pause after a crash: a
8844
+ * built-in or resident plugin waiting to start again by itself, or a
8845
+ * plugin with on-demand start whose commands are shown disabled with the
8846
+ * reason until the pause ends. Absent in other states and from players
8847
+ * before 0.5.18. A change between the two alone does not fire
8848
+ * {@link Packages.onChange}; a plugin stopped by the start limit (five
8849
+ * crashes within 10 minutes) is `state: "failed"` with that in
8850
+ * {@link PluginInfo.error}.
8821
8851
  *
8822
8852
  * @since 1.5.38
8823
8853
  */
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.5.57: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
3
+ > @vestra-player/sdk 1.5.58: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
4
4
 
5
5
  ## Read the documentation
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.5.57",
3
+ "version": "1.5.58",
4
4
  "description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {