@vestra-player/sdk 1.7.20 → 1.9.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 (96) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +2 -2
  3. package/bin/vestra-plugin.mjs +139 -100
  4. package/capability-scan.json +369 -0
  5. package/dist/api-requests.d.ts +11 -36
  6. package/dist/api-requests.js +22 -47
  7. package/dist/capability-scan.d.ts +95 -0
  8. package/dist/capability-scan.js +249 -0
  9. package/dist/commands.d.ts +35 -0
  10. package/dist/commands.js +42 -1
  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/index.d.ts +4 -5
  15. package/dist/manifest.d.ts +5 -0
  16. package/dist/manifest.js +9 -24
  17. package/dist/member-uses.d.ts +61 -0
  18. package/dist/member-uses.js +160 -0
  19. package/dist/mpv.d.ts +139 -0
  20. package/dist/mpv.js +496 -0
  21. package/dist/player-runtime.d.ts +3 -3
  22. package/dist/player-runtime.js +3 -3
  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 +6 -14
  28. package/dist/plugin/connection.d.ts +26 -7
  29. package/dist/plugin/connection.js +68 -36
  30. package/dist/plugin/drops.js +1 -1
  31. package/dist/plugin/index.js +9 -15
  32. package/dist/plugin/media.js +0 -12
  33. package/dist/plugin/mpv.d.ts +3 -0
  34. package/dist/plugin/mpv.js +91 -0
  35. package/dist/plugin/packages.js +1 -2
  36. package/dist/plugin/player/events.d.ts +4 -3
  37. package/dist/plugin/player/events.js +7 -6
  38. package/dist/plugin/player.d.ts +21 -13
  39. package/dist/plugin/player.js +56 -21
  40. package/dist/plugin/scope.d.ts +1 -0
  41. package/dist/plugin/scope.js +2 -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 +43 -24
  50. package/dist/plugin/testing/index.d.ts +75 -114
  51. package/dist/plugin/testing/index.js +83 -102
  52. package/dist/plugin/testing/mpv.d.ts +7 -0
  53. package/dist/plugin/testing/mpv.js +90 -0
  54. package/dist/plugin/testing/processing.js +1 -1
  55. package/dist/plugin/testing/services.js +0 -1
  56. package/dist/plugin/timeline.d.ts +2 -3
  57. package/dist/plugin/timeline.js +4 -8
  58. package/dist/plugin/types/base.d.ts +49 -88
  59. package/dist/plugin/types/commands.d.ts +44 -77
  60. package/dist/plugin/types/packages.d.ts +17 -55
  61. package/dist/plugin/types/playback.d.ts +302 -135
  62. package/dist/plugin/types/plugin-wire.d.ts +6 -36
  63. package/dist/plugin/types/processing.d.ts +10 -49
  64. package/dist/plugin/types/services.d.ts +11 -70
  65. package/dist/plugin/types/snapshots.d.ts +7 -60
  66. package/dist/plugin/types/sources.d.ts +2 -11
  67. package/dist/plugin/types/subtitles.d.ts +5 -26
  68. package/dist/plugin/types/ui-content.d.ts +1 -16
  69. package/dist/plugin/types/ui-layout.d.ts +53 -79
  70. package/dist/plugin/types/ui-locale.d.ts +5 -23
  71. package/dist/plugin/types/ui-shell.d.ts +13 -59
  72. package/dist/plugin/view/layout.js +1 -1
  73. package/dist/plugin/view.js +0 -2
  74. package/dist/plugin/window.d.ts +1 -1
  75. package/dist/plugin/window.js +1 -1
  76. package/dist/plugin/wire-facade.js +1 -2
  77. package/dist/processing.d.ts +2 -3
  78. package/dist/protocol.d.ts +14 -0
  79. package/dist/protocol.js +14 -0
  80. package/dist/request-queue.js +1 -1
  81. package/dist/subtitles.d.ts +1 -1
  82. package/dist/ts-plugin.d.ts +8 -15
  83. package/dist/ts-plugin.js +3 -141
  84. package/dist/wire.d.ts +22 -12
  85. package/dist/wire.js +17 -8
  86. package/llms.txt +5 -5
  87. package/package.json +4 -3
  88. package/slint/vestra/widgets.slint +12 -4
  89. package/dist/capabilities.d.ts +0 -107
  90. package/dist/capabilities.js +0 -69
  91. package/dist/capability-check.d.ts +0 -133
  92. package/dist/capability-check.js +0 -371
  93. package/dist/capability-rules.d.ts +0 -125
  94. package/dist/capability-rules.js +0 -192
  95. package/dist/host-capabilities.d.ts +0 -10
  96. package/dist/host-capabilities.js +0 -477
@@ -0,0 +1,369 @@
1
+ {
2
+ "about": "The capability scan's table (docs/reference/scan.md): which API members and which requests of the player's protocol cross a boundary the user should know about, by category. Hand-maintained: every method of the public API is in exactly one list, a category's or none's, and every request the SDK sends has a category by name or prefix (test/capability-scan.test.ts). `vestra-plugin scan` reports the categories a plugin uses. It changes nothing at run time; since SDK 1.9.0 it is the only disclosure (manifests declare nothing).",
3
+ "version": 1,
4
+ "categories": {
5
+ "player": {
6
+ "about": "Changes the user's own player settings, or the player beyond what the plugin itself contributes: shortcuts, theme, language, rendering mode, a restart, mpv driven directly.",
7
+ "members": [
8
+ "Appearance.set",
9
+ "Appearance.setLanguage",
10
+ "Bindings.reset",
11
+ "Bindings.set",
12
+ "Mpv.command",
13
+ "Mpv.set",
14
+ "Rendering.restartPlayer",
15
+ "Rendering.setPreference"
16
+ ],
17
+ "requests": [
18
+ "appearance.set",
19
+ "appearance.setLanguage",
20
+ "bindings.reset",
21
+ "bindings.set",
22
+ "mpv.command",
23
+ "mpv.set",
24
+ "rendering.restart",
25
+ "rendering.setPreference"
26
+ ]
27
+ },
28
+ "plugins": {
29
+ "about": "Acts on other plugins: installs, uninstalls, disables or reloads them, or runs any command, theirs included.",
30
+ "members": [
31
+ "Commands.run",
32
+ "PackageCandidate.install",
33
+ "Packages.reload",
34
+ "Packages.setEnabled",
35
+ "Packages.uninstall",
36
+ "Packages.validate",
37
+ "Packages.validateArchive"
38
+ ],
39
+ "requests": ["commands.run", "packages.*"]
40
+ },
41
+ "clipboard": {
42
+ "about": "Reads or writes the system clipboard.",
43
+ "members": [
44
+ "Clipboard.readText",
45
+ "Clipboard.writeImage",
46
+ "Clipboard.writeText"
47
+ ],
48
+ "requests": [
49
+ "clipboard.readText",
50
+ "clipboard.writeImage",
51
+ "clipboard.writeText"
52
+ ]
53
+ },
54
+ "credentials": {
55
+ "about": "Reads or writes sign-in details in the system keychain.",
56
+ "members": ["Secrets.delete", "Secrets.get", "Secrets.set"],
57
+ "requests": ["secrets.delete", "secrets.get", "secrets.set"]
58
+ },
59
+ "camera": {
60
+ "about": "Uses a camera. No member of the API does today.",
61
+ "members": [],
62
+ "requests": []
63
+ },
64
+ "microphone": {
65
+ "about": "Records from a microphone. No member of the API does today.",
66
+ "members": [],
67
+ "requests": []
68
+ },
69
+ "screen": {
70
+ "about": "Captures the screen or other windows. No member of the API does today (a snapshot or an export is of the playing video).",
71
+ "members": [],
72
+ "requests": []
73
+ },
74
+ "notifications": {
75
+ "about": "Shows system notifications. No member of the API does today (a message on the video is the plugin's own).",
76
+ "members": [],
77
+ "requests": []
78
+ }
79
+ },
80
+ "none": {
81
+ "about": "Crosses no such boundary: the plugin's own contributions, the playback session, reading state.",
82
+ "members": [
83
+ "App.system",
84
+ "BackdropSlot.onChange",
85
+ "Bindings.list",
86
+ "Bindings.onChange",
87
+ "Command.set",
88
+ "CommandOptions.run",
89
+ "Commands.add",
90
+ "Commands.keys",
91
+ "Commands.list",
92
+ "Condition.and",
93
+ "Condition.not",
94
+ "Condition.or",
95
+ "Dialogs.confirm",
96
+ "Dialogs.openDirectory",
97
+ "Dialogs.openFile",
98
+ "Dialogs.openFiles",
99
+ "Dialogs.saveFile",
100
+ "Disposable.dispose",
101
+ "DropHandler.drop",
102
+ "Drops.provide",
103
+ "ExportJob.cancel",
104
+ "ExportJob.onChange",
105
+ "ExportJob.refresh",
106
+ "FileResolverOptions.resolve",
107
+ "Host.run",
108
+ "I18n.error",
109
+ "I18n.list",
110
+ "I18n.resolve",
111
+ "I18n.text",
112
+ "JsonStore.flush",
113
+ "JsonStore.save",
114
+ "MainWindow.onChange",
115
+ "MainWindow.setAlwaysOnTop",
116
+ "MainWindow.setCursorAutoHide",
117
+ "MainWindow.setPictureInPicture",
118
+ "MainWindow.setVideoArea",
119
+ "Media.close",
120
+ "Media.onEnd",
121
+ "Media.ready",
122
+ "MediaCapture.capture",
123
+ "MediaCapture.export",
124
+ "MediaCapture.exportCheck",
125
+ "MediaSources.forget",
126
+ "MediaSources.get",
127
+ "MediaSources.list",
128
+ "MediaSources.locate",
129
+ "MediaSources.open",
130
+ "MediaSources.remember",
131
+ "Mpv.get",
132
+ "Mpv.observe",
133
+ "Osd.panel",
134
+ "Osd.show",
135
+ "OsdPanel.set",
136
+ "PackageChange.cancel",
137
+ "PackageChange.onChange",
138
+ "Packages.list",
139
+ "Packages.onChange",
140
+ "Palette.lead",
141
+ "PaletteLead.done",
142
+ "PaletteLead.onRun",
143
+ "PaletteLead.update",
144
+ "Panel.onChange",
145
+ "Panel.onDrop",
146
+ "Panel.setInteraction",
147
+ "Panel.show",
148
+ "Panel.showMenu",
149
+ "Panel.toggle",
150
+ "PanelSlot.activate",
151
+ "PanelSlot.onChange",
152
+ "PanelSlot.setVisible",
153
+ "PanelSlot.toggle",
154
+ "Panels.mount",
155
+ "Player.addAudioTrack",
156
+ "Player.audioDevices",
157
+ "Player.chapters",
158
+ "Player.close",
159
+ "Player.isCurrent",
160
+ "Player.next",
161
+ "Player.on",
162
+ "Player.onChange",
163
+ "Player.open",
164
+ "Player.openStream",
165
+ "Player.previous",
166
+ "Player.provideSequence",
167
+ "Player.read",
168
+ "Player.refresh",
169
+ "Player.restart",
170
+ "Player.scrub",
171
+ "Player.seek",
172
+ "Player.selectAudioTrack",
173
+ "Player.setAudioDevice",
174
+ "Player.setLoop",
175
+ "Player.setOutput",
176
+ "Player.setPaused",
177
+ "Player.setRate",
178
+ "Player.setStepSeek",
179
+ "Player.stats",
180
+ "Player.step",
181
+ "Player.subscribe",
182
+ "Power.preventSleep",
183
+ "RenderOptions.onStatus",
184
+ "RenderOptions.set",
185
+ "Rendering.state",
186
+ "ResolvedStream.frame",
187
+ "ResolvedStream.started",
188
+ "Resolvers.add",
189
+ "Scope.add",
190
+ "Scope.audio.filter",
191
+ "Scope.onDispose",
192
+ "Scope.onError",
193
+ "Scope.scope",
194
+ "Scope.state",
195
+ "Scope.update",
196
+ "Scope.video.filter",
197
+ "Scope.video.motion",
198
+ "Scope.video.render",
199
+ "Scope.video.shaders",
200
+ "Scope.video.view",
201
+ "Scrub.end",
202
+ "Scrub.seek",
203
+ "SequenceProvider.next",
204
+ "SequenceProvider.previous",
205
+ "SessionStorage.delete",
206
+ "SessionStorage.get",
207
+ "SessionStorage.keys",
208
+ "SessionStorage.set",
209
+ "Settings.page",
210
+ "Settings.show",
211
+ "SidebarSlot.setDetached",
212
+ "Snapshot.export",
213
+ "Storage.json",
214
+ "Stream.onStop",
215
+ "Stream.stop",
216
+ "StreamOptions.frame",
217
+ "Subtitles.load",
218
+ "Subtitles.onChange",
219
+ "Subtitles.refresh",
220
+ "Subtitles.remove",
221
+ "Subtitles.select",
222
+ "Subtitles.setStyle",
223
+ "System.openPath",
224
+ "System.openUrl",
225
+ "System.reveal",
226
+ "Timeline.layer",
227
+ "TimelineLayer.set",
228
+ "TimelineLayer.setRanges",
229
+ "Tools.available",
230
+ "Tools.run",
231
+ "Ui.image",
232
+ "Ui.markdown",
233
+ "Ui.remoteImage",
234
+ "VideoMotion.onChange",
235
+ "VideoMotion.set",
236
+ "VideoMotion.state",
237
+ "VideoShaders.clear",
238
+ "VideoShaders.onStatus",
239
+ "VideoShaders.set",
240
+ "VideoUpscaling.onChange",
241
+ "VideoUpscaling.set",
242
+ "VideoUpscaling.state",
243
+ "VideoView.onStatus",
244
+ "VideoView.set",
245
+ "View.bind",
246
+ "View.on",
247
+ "View.set",
248
+ "WebResolverOptions.resolve",
249
+ "When.can",
250
+ "When.language",
251
+ "When.phase",
252
+ "When.theme",
253
+ "Window.close",
254
+ "Window.hide",
255
+ "Window.onClose",
256
+ "Window.show",
257
+ "Windows.create",
258
+ "Wire.on",
259
+ "Wire.request",
260
+ "Wire.view",
261
+ "WireCommand.update",
262
+ "WireCommands.register",
263
+ "WireView.write",
264
+ "WireView.writeRows"
265
+ ],
266
+ "requests": [
267
+ "app.system",
268
+ "audio.addTrack",
269
+ "audio.selectTrack",
270
+ "bindings.list",
271
+ "commands.keys",
272
+ "commands.list",
273
+ "commands.register",
274
+ "commands.unregister",
275
+ "commands.update",
276
+ "dialogs.confirm",
277
+ "dialogs.open",
278
+ "drops.listen",
279
+ "drops.provide",
280
+ "drops.withdraw",
281
+ "events.subscribe",
282
+ "events.unsubscribe",
283
+ "host.run",
284
+ "jobs.*",
285
+ "jobs.operation",
286
+ "jobs.state",
287
+ "layout.set",
288
+ "layout.state",
289
+ "media.sources.*",
290
+ "media.sources.open",
291
+ "mpv.get",
292
+ "mpv.observe",
293
+ "mpv.unobserve",
294
+ "osd.panel",
295
+ "osd.show",
296
+ "packages.list",
297
+ "palette.lead.clear",
298
+ "palette.lead.done",
299
+ "palette.lead.set",
300
+ "playback.set",
301
+ "playback.stats",
302
+ "player.audioDevices",
303
+ "player.chapters",
304
+ "player.setAudioDevice",
305
+ "player.setLoop",
306
+ "player.setStepSeek",
307
+ "player.step",
308
+ "power.preventSleep",
309
+ "processing.operation",
310
+ "processing.replace",
311
+ "processing.state",
312
+ "producer.ack",
313
+ "producer.ackInput",
314
+ "producer.declareInput",
315
+ "producer.prepare",
316
+ "producer.release",
317
+ "producer.state",
318
+ "rendering.state",
319
+ "sequence.set",
320
+ "sequence.step",
321
+ "settings.*",
322
+ "snapshot.*",
323
+ "snapshot.state",
324
+ "source.operation",
325
+ "source.state",
326
+ "source.submit",
327
+ "sourceResolvers.*",
328
+ "sourceResolvers.register",
329
+ "sourceResolvers.respond",
330
+ "sourceResolvers.unregister",
331
+ "storage.session.delete",
332
+ "storage.session.get",
333
+ "storage.session.keys",
334
+ "storage.session.set",
335
+ "subtitles.*",
336
+ "subtitles.state",
337
+ "system.openPath",
338
+ "system.openUrl",
339
+ "system.reveal",
340
+ "timeline.marks",
341
+ "timeline.set",
342
+ "timeline.setRanges",
343
+ "ui.close",
344
+ "ui.interaction",
345
+ "ui.markdownScan",
346
+ "ui.menu",
347
+ "ui.mount",
348
+ "ui.open",
349
+ "ui.set",
350
+ "ui.setMount",
351
+ "ui.show",
352
+ "ui.unmount",
353
+ "video.motion.set",
354
+ "video.motion.state",
355
+ "video.render.release",
356
+ "video.render.set",
357
+ "video.shaders.set",
358
+ "video.upscaling.set",
359
+ "video.upscaling.state",
360
+ "video.view.release",
361
+ "video.view.set",
362
+ "window.setAlwaysOnTop",
363
+ "window.setCursorAutoHide",
364
+ "window.setPictureInPicture",
365
+ "window.setVideoArea",
366
+ "window.state"
367
+ ]
368
+ }
369
+ }
@@ -1,25 +1,15 @@
1
1
  /**
2
- * Which player requests each member of the plugin API sends: the SDK's half
3
- * of the capability rule (the player's half, what each request needs, is
4
- * `HOST_CAPABILITIES`). A member is written `Interface.member` as in
5
- * `CAPABILITY_INFO`; members declared on `Scope` are written `Plugin.…`.
2
+ * Which player requests each member of the plugin API sends, written
3
+ * `Interface.member`; members declared on `Scope` are written `Plugin.…`.
4
+ * The generated reference pages read it: the Stability column of the
5
+ * message table (docs/reference/messages.md) and the members of each event
6
+ * (docs/reference/events.md). For a listener the row is the
7
+ * `events.subscribe` with its event name.
6
8
  *
7
- * List the requests that decide the member's capabilities: the one it
8
- * sends to do its work, and for a listener the `events.subscribe` with its
9
- * event name. A string parameter that the player's rule reads (`event`,
10
- * `stage`) is given in `params`. `also: true` marks a request whose
11
- * capability the member needs on top of its own (documented at the member,
12
- * not listed in its capability's `CAPABILITY_INFO.apis`).
13
- *
14
- * Members that need no capability are left out, apart from a few that show
15
- * a rule's "none" case. Members of objects that another listed member
16
- * returns (a `Window` from `Windows.create`, a `Panel` from `Panels.mount`)
17
- * are left out too: the call that created the object already needs the
18
- * capability.
19
- *
20
- * Order matters for `CAPABILITY_INFO`: each capability lists its members in
21
- * this table's order. test/capability-rules.test.ts checks every method and
22
- * parameter against the player's table.
9
+ * A row lists the request the member sends to do its work. Members whose
10
+ * requests come from a handle another member returned (a `Window` from
11
+ * `Windows.create`) are listed in the message table's `WRAPPED_BY`
12
+ * (scripts/doc-tables/messages.mjs) instead.
23
13
  *
24
14
  * @internal
25
15
  */
@@ -27,10 +17,8 @@
27
17
  export interface ApiRequest {
28
18
  /** The wire method (`source.submit`). */
29
19
  readonly method: string;
30
- /** String parameters the player's rule for the method reads. */
20
+ /** String parameters that name what is meant (`event`, `stage`). */
31
21
  readonly params?: Readonly<Record<string, string>>;
32
- /** A further capability, documented at the member. */
33
- readonly also?: true;
34
22
  }
35
23
  /** @internal */
36
24
  export declare const API_REQUESTS: Readonly<Record<string, readonly ApiRequest[]>>;
@@ -43,16 +31,3 @@ export declare const API_REQUESTS: Readonly<Record<string, readonly ApiRequest[]
43
31
  * @internal
44
32
  */
45
33
  export declare const SUBSCRIBED_EVENTS: readonly string[];
46
- /**
47
- * Members whose requests depend on an argument, which `API_REQUESTS` cannot
48
- * list: the event name of a listener (`event`: a subscribed event's
49
- * `events.subscribe`, nothing for the others) or the method name of a request
50
- * (`method`: that method, with the string fields of the second argument as its
51
- * parameters). The capability check reads the argument when its type is one
52
- * string (a literal, a constant), and reports the call as unchecked otherwise
53
- * (a computed name, a union of several, the member taken by destructuring or as
54
- * a value).
55
- *
56
- * @internal
57
- */
58
- export declare const ARGUMENT_APIS: Readonly<Record<string, "event" | "method">>;
@@ -1,33 +1,24 @@
1
1
  /**
2
- * Which player requests each member of the plugin API sends: the SDK's half
3
- * of the capability rule (the player's half, what each request needs, is
4
- * `HOST_CAPABILITIES`). A member is written `Interface.member` as in
5
- * `CAPABILITY_INFO`; members declared on `Scope` are written `Plugin.…`.
2
+ * Which player requests each member of the plugin API sends, written
3
+ * `Interface.member`; members declared on `Scope` are written `Plugin.…`.
4
+ * The generated reference pages read it: the Stability column of the
5
+ * message table (docs/reference/messages.md) and the members of each event
6
+ * (docs/reference/events.md). For a listener the row is the
7
+ * `events.subscribe` with its event name.
6
8
  *
7
- * List the requests that decide the member's capabilities: the one it
8
- * sends to do its work, and for a listener the `events.subscribe` with its
9
- * event name. A string parameter that the player's rule reads (`event`,
10
- * `stage`) is given in `params`. `also: true` marks a request whose
11
- * capability the member needs on top of its own (documented at the member,
12
- * not listed in its capability's `CAPABILITY_INFO.apis`).
13
- *
14
- * Members that need no capability are left out, apart from a few that show
15
- * a rule's "none" case. Members of objects that another listed member
16
- * returns (a `Window` from `Windows.create`, a `Panel` from `Panels.mount`)
17
- * are left out too: the call that created the object already needs the
18
- * capability.
19
- *
20
- * Order matters for `CAPABILITY_INFO`: each capability lists its members in
21
- * this table's order. test/capability-rules.test.ts checks every method and
22
- * parameter against the player's table.
9
+ * A row lists the request the member sends to do its work. Members whose
10
+ * requests come from a handle another member returned (a `Window` from
11
+ * `Windows.create`) are listed in the message table's `WRAPPED_BY`
12
+ * (scripts/doc-tables/messages.mjs) instead.
23
13
  *
24
14
  * @internal
25
15
  */
26
16
  const submit = [{ method: "source.submit" }, { method: "source.operation" }];
27
- const readsSubtitles = { method: "subtitles.state", also: true };
28
- const listen = (event, also) => also
29
- ? { method: "events.subscribe", params: { event }, also }
30
- : { method: "events.subscribe", params: { event } };
17
+ const readsSubtitles = { method: "subtitles.state" };
18
+ const listen = (event) => ({
19
+ method: "events.subscribe",
20
+ params: { event },
21
+ });
31
22
  /** @internal */
32
23
  export const API_REQUESTS = Object.freeze({
33
24
  "Player.state": [{ method: "source.state" }],
@@ -39,7 +30,7 @@ export const API_REQUESTS = Object.freeze({
39
30
  "Player.open": submit,
40
31
  "Player.openStream": [
41
32
  { method: "producer.prepare" },
42
- { method: "source.submit", also: true },
33
+ { method: "source.submit" },
43
34
  ],
44
35
  "Player.setPaused": submit,
45
36
  "Player.seek": submit,
@@ -119,7 +110,7 @@ export const API_REQUESTS = Object.freeze({
119
110
  "Packages.uninstall": [{ method: "packages.uninstall" }],
120
111
  "Plugin.video.filter": [
121
112
  { method: "processing.replace", params: { stage: "video" } },
122
- listen("source.state", true),
113
+ listen("source.state"),
123
114
  ],
124
115
  "Plugin.video.view": [{ method: "video.view.set" }],
125
116
  "Plugin.video.render": [{ method: "video.render.set" }],
@@ -132,8 +123,6 @@ export const API_REQUESTS = Object.freeze({
132
123
  { method: "snapshot.capture" },
133
124
  ],
134
125
  "Snapshot.export": [{ method: "jobs.state" }, { method: "jobs.start" }],
135
- // Parts of remembered files: also media.sources (documented at the
136
- // members; the player checks it for jobs.start with parts and jobs.check).
137
126
  "MediaCapture.export": [{ method: "jobs.state" }, { method: "jobs.start" }],
138
127
  "MediaCapture.exportCheck": [{ method: "jobs.check" }],
139
128
  "MediaSources.remember": [{ method: "media.sources.remember" }],
@@ -141,8 +130,7 @@ export const API_REQUESTS = Object.freeze({
141
130
  "MediaSources.locate": [{ method: "media.sources.locate" }],
142
131
  "MediaSources.forget": [{ method: "media.sources.forget" }],
143
132
  "MediaSources.list": [{ method: "media.sources.list" }],
144
- // An open like Player.open: playback.control (the player's rule for
145
- // media.sources.open), with which source.operation needs it too.
133
+ // An open like Player.open, followed with source.operation.
146
134
  "MediaSources.open": [
147
135
  { method: "media.sources.open" },
148
136
  { method: "source.operation" },
@@ -171,6 +159,10 @@ export const API_REQUESTS = Object.freeze({
171
159
  "VideoMotion.set": [{ method: "video.motion.set" }],
172
160
  "VideoMotion.onChange": [listen("video.motion.changed")],
173
161
  "WireCommands.register": [{ method: "commands.register" }],
162
+ "Mpv.command": [{ method: "mpv.command" }],
163
+ "Mpv.get": [{ method: "mpv.get" }],
164
+ "Mpv.set": [{ method: "mpv.set" }],
165
+ "Mpv.observe": [{ method: "mpv.observe" }],
174
166
  });
175
167
  /**
176
168
  * The events whose listener subscribes (`events.subscribe` with the event
@@ -193,20 +185,3 @@ export const SUBSCRIBED_EVENTS = Object.freeze([
193
185
  "video.upscaling.changed",
194
186
  "video.motion.changed",
195
187
  ]);
196
- /**
197
- * Members whose requests depend on an argument, which `API_REQUESTS` cannot
198
- * list: the event name of a listener (`event`: a subscribed event's
199
- * `events.subscribe`, nothing for the others) or the method name of a request
200
- * (`method`: that method, with the string fields of the second argument as its
201
- * parameters). The capability check reads the argument when its type is one
202
- * string (a literal, a constant), and reports the call as unchecked otherwise
203
- * (a computed name, a union of several, the member taken by destructuring or as
204
- * a value).
205
- *
206
- * @internal
207
- */
208
- export const ARGUMENT_APIS = Object.freeze({
209
- "Player.on": "event",
210
- "Wire.on": "event",
211
- "Wire.request": "method",
212
- });
@@ -0,0 +1,95 @@
1
+ import type TS from "typescript";
2
+ /** @internal The scan's categories, in the order results list them. */
3
+ export declare const SCAN_CATEGORIES: readonly ["player", "plugins", "clipboard", "credentials", "camera", "microphone", "screen", "notifications"];
4
+ /** @internal One of {@link SCAN_CATEGORIES}. */
5
+ export type ScanCategory = (typeof SCAN_CATEGORIES)[number];
6
+ /** @internal The version of the result's format (`scan`). */
7
+ export declare const SCAN_FORMAT = 1;
8
+ /** @internal One list of `capability-scan.json`. */
9
+ export interface ScanList {
10
+ readonly about: string;
11
+ /** API members, `Interface.member` (`Clipboard.readText`, `Scope.video.filter`). */
12
+ readonly members: readonly string[];
13
+ /** Methods of the player's protocol, by name or prefix (`packages.*`). */
14
+ readonly requests: readonly string[];
15
+ }
16
+ /** @internal `capability-scan.json`. */
17
+ export interface ScanTable {
18
+ readonly about: string;
19
+ readonly version: number;
20
+ readonly categories: Readonly<Record<ScanCategory, ScanList>>;
21
+ readonly none: ScanList;
22
+ }
23
+ /**
24
+ * `capability-scan.json`, read once from the package's root (one level
25
+ * above this module, in `src/` and in `dist/` alike).
26
+ *
27
+ * @internal
28
+ */
29
+ export declare function scanTable(): ScanTable;
30
+ /** @internal Where the scan found a use, for people who check it. */
31
+ export interface ScanEvidence {
32
+ /** The API member used (`Clipboard.readText`); absent for a request by name. */
33
+ readonly member?: string;
34
+ /** The protocol method requested by name (`clipboard.readText`); absent for a member. */
35
+ readonly request?: string;
36
+ /** The file, relative to the plugin's directory, with `/`. */
37
+ readonly file: string;
38
+ /** 1-based line. */
39
+ readonly line: number;
40
+ /** `"types"`: found by type; `"names"`: found by name (best effort). */
41
+ readonly by: "types" | "names";
42
+ }
43
+ /** @internal A request by name the scan could not put in a category. */
44
+ export interface ScanUnchecked {
45
+ readonly file: string;
46
+ readonly line: number;
47
+ /** One line for people. */
48
+ readonly message: string;
49
+ }
50
+ /** @internal What a scan found, before `vestra-plugin scan` adds the plugin's identity. */
51
+ export interface ScanFindings {
52
+ /** The categories used, in {@link SCAN_CATEGORIES}' order. */
53
+ readonly uses: ScanCategory[];
54
+ /** Per used category, where: by file, line, then name. */
55
+ readonly evidence: Partial<Record<ScanCategory, ScanEvidence[]>>;
56
+ readonly unchecked: ScanUnchecked[];
57
+ }
58
+ /**
59
+ * The category of a request by name, as the player routes a method: the
60
+ * exact name first, then the first `prefix.*` entry it starts with.
61
+ * `null`: in `none`; `undefined`: the table does not know the method.
62
+ *
63
+ * @internal
64
+ */
65
+ export declare function requestCategory(method: string, scan?: ScanTable): ScanCategory | null | undefined;
66
+ /** @internal What {@link scan} reads. */
67
+ export interface ScanOptions {
68
+ /** The plugin's TypeScript files, in `program`: scanned by type. */
69
+ readonly typed: readonly string[];
70
+ /** The plugin's JavaScript files, with their text: scanned by name. */
71
+ readonly named: readonly {
72
+ readonly file: string;
73
+ readonly text: string;
74
+ }[];
75
+ /** How the result names a file (relative to the plugin, with `/`). */
76
+ readonly relative?: (file: string) => string;
77
+ /** Default: `capability-scan.json`. */
78
+ readonly table?: ScanTable;
79
+ }
80
+ /**
81
+ * The categories a plugin's files use.
82
+ *
83
+ * `resolved` is `false` when there are TypeScript files and the program
84
+ * resolves no import of `@vestra-player/sdk` in them (the SDK is not
85
+ * installed where the plugin looks, or nothing imports it): the caller
86
+ * then scans those files by name too, or reports it.
87
+ *
88
+ * @param program - A program that has the `typed` files; `undefined` with
89
+ * none.
90
+ *
91
+ * @internal
92
+ */
93
+ export declare function scan(ts: typeof TS, program: TS.Program | undefined, options: ScanOptions): ScanFindings & {
94
+ resolved: boolean;
95
+ };