@vestra-player/sdk 1.7.13 → 1.7.14
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 +7 -0
- package/dist/commands.js +1 -1
- package/dist/docs-tree.json.gz +0 -0
- package/dist/plugin/testing/commands.d.ts +12 -0
- package/dist/plugin/testing/commands.js +29 -9
- package/dist/plugin/testing/index.js +2 -1
- package/dist/plugin/types/commands.d.ts +5 -0
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.14
|
|
4
|
+
|
|
5
|
+
**Who must change: nobody.** A product-data refresh and a `TestHost` follow-up to player 0.8.0: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
|
|
6
|
+
|
|
7
|
+
- **`BUILTIN_COMMANDS`** (`vestra.workshop`, player a08759b0: Ask Vestra runs commands only): `askvestra.undo` (Undo Last Request) is gone; `askvestra.working` (Vestra is working) is new, `focus: "panel"`, in no menu, palette or bar (the plugin keeps itself busy with it while a request runs). The table in [Reference: commands](docs/reference/commands.md#built-in-commands) follows.
|
|
8
|
+
- **`bindings.list`** (player 0.8.0): a `focus: "panel"` command of a plugin whose manifest declares no `ui.mount` is left out, since no key can reach it; it stays declared, so its stored binding is not an orphan and `bindings.set` accepts it. `Bindings.list` says so, and `TestHost` follows for the plugin under test (from its manifest; a `TestHost` used without `startPlugin` lists every command as before). Test: `test/round3a.test.ts`.
|
|
9
|
+
|
|
3
10
|
## 1.7.13
|
|
4
11
|
|
|
5
12
|
**Who must change: nobody.** A product-data refresh of the Slint library copy: no API change, `apiVersion` stays `vestra/1`, the API surface snapshot is unchanged.
|
package/dist/commands.js
CHANGED
|
@@ -601,8 +601,8 @@ vestra.video | video.hue.down | (Hue -1%) | I
|
|
|
601
601
|
vestra.video | video.hue.up | (Hue +1%) | O
|
|
602
602
|
vestra.video | video.gpu-rendering | (GPU Rendering)
|
|
603
603
|
vestra.video | video.upscaling | (AI Upscaling)
|
|
604
|
-
vestra.workshop | askvestra.undo | (Undo Last Request)
|
|
605
604
|
vestra.workshop | askvestra.stop | (Stop)
|
|
605
|
+
vestra.workshop | askvestra.working | (Vestra is working) | | panel
|
|
606
606
|
`;
|
|
607
607
|
/**
|
|
608
608
|
* The commands the player and its built-in plugins register when the
|
package/dist/docs-tree.json.gz
CHANGED
|
Binary file
|
|
@@ -23,6 +23,18 @@ export declare function splitCommandKey(_host: TestHost, _inner: Internals, key:
|
|
|
23
23
|
plugin: string;
|
|
24
24
|
command: string;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* The capabilities of the plugin under test's manifest, set by
|
|
28
|
+
* `startPlugin`; a host without an entry (requests sent by hand) lists
|
|
29
|
+
* every command in `bindings.list`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const pluginCapabilities: WeakMap<TestHost, readonly string[]>;
|
|
32
|
+
/**
|
|
33
|
+
* `bindings.list`, as the player's (binding_manager.rs `list`, player
|
|
34
|
+
* 0.8.0): a `focus: "panel"` command of a plugin whose manifest declares no
|
|
35
|
+
* `ui.mount` can never fire from a key, so it is left out; it stays declared
|
|
36
|
+
* (its stored binding is no orphan, `bindings.set` accepts it).
|
|
37
|
+
*/
|
|
26
38
|
export declare function bindingTable(host: TestHost, inner: Internals): {
|
|
27
39
|
commands: {
|
|
28
40
|
title: string;
|
|
@@ -87,7 +87,34 @@ export function splitCommandKey(_host, _inner, key) {
|
|
|
87
87
|
const at = key.indexOf("/");
|
|
88
88
|
return { plugin: key.slice(0, at), command: key.slice(at + 1) };
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The capabilities of the plugin under test's manifest, set by
|
|
92
|
+
* `startPlugin`; a host without an entry (requests sent by hand) lists
|
|
93
|
+
* every command in `bindings.list`.
|
|
94
|
+
*/
|
|
95
|
+
export const pluginCapabilities = new WeakMap();
|
|
96
|
+
/**
|
|
97
|
+
* `bindings.list`, as the player's (binding_manager.rs `list`, player
|
|
98
|
+
* 0.8.0): a `focus: "panel"` command of a plugin whose manifest declares no
|
|
99
|
+
* `ui.mount` can never fire from a key, so it is left out; it stays declared
|
|
100
|
+
* (its stored binding is no orphan, `bindings.set` accepts it).
|
|
101
|
+
*/
|
|
90
102
|
export function bindingTable(host, inner) {
|
|
103
|
+
const all = bindingRows(host, inner);
|
|
104
|
+
const capabilities = pluginCapabilities.get(host);
|
|
105
|
+
const hidden = capabilities !== undefined && !capabilities.includes("ui.mount");
|
|
106
|
+
const declared = new Set(all.map((c) => `${c.plugin}/${c.command}`));
|
|
107
|
+
const commands = all.filter((c) => !(hidden && c.scope === "panel" && c.plugin === host.manifestId));
|
|
108
|
+
const orphans = [...host.bindings.overlay]
|
|
109
|
+
.filter(([key]) => !declared.has(key))
|
|
110
|
+
.map(([key, inputs]) => ({
|
|
111
|
+
ref: splitCommandKey(host, inner, key),
|
|
112
|
+
inputs,
|
|
113
|
+
}));
|
|
114
|
+
return { commands, orphans };
|
|
115
|
+
}
|
|
116
|
+
/** Every command's row of the binding table, bindable or not. */
|
|
117
|
+
function bindingRows(host, inner) {
|
|
91
118
|
const claims = bindingClaims(host, inner);
|
|
92
119
|
const commands = [...host.coreCommands, ...host.commands].map(([id, { declaration }]) => {
|
|
93
120
|
const key = bindingKey(host, inner, id);
|
|
@@ -124,14 +151,7 @@ export function bindingTable(host, inner) {
|
|
|
124
151
|
labels: [...current],
|
|
125
152
|
};
|
|
126
153
|
});
|
|
127
|
-
|
|
128
|
-
const orphans = [...host.bindings.overlay]
|
|
129
|
-
.filter(([key]) => !declared.has(key))
|
|
130
|
-
.map(([key, inputs]) => ({
|
|
131
|
-
ref: splitCommandKey(host, inner, key),
|
|
132
|
-
inputs,
|
|
133
|
-
}));
|
|
134
|
-
return { commands, orphans };
|
|
154
|
+
return commands;
|
|
135
155
|
}
|
|
136
156
|
/** A command's state as the player shows it: its conditions evaluated. */
|
|
137
157
|
export function commandShown(host, _inner, sent, when) {
|
|
@@ -393,7 +413,7 @@ export function commandsHandlers(host, inner) {
|
|
|
393
413
|
"bindings.list": () => bindingTable(host, inner),
|
|
394
414
|
"bindings.set": (p) => {
|
|
395
415
|
const key = `${p.plugin}/${p.command}`;
|
|
396
|
-
const known =
|
|
416
|
+
const known = bindingRows(host, inner).some((c) => `${c.plugin}/${c.command}` === key);
|
|
397
417
|
if (!known && !host.bindings.overlay.has(key))
|
|
398
418
|
throw new HostError("missing", `no command ${key}`);
|
|
399
419
|
host.bindings.overlay.set(key, [...p.inputs]);
|
|
@@ -85,7 +85,7 @@ import { PATCH_FEATURE } from "../patch.js";
|
|
|
85
85
|
import { LOCALES, LIST_SEPARATORS, loadPackageCatalog, TEXT_LIMITS, } from "../../i18n.js";
|
|
86
86
|
import { Internals } from "./internals.js";
|
|
87
87
|
import { on, emit, settle, close, keepsRunning, transportHandlers, tick, takenErrors, tellResidency, } from "./transport.js";
|
|
88
|
-
import { bindingClaims, bindingKey, keysChanged, press, barButtons, commandsHandlers, builtinHandlers, runPaletteLead, } from "./commands.js";
|
|
88
|
+
import { bindingClaims, bindingKey, keysChanged, press, barButtons, commandsHandlers, builtinHandlers, runPaletteLead, pluginCapabilities, } from "./commands.js";
|
|
89
89
|
import { registerCoreActions, windowFacts, coreActionsHandlers, } from "./core-actions.js";
|
|
90
90
|
import { translate, i18nHandlers } from "./i18n.js";
|
|
91
91
|
import { mountOther, unmountOther, mounted, setTimelineRanges, setTimelineLayer, layoutHandlers, } from "./layout.js";
|
|
@@ -2840,6 +2840,7 @@ export async function startPlugin(activate, options = {}) {
|
|
|
2840
2840
|
manifest = { id: read.id, capabilities: read.capabilities };
|
|
2841
2841
|
}
|
|
2842
2842
|
host.manifestId = manifest.id;
|
|
2843
|
+
pluginCapabilities.set(host, manifest.capabilities);
|
|
2843
2844
|
if (options.builtin)
|
|
2844
2845
|
host.builtin = true;
|
|
2845
2846
|
host.loadCatalog(directory);
|
|
@@ -1471,6 +1471,11 @@ export interface Bindings {
|
|
|
1471
1471
|
/**
|
|
1472
1472
|
* Every declared command, and overrides whose command is gone.
|
|
1473
1473
|
*
|
|
1474
|
+
* A `focus: "panel"` command of a plugin whose manifest does not declare
|
|
1475
|
+
* `ui.mount` is left out (player 0.8.0): it has no panel, so no key can
|
|
1476
|
+
* reach it. It is still declared: its stored binding is not an orphan,
|
|
1477
|
+
* and `set` accepts it.
|
|
1478
|
+
*
|
|
1474
1479
|
* @capability bindings.manage
|
|
1475
1480
|
* @throws `capability` (rejects) The manifest does not declare
|
|
1476
1481
|
* `bindings.manage`.
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vestra Player SDK
|
|
2
2
|
|
|
3
|
-
> @vestra-player/sdk 1.7.
|
|
3
|
+
> @vestra-player/sdk 1.7.14: 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
|
|