@vestra-player/sdk 1.7.7 → 1.7.9

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 (39) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/api-requests.js +18 -0
  3. package/dist/capabilities.d.ts +9 -0
  4. package/dist/capabilities.js +1 -0
  5. package/dist/capability-rules.d.ts +3 -0
  6. package/dist/capability-rules.js +47 -21
  7. package/dist/commands.d.ts +27 -6
  8. package/dist/commands.js +19 -5
  9. package/dist/docs-tree.json.gz +0 -0
  10. package/dist/host-capabilities.js +71 -0
  11. package/dist/manifest.js +12 -1
  12. package/dist/media.d.ts +108 -1
  13. package/dist/media.js +20 -0
  14. package/dist/player-runtime.d.ts +1 -0
  15. package/dist/player-runtime.js +1 -0
  16. package/dist/plugin/commands.d.ts +2 -1
  17. package/dist/plugin/commands.js +131 -4
  18. package/dist/plugin/media.d.ts +26 -0
  19. package/dist/plugin/media.js +166 -0
  20. package/dist/plugin/player.d.ts +7 -1
  21. package/dist/plugin/player.js +3 -1
  22. package/dist/plugin/scope.d.ts +1 -0
  23. package/dist/plugin/scope.js +2 -1
  24. package/dist/plugin/testing/commands.d.ts +7 -0
  25. package/dist/plugin/testing/commands.js +211 -0
  26. package/dist/plugin/testing/index.d.ts +170 -3
  27. package/dist/plugin/testing/index.js +120 -4
  28. package/dist/plugin/testing/internals.d.ts +27 -0
  29. package/dist/plugin/testing/internals.js +14 -1
  30. package/dist/plugin/testing/jobs.js +348 -1
  31. package/dist/plugin/testing/media.js +29 -0
  32. package/dist/plugin/types/base.d.ts +10 -7
  33. package/dist/plugin/types/commands.d.ts +412 -1
  34. package/dist/plugin/types/snapshots.d.ts +511 -1
  35. package/dist/wire.d.ts +43 -0
  36. package/dist/wire.js +6 -0
  37. package/llms.txt +3 -3
  38. package/package.json +1 -1
  39. package/slint/vestra/icons.slint +4 -0
@@ -11,6 +11,7 @@ import { randomBytes } from "node:crypto";
11
11
  import { HostError } from "../../wire.js";
12
12
  import { localSocketPath } from "../local.js";
13
13
  import { isCurrentProducer } from "./media.js";
14
+ import { MEDIA_SOURCE_LIMITS } from "../media.js";
14
15
  /** `jobs.start`'s `encoding`, checked against the player's sets. */
15
16
  export function validEncoding(value) {
16
17
  if (typeof value !== "object" || value === null || Array.isArray(value))
@@ -42,7 +43,158 @@ export function failStream(host, inner, producerId, message) {
42
43
  }
43
44
  /** The default handlers of this area's wire methods, by method name. */
44
45
  export function jobsHandlers(host, inner) {
45
- return {
46
+ /** A file's facts: `mediaFiles`, else a 1080p30 H.264 + AAC file. */
47
+ const facts = (path) => {
48
+ const file = host.mediaFiles.get(path) ?? {};
49
+ return {
50
+ duration: file.duration ?? host.source.duration ?? 60,
51
+ status: file.status ?? "ok",
52
+ video: file.video === undefined
53
+ ? {
54
+ codec: "h264",
55
+ width: 1920,
56
+ height: 1080,
57
+ fps: 30,
58
+ pixelFormat: "yuv420p",
59
+ }
60
+ : file.video,
61
+ audio: file.audio === undefined
62
+ ? { codec: "aac", sampleRate: 48000, channels: 2 }
63
+ : file.audio,
64
+ };
65
+ };
66
+ const known = (token) => {
67
+ const value = String(token);
68
+ if (!host.sourceReferences.has(value))
69
+ throw new HostError("missing", "no such source reference");
70
+ return value;
71
+ };
72
+ /** A file's version: what the player's size and modification time are. */
73
+ const version = (path) => host.mediaFiles.get(path)?.version ?? 0;
74
+ /** As the player: gone, rewritten since remembered, or as it was. */
75
+ const status = (token) => {
76
+ const { path, version: was } = host.sourceReferences.get(token);
77
+ const file = facts(path);
78
+ if (file.status === "missing")
79
+ return "missing";
80
+ return file.status === "changed" || version(path) !== (was ?? 0)
81
+ ? "changed"
82
+ : "ok";
83
+ };
84
+ const describe = (token) => {
85
+ const { path } = host.sourceReferences.get(token);
86
+ const file = facts(path);
87
+ return {
88
+ token,
89
+ name: path.split(/[/\\]/).pop() ?? path,
90
+ duration: file.duration,
91
+ status: status(token),
92
+ video: file.video,
93
+ audio: file.audio,
94
+ };
95
+ };
96
+ /** The player's `media_copy::fits_mp4`: codecs a copy writes into MP4. */
97
+ const fitsMp4 = (file) => ["h264", "hevc", "av1", "mpeg4"].includes(file?.video?.codec ?? "") &&
98
+ (!file?.audio ||
99
+ ["aac", "mp3", "ac3", "eac3", "alac"].includes(file.audio.codec));
100
+ // The player's check (`media_sources::check`) over the fake facts.
101
+ const exportCheck = (parts) => {
102
+ // The player's bounds (`media_sources::parts_valid`).
103
+ if (!Array.isArray(parts) ||
104
+ parts.length === 0 ||
105
+ parts.length > MEDIA_SOURCE_LIMITS.parts ||
106
+ parts.some((part) => typeof part?.source !== "string" ||
107
+ part.source === "" ||
108
+ !Number.isFinite(part.start) ||
109
+ !Number.isFinite(part.end) ||
110
+ part.start < 0 ||
111
+ part.end > MEDIA_SOURCE_LIMITS.partEnd) ||
112
+ parts.reduce((sum, part) => sum + Math.max(0, part.end - part.start), 0) >
113
+ MEDIA_SOURCE_LIMITS.totalSeconds)
114
+ throw new HostError("invalid", `1–${MEDIA_SOURCE_LIMITS.parts} parts with a token and finite times from 0 to ${MEDIA_SOURCE_LIMITS.partEnd} s (${MEDIA_SOURCE_LIMITS.totalSeconds} s in all) required`);
115
+ const blocking = [];
116
+ const files = parts.map((part, index) => {
117
+ const reference = host.sourceReferences.get(part.source);
118
+ if (!reference) {
119
+ blocking.push({ part: index, problem: "unknown" });
120
+ return null;
121
+ }
122
+ const file = facts(reference.path);
123
+ const now = status(part.source);
124
+ if (now !== "ok")
125
+ blocking.push({ part: index, problem: now });
126
+ if (!file.video)
127
+ blocking.push({ part: index, problem: "noVideo" });
128
+ else if (part.end <= part.start ||
129
+ part.end - part.start < 1 / file.video.fps - 1e-6 ||
130
+ part.end > file.duration + 0.001)
131
+ blocking.push({
132
+ part: index,
133
+ problem: "range",
134
+ duration: file.duration,
135
+ });
136
+ return file;
137
+ });
138
+ const reasons = [];
139
+ const first = files[0]?.video ? files[0] : null;
140
+ const audio = (a) => a ? `${a.codec} ${a.sampleRate} Hz ${a.channels} ch` : "none";
141
+ if (first?.video)
142
+ files.forEach((file, part) => {
143
+ if (part === 0 || !file?.video)
144
+ return;
145
+ const v = file.video;
146
+ const f = first.video;
147
+ if (v.codec !== f.codec)
148
+ reasons.push({
149
+ part,
150
+ field: "videoCodec",
151
+ value: v.codec,
152
+ expected: f.codec,
153
+ });
154
+ if (v.width !== f.width || v.height !== f.height)
155
+ reasons.push({
156
+ part,
157
+ field: "size",
158
+ value: `${v.width}×${v.height}`,
159
+ expected: `${f.width}×${f.height}`,
160
+ });
161
+ if (v.fps !== f.fps)
162
+ reasons.push({ part, field: "fps", value: v.fps, expected: f.fps });
163
+ if (v.pixelFormat !== f.pixelFormat)
164
+ reasons.push({
165
+ part,
166
+ field: "pixelFormat",
167
+ value: v.pixelFormat,
168
+ expected: f.pixelFormat,
169
+ });
170
+ if (audio(file.audio) !== audio(first.audio))
171
+ reasons.push({
172
+ part,
173
+ field: "audio",
174
+ value: audio(file.audio),
175
+ expected: audio(first.audio),
176
+ });
177
+ });
178
+ const mp4 = fitsMp4(first);
179
+ return {
180
+ blocking,
181
+ copy: reasons.length > 0 || !first
182
+ ? { ok: false, reasons }
183
+ : { ok: true, container: mp4 ? "mp4" : "mkv" },
184
+ encode: first?.video
185
+ ? {
186
+ width: first.video.width + (first.video.width % 2),
187
+ height: first.video.height + (first.video.height % 2),
188
+ fps: first.video.fps,
189
+ audio: files.some((file) => file?.audio)
190
+ ? { sampleRate: 48000, channels: 2 }
191
+ : null,
192
+ }
193
+ : null,
194
+ duration: parts.reduce((sum, part) => sum + Math.max(0, part.end - part.start), 0),
195
+ };
196
+ };
197
+ const handlers = {
46
198
  "snapshot.capture": (p) => {
47
199
  const expected = p.expected;
48
200
  if (expected.generation !== host.source.stamp.generation ||
@@ -70,6 +222,8 @@ export function jobsHandlers(host, inner) {
70
222
  "snapshot.state": (p) => host.snapshots.get(Number(p.snapshotId)) ?? null,
71
223
  "snapshot.release": (p) => void host.snapshots.delete(Number(p.snapshotId)),
72
224
  "jobs.start": (p) => {
225
+ if (p.parts !== undefined)
226
+ return startParts(p);
73
227
  if (!host.snapshots.has(Number(p.snapshotId)))
74
228
  throw new HostError("missing", "snapshot released");
75
229
  const kind = String(p.kind);
@@ -124,12 +278,57 @@ export function jobsHandlers(host, inner) {
124
278
  const current = structuredClone(job);
125
279
  const made = inner.exportJobs.get(job.jobId);
126
280
  const clip = made?.clip;
281
+ const join = made?.join;
127
282
  if (job.status === "queued") {
128
283
  job.status = "running";
129
284
  if (clip) {
130
285
  const total = clip.end - clip.start;
131
286
  job.progress = { done: total / 2, total };
132
287
  }
288
+ // A join is half written: in its middle part.
289
+ if (join)
290
+ job.progress = {
291
+ done: join.total / 2,
292
+ total: join.total,
293
+ part: Math.ceil(join.parts / 2),
294
+ parts: join.parts,
295
+ };
296
+ }
297
+ else if (job.status === "running" &&
298
+ join &&
299
+ !host.exportFailure &&
300
+ join.tokens.some((token) => status(token) !== "ok")) {
301
+ // As the player: a part whose file went or changed ends the job.
302
+ const index = join.tokens.findIndex((token) => status(token) !== "ok");
303
+ const gone = status(join.tokens[index]) === "missing";
304
+ Object.assign(job, {
305
+ status: "failed",
306
+ outcome: {
307
+ error: {
308
+ code: gone ? "source-missing" : "source-changed",
309
+ message: `part ${index + 1} ${gone ? "is missing" : "changed since it was added"}`,
310
+ },
311
+ },
312
+ });
313
+ }
314
+ else if (job.status === "running" && join && !host.exportFailure) {
315
+ const destination = join.mode === "copy"
316
+ ? made.destination.replace(/(\.(mp4|m4v|mov|mkv|webm))?$/i, `.${join.container}`)
317
+ : made.destination;
318
+ Object.assign(job, {
319
+ status: "completed",
320
+ publicationStarted: true,
321
+ facts: {
322
+ join: {
323
+ mode: join.mode,
324
+ container: join.container,
325
+ parts: join.written,
326
+ target: null,
327
+ },
328
+ },
329
+ outcome: { destination },
330
+ progress: { done: join.total, total: join.total },
331
+ });
133
332
  }
134
333
  else if (job.status === "running" && host.exportFailure)
135
334
  Object.assign(job, {
@@ -175,6 +374,154 @@ export function jobsHandlers(host, inner) {
175
374
  return { jobId: job.jobId, cancel: "requested" };
176
375
  },
177
376
  "jobs.operation": () => ({ status: "unknown" }),
377
+ "media.sources.remember": (p) => {
378
+ const path = host.source.source;
379
+ if (p.expected !== undefined &&
380
+ (p.expected.generation !==
381
+ host.source.stamp.generation ||
382
+ p.expected.intentVersion !==
383
+ host.source.stamp.intentVersion))
384
+ throw new HostError("stale", "source intent changed");
385
+ if (!path ||
386
+ path.includes("://") ||
387
+ !["ready", "ended"].includes(host.source.phase) ||
388
+ host.mediaFiles.get(path)?.status === "missing")
389
+ throw new HostError("unsupported", "only a local file can be referenced");
390
+ // The same file as it is (path, size and time: `version`): its token.
391
+ for (const [token, reference] of host.sourceReferences)
392
+ if (reference.path === path &&
393
+ (reference.version ?? 0) === version(path))
394
+ return describe(token);
395
+ if (host.sourceReferences.size >= MEDIA_SOURCE_LIMITS.references)
396
+ throw new HostError("limit", `a plugin holds at most ${MEDIA_SOURCE_LIMITS.references} references`);
397
+ const token = `src-${randomBytes(16).toString("hex")}`;
398
+ host.sourceReferences.set(token, { path, version: version(path) });
399
+ return describe(token);
400
+ },
401
+ "media.sources.get": (p) => describe(known(p.token)),
402
+ "media.sources.list": () => [...host.sourceReferences.keys()].map(describe),
403
+ "media.sources.forget": (p) => void host.sourceReferences.delete(String(p.token)),
404
+ // The player's own dialog: answered from `dialogAnswers` like a file
405
+ // dialog (a one-path array picks that file, `null` cancels).
406
+ "media.sources.locate": (p) => {
407
+ const token = known(p.token);
408
+ const answer = host.dialogAnswers.shift();
409
+ if (answer === undefined)
410
+ throw new Error("test host: no dialog answer queued");
411
+ if (answer !== null && !Array.isArray(answer))
412
+ throw new Error("test host: a confirm answer was queued");
413
+ if (answer === null)
414
+ return null;
415
+ host.sourceReferences.set(token, {
416
+ path: answer[0],
417
+ version: version(answer[0]),
418
+ });
419
+ return describe(token);
420
+ },
421
+ "jobs.check": (p) => {
422
+ // As the player: parts or a snapshot, one of them.
423
+ if ((p.snapshotId === undefined) === (p.parts === undefined))
424
+ throw new HostError("invalid", "jobs.check takes parts or a snapshotId, one of them");
425
+ if (p.snapshotId === undefined) {
426
+ // Parts carry their own ends; `end` is the snapshot form's.
427
+ if (p.end !== undefined && p.end !== null)
428
+ throw new HostError("invalid", "end belongs to a snapshotId check; parts carry their own end");
429
+ return exportCheck(p.parts);
430
+ }
431
+ // A snapshot's clip: one part from the current file's facts.
432
+ const snapshot = host.snapshots.get(Number(p.snapshotId));
433
+ if (!snapshot)
434
+ throw new HostError("unknown-expired", "snapshot unavailable");
435
+ const end = Number(p.end);
436
+ if (!(end > snapshot.time && end <= snapshot.duration))
437
+ throw new HostError("invalid", "end must be after the snapshot time and within its duration");
438
+ const file = facts(snapshot.source);
439
+ const fps = file.video?.fps ?? 30;
440
+ const processed = snapshot.kind === "processed";
441
+ return {
442
+ blocking: file.video ? [] : [{ part: 0, problem: "noVideo" }],
443
+ copy: processed
444
+ ? {
445
+ ok: false,
446
+ reasons: [
447
+ { part: 0, field: "effects", value: null, expected: null },
448
+ ],
449
+ }
450
+ : { ok: true, container: fitsMp4(file) ? "mp4" : "mkv" },
451
+ // The source's size (even), as the player's target; a processed
452
+ // snapshot's picture is the source's in the test host.
453
+ encode: file.video
454
+ ? {
455
+ width: file.video.width + (file.video.width % 2),
456
+ height: file.video.height + (file.video.height % 2),
457
+ fps,
458
+ audio: file.audio ? { sampleRate: 48000, channels: 2 } : null,
459
+ }
460
+ : null,
461
+ duration: end - snapshot.time,
462
+ };
463
+ },
464
+ };
465
+ /** `jobs.start { parts }`: an export of remembered files' parts. */
466
+ function startParts(p) {
467
+ const parts = p.parts;
468
+ const copy = p.kind === "rawCopy";
469
+ if (!Array.isArray(parts) ||
470
+ parts.length === 0 ||
471
+ parts.length > MEDIA_SOURCE_LIMITS.parts ||
472
+ parts.some((part) => !(part.end > part.start)) ||
473
+ parts.reduce((sum, part) => sum + (part.end - part.start), 0) >
474
+ MEDIA_SOURCE_LIMITS.totalSeconds ||
475
+ !["rawCopy", "rawMp4"].includes(String(p.kind)) ||
476
+ p.snapshotId !== undefined ||
477
+ p.end !== undefined ||
478
+ p.sampleTime !== undefined ||
479
+ p.quality !== undefined ||
480
+ (p.encoding !== undefined && (copy || !validEncoding(p.encoding))) ||
481
+ (p.container !== undefined && !copy))
482
+ throw new HostError("invalid", "invalid export of parts");
483
+ parts.forEach((part, index) => {
484
+ if (!host.sourceReferences.has(part.source))
485
+ throw new HostError("missing", `part ${index} names no source reference of this plugin`);
486
+ });
487
+ const checked = exportCheck(parts);
488
+ host.exports.push(structuredClone(p));
489
+ const jobId = ++inner.next.job;
490
+ host.jobs.set(jobId, {
491
+ jobId,
492
+ status: "queued",
493
+ publicationStarted: false,
494
+ facts: null,
495
+ outcome: null,
496
+ progress: null,
497
+ });
498
+ inner.exportJobs.set(jobId, {
499
+ destination: String(p.destination),
500
+ clip: null,
501
+ join: {
502
+ tokens: parts.map((part) => part.source),
503
+ parts: parts.length,
504
+ total: checked.duration,
505
+ mode: copy ? "copy" : "mp4",
506
+ container: !copy
507
+ ? "mp4"
508
+ : p.container === "mkv" ||
509
+ (p.container !== "mp4" &&
510
+ checked.copy.ok &&
511
+ checked.copy.container === "mkv")
512
+ ? "mkv"
513
+ : "mp4",
514
+ // A copy starts each part on a "keyframe" 1 s early, as clips do.
515
+ written: parts.map((part) => ({
516
+ start: copy ? Math.max(0, part.start - 1) : part.start,
517
+ end: part.end,
518
+ })),
519
+ },
520
+ });
521
+ return { jobId, status: "queued" };
522
+ }
523
+ return {
524
+ ...handlers,
178
525
  "producer.prepare": async () => {
179
526
  const id = ++inner.next.producer;
180
527
  const tcp = host.producerTransport === "tcp";
@@ -484,6 +484,35 @@ export function mediaHandlers(host, inner) {
484
484
  }
485
485
  return result;
486
486
  },
487
+ // The player's `media.sources.open`: the token's file opened as a
488
+ // `source.submit` open under the plugin's operation id, at `start`.
489
+ "media.sources.open": (p) => {
490
+ const reference = host.sourceReferences.get(String(p.token));
491
+ if (!reference)
492
+ throw new HostError("missing", "no such source reference");
493
+ const file = host.mediaFiles.get(reference.path) ?? {};
494
+ if (file.status === "missing")
495
+ throw new HostError("source-missing", "the file is missing");
496
+ if (file.status === "changed" ||
497
+ (file.version ?? 0) !== (reference.version ?? 0))
498
+ throw new HostError("source-changed", "the file changed since it was remembered");
499
+ const start = p.start === undefined ? 0 : Number(p.start);
500
+ const duration = file.duration ?? host.source.duration ?? 60;
501
+ if (!(start >= 0 && start < duration))
502
+ throw new HostError("invalid", "start must be before the file's end");
503
+ const intent = {
504
+ kind: "open",
505
+ source: reference.path,
506
+ startPaused: false,
507
+ };
508
+ host.sourceOpens.push({ token: String(p.token), start });
509
+ const ticket = sourceIntent(host, inner, intent);
510
+ // Loaded at once, at the start (the player's `start=`).
511
+ host.setSource({ phase: "ready", duration, position: start });
512
+ const result = { status: "completed", ...ticket };
513
+ inner.sourceBook.set(Number(p.operationId), result);
514
+ return result;
515
+ },
487
516
  "source.operation": (p) => {
488
517
  const result = inner.sourceBook.get(Number(p.operationId));
489
518
  if (!result)
@@ -1,4 +1,4 @@
1
- import type { Command, CommandOptions } from "./commands.ts";
1
+ import type { Command, CommandOptions, PaletteLeadRun } from "./commands.ts";
2
2
  import type { PackageCandidate, PluginInfo } from "./packages.ts";
3
3
  import type { Conditional, Media, Stream } from "./playback.ts";
4
4
  import type {
@@ -6,11 +6,11 @@ import type {
6
6
  RenderingReasonCode,
7
7
  RenderingState,
8
8
  } from "./services.ts";
9
- import type { ExportJob, Snapshot } from "./snapshots.ts";
9
+ 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, When } from "./commands.ts";
13
+ import type { Bindings, Commands, Host, Palette, When } from "./commands.ts";
14
14
  import type { Packages } from "./packages.ts";
15
15
  import type { Player, Timeline } from "./playback.ts";
16
16
  import type { AudioFilter, RenderOptions, VideoFilter, VideoShaders, VideoUpscaling, VideoView } from "./processing.ts";
@@ -100,7 +100,7 @@ export interface Disposable {
100
100
  * | `invalid` | A bad argument (out of range, malformed, unknown id). |
101
101
  * | `missing` | The target does not exist (an empty panel position, a missing file, an unknown command). |
102
102
  * | `busy` | The player is still doing a previous call of the same kind (a dialog is open, a step is in flight). |
103
- * | `conflict` | Another plugin owns the resource (the sequence provider, the display layer, the backdrop, a menu path), or this plugin already uses the id (a window or command id). |
103
+ * | `conflict` | Another plugin owns the resource (the sequence provider, the display layer, the backdrop, a menu path, the command palette's lead row), or this plugin already uses the id (a window or command id). |
104
104
  * | `unavailable` | Not possible right now (no ready media, no user interface, fullscreen, a disabled core action). |
105
105
  * | `unsupported` | Not possible on this system, build or source (a platform gap, software rendering, a source that cannot seek, a filter on a generated stream, an export the player cannot make as asked: a stream copy, a source bitrate it cannot tell). |
106
106
  * | `backend` | Loading or resolving failed; `message` is the backend's reason. |
@@ -113,17 +113,18 @@ export interface Disposable {
113
113
  * | `timeout` | A time limit ran out (`openStream` start-up, `tools.run`, `system.*` after 10 s). |
114
114
  * | `stream`, `device` | `openStream`: the producer failed / the audio device is not ready. |
115
115
  * | `backend-uncertain` | The player's backend blocked a filter stage; call `retry()`. |
116
- * | `limit` | A player-wide limit was reached (for example the number of commands), a property value is over the limits of {@link PropValue}, or a request is longer than the player's 1 MiB message. |
116
+ * | `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, or {@link Commands.run} ran too often. |
117
117
  * | `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. |
118
118
  * | `versionMismatch` | The package needs a newer player (`minPlayerVersion`). |
119
119
  * | `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. |
120
120
  * | `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). |
121
121
  * | `host` | Any other failure inside the player; `message` is the player's reason. |
122
- * | `disabled` | The plugin is being stopped; pending requests fail with it. |
122
+ * | `disabled` | The plugin is being stopped; pending requests fail with it. {@link Commands.run}: the command is disabled; `message` has its reason. |
123
+ * | `ticket` | {@link Commands.run}: no ticket, or it ended or expired (a ticket comes with {@link PaletteLeadRun}). |
123
124
  * | `unknown`, `rejected`, `expired` | After a transport problem the SDK could not confirm the outcome (does not happen in normal operation). |
124
125
  * | `activation` | The plugin opened a tool window while its activation was still pending and the player could not track it. |
125
126
  * | `command` | The player could not run or update a command it no longer knows for this plugin (removed meanwhile, or another plugin's). |
126
- * | `export-failed` | An export job ({@link ExportJob}) failed: the code of its `outcome.error`, not a rejection; `message` has the worker's or FFmpeg's reason. |
127
+ * | `export-failed`, `source-missing`, `source-changed`, `no-space` | An export job ({@link ExportJob}) failed: the code of its `outcome.error`, not a rejection; `message` has the worker's or FFmpeg's reason. An export of parts ({@link MediaCapture.export}) ends `source-missing` when a part's file is gone and `source-changed` when it changed since it was remembered; {@link MediaSources.open} rejects with them. An export of parts ends `no-space` when the disk has less room than its estimate. |
127
128
  * | `input-overflow` | `openStream` input: the player's queue of physical key transitions was full; the input was revoked and its keys released. |
128
129
  * | `internal` | An internal step of the player failed (keeping an operation's result, a subtitle or media job); `message` has the reason. |
129
130
  * | `javascript`, `slint` | {@link Packages.validate}: the package's entry module does not pass `node --check` / one of its Slint files does not compile; `message` has the diagnostics. |
@@ -317,6 +318,8 @@ export interface Scope extends Disposable {
317
318
  readonly packages: Packages;
318
319
  /** On-screen messages over the video (`ui.osd`). */
319
320
  readonly osd: Osd;
321
+ /** The command palette's lead row (`palette.lead`, built-in plugins only). */
322
+ readonly palette: Palette;
320
323
  /** The player's own core playback actions (`commands`). */
321
324
  readonly host: Host;
322
325
  /** The system clipboard (`clipboard`). */