@deadair/plugin-sdk 0.2.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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1062 -0
  3. package/dist/article.parse.d.ts +82 -0
  4. package/dist/article.parse.d.ts.map +1 -0
  5. package/dist/boundary.json.safe.d.ts +191 -0
  6. package/dist/boundary.json.safe.d.ts.map +1 -0
  7. package/dist/capabilities/analysis.d.ts +330 -0
  8. package/dist/capabilities/analysis.d.ts.map +1 -0
  9. package/dist/capabilities/charts.d.ts +134 -0
  10. package/dist/capabilities/charts.d.ts.map +1 -0
  11. package/dist/capabilities/enrichment.d.ts +255 -0
  12. package/dist/capabilities/enrichment.d.ts.map +1 -0
  13. package/dist/capabilities/llm.d.ts +318 -0
  14. package/dist/capabilities/llm.d.ts.map +1 -0
  15. package/dist/capabilities/mixer.d.ts +183 -0
  16. package/dist/capabilities/mixer.d.ts.map +1 -0
  17. package/dist/capabilities/music.provider.d.ts +245 -0
  18. package/dist/capabilities/music.provider.d.ts.map +1 -0
  19. package/dist/capabilities/news.d.ts +171 -0
  20. package/dist/capabilities/news.d.ts.map +1 -0
  21. package/dist/capabilities/scrobble.d.ts +133 -0
  22. package/dist/capabilities/scrobble.d.ts.map +1 -0
  23. package/dist/capabilities/search.d.ts +122 -0
  24. package/dist/capabilities/search.d.ts.map +1 -0
  25. package/dist/capabilities/similarity.d.ts +101 -0
  26. package/dist/capabilities/similarity.d.ts.map +1 -0
  27. package/dist/capabilities/speech.d.ts +211 -0
  28. package/dist/capabilities/speech.d.ts.map +1 -0
  29. package/dist/capabilities/weather.d.ts +192 -0
  30. package/dist/capabilities/weather.d.ts.map +1 -0
  31. package/dist/chunk-7QVYU63E.js +7 -0
  32. package/dist/chunk-7QVYU63E.js.map +1 -0
  33. package/dist/define.plugin.d.ts +56 -0
  34. package/dist/define.plugin.d.ts.map +1 -0
  35. package/dist/feed.parse.d.ts +97 -0
  36. package/dist/feed.parse.d.ts.map +1 -0
  37. package/dist/html.text.d.ts +71 -0
  38. package/dist/html.text.d.ts.map +1 -0
  39. package/dist/index.d.ts +30 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +1153 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/match.text.d.ts +28 -0
  44. package/dist/match.text.d.ts.map +1 -0
  45. package/dist/plugin.api.version.d.ts +9 -0
  46. package/dist/plugin.api.version.d.ts.map +1 -0
  47. package/dist/plugin.base.d.ts +80 -0
  48. package/dist/plugin.base.d.ts.map +1 -0
  49. package/dist/plugin.config.fields.d.ts +524 -0
  50. package/dist/plugin.config.fields.d.ts.map +1 -0
  51. package/dist/plugin.config.read.d.ts +52 -0
  52. package/dist/plugin.config.read.d.ts.map +1 -0
  53. package/dist/plugin.error.d.ts +177 -0
  54. package/dist/plugin.error.d.ts.map +1 -0
  55. package/dist/plugin.host.d.ts +220 -0
  56. package/dist/plugin.host.d.ts.map +1 -0
  57. package/dist/plugin.host.response.d.ts +42 -0
  58. package/dist/plugin.host.response.d.ts.map +1 -0
  59. package/dist/plugin.http.d.ts +80 -0
  60. package/dist/plugin.http.d.ts.map +1 -0
  61. package/dist/plugin.lifecycle.d.ts +68 -0
  62. package/dist/plugin.lifecycle.d.ts.map +1 -0
  63. package/dist/plugin.manifest.d.ts +282 -0
  64. package/dist/plugin.manifest.d.ts.map +1 -0
  65. package/dist/plugin.permissions.d.ts +186 -0
  66. package/dist/plugin.permissions.d.ts.map +1 -0
  67. package/dist/testing/fake.plugin.host.d.ts +85 -0
  68. package/dist/testing/fake.plugin.host.d.ts.map +1 -0
  69. package/dist/testing/index.d.ts +10 -0
  70. package/dist/testing/index.d.ts.map +1 -0
  71. package/dist/testing/index.js +141 -0
  72. package/dist/testing/index.js.map +1 -0
  73. package/package.json +67 -0
@@ -0,0 +1,134 @@
1
+ /**
2
+ * The `charts` kind. A charts plugin answers "what is popular", as an ordered
3
+ * list of records somebody else ranked.
4
+ *
5
+ * ## It answers with NAMES, and that is the whole design
6
+ *
7
+ * A chart entry is a title and an artist as strings, which is exactly the shape
8
+ * of a station pick: the host looks a name up, ingests it if a provider has it,
9
+ * and then judges it against the rotation rules like anything else. So a chart
10
+ * source inherits the dislike veto, the repeat window, the artist spacing and
11
+ * the fetch-and-bench by doing nothing at all, and a plugin here has no way to
12
+ * put a record on air that the operator forbade.
13
+ *
14
+ * Which is why there is no `trackId`, no provider id and no stream URL in any
15
+ * shape below. A chart is an opinion about records, not a source of them.
16
+ *
17
+ * ## Several plugins, several menus
18
+ *
19
+ * Unlike `enrichment`, this is not a fan-out that merges: two chart services do
20
+ * not produce one better chart, they produce two charts. So there is no
21
+ * `priority` here, and the host qualifies every {@link ChartDescriptor.id} with
22
+ * the plugin that offered it — two services will both call something `top-100`.
23
+ *
24
+ * Every shape here is JSON-safe.
25
+ */
26
+ /**
27
+ * One chart this plugin can serve.
28
+ *
29
+ * `id` is scoped to this plugin and needs to be unique only within it. The host
30
+ * qualifies it before anything outside sees it, so a short flat id is right.
31
+ */
32
+ export interface ChartDescriptor {
33
+ id: string;
34
+ /** What to call it in a list an operator reads, e.g. `Top 100 Songs`. */
35
+ name: string;
36
+ /** ISO 3166-1 alpha-2, when the chart is national. Absent means global. */
37
+ country?: string;
38
+ /** The genre this chart covers, when it covers one. */
39
+ genre?: string;
40
+ description?: string;
41
+ }
42
+ /** What a chart is asked for. */
43
+ export interface ChartQuery {
44
+ /** A {@link ChartDescriptor.id} this plugin offered. */
45
+ chartId: string;
46
+ /** How many entries to return. A plugin may return fewer; it must not return more. */
47
+ limit: number;
48
+ /**
49
+ * Which edition, as an ISO-8601 date string (`YYYY-MM-DD`). Never a `Date`.
50
+ *
51
+ * A chart is a weekly document with a history, and "the hits of this week in
52
+ * 1994" is a show. Whether a service can answer that is the plugin's
53
+ * business: one that cannot should answer for its current edition rather
54
+ * than throwing, because a nearly-right chart is a usable hour and an error
55
+ * is silence.
56
+ */
57
+ date?: string;
58
+ }
59
+ /** One record's place in a chart. */
60
+ export interface ChartEntry {
61
+ /** 1-based position in this edition. */
62
+ rank: number;
63
+ title: string;
64
+ /**
65
+ * The LEAD artist, and never a credit line.
66
+ *
67
+ * A correctness rule rather than a formatting one, and it is the single
68
+ * easiest thing to get wrong here, because most feeds print `A, B & C` in
69
+ * one field. Everything downstream matches a pick on the lead artist alone —
70
+ * the host keys it as `songKey(title, [artist])` and its provider lookup
71
+ * compares the first artist exactly — so a joined credit is a record that is
72
+ * named correctly, resolves to nothing, and is dropped as "not in the
73
+ * catalog". A live run of the same mistake elsewhere resolved every solo
74
+ * credit and lost every duet.
75
+ *
76
+ * Put the other credits in {@link featuring}, which is shown and never
77
+ * matched on.
78
+ */
79
+ artist: string;
80
+ /** The other credited artists, in the source's own order. Never used to identify the record. */
81
+ featuring?: string[];
82
+ album?: string;
83
+ year?: number;
84
+ /** Best position this record has reached, where the source tracks it. */
85
+ peak?: number;
86
+ /** How many editions it has appeared in, where the source tracks it. */
87
+ weeksOn?: number;
88
+ }
89
+ /**
90
+ * Implemented by a `charts` plugin.
91
+ */
92
+ export interface ChartsProvider {
93
+ /**
94
+ * What this plugin can serve, right now.
95
+ *
96
+ * Asked per request rather than cached by the host, for the reason a tool's
97
+ * declarations are: an operator reconfiguring a plugin reinitializes it, and
98
+ * a country list that depends on a config field would otherwise be a boot
99
+ * snapshot of a setting that has since changed.
100
+ *
101
+ * An empty array is an ordinary answer — an unconfigured plugin has nothing
102
+ * to offer — and is not a failure.
103
+ */
104
+ listCharts(): Promise<ChartDescriptor[]>;
105
+ /**
106
+ * One chart's entries, ranked.
107
+ *
108
+ * Return `[]` for a `chartId` you do not recognise rather than throwing: the
109
+ * host asks the plugin that named the id, so an unknown one means the menu
110
+ * moved underneath a caller, which is a stale request and not a fault.
111
+ */
112
+ fetchChart(query: ChartQuery): Promise<ChartEntry[]>;
113
+ /**
114
+ * The id of a chart for one musical style, if this service publishes one.
115
+ *
116
+ * Optional, the way `artistTopTracks` is on the similarity capability, and it exists because a
117
+ * style chart is the one family {@link listCharts} cannot offer: a service that ranks by tag has
118
+ * a chart for every word anybody has ever applied, so enumerating them is impossible and listing
119
+ * ten arbitrary ones is a worse menu than none. The result is that a perfectly good endpoint was
120
+ * unreachable — a caller could only ask for ids it had been shown.
121
+ *
122
+ * So this is a NAMING question rather than a fetch: hand it a style and get back an id for
123
+ * {@link fetchChart}, in whatever private scheme this plugin uses. The host never builds one
124
+ * itself, because the scheme belongs to the plugin and a host that guessed it would be writing
125
+ * one service's URL structure into deadair.
126
+ *
127
+ * `undefined` for a service with no style charts, which is an ordinary answer. Note it says
128
+ * nothing about whether the style HAS entries — an id for a word nobody ever tagged is a valid
129
+ * id for an empty chart, and telling those apart costs a request the caller is about to make
130
+ * anyway.
131
+ */
132
+ styleChartId?(style: string): string | undefined;
133
+ }
134
+ //# sourceMappingURL=charts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../src/capabilities/charts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iCAAiC;AACjC,MAAM,WAAW,UAAU;IACvB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACvB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;OAcG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;;;;;;OAUG;IACH,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAEzC;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAErD;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACpD"}
@@ -0,0 +1,255 @@
1
+ /**
2
+ * The `enrichment` kind. An enrichment plugin takes a reference to something in
3
+ * the catalog and returns extra facts about it: the stuff the DJ talks over,
4
+ * the stuff the UI shows. Several enrichment plugins run for the same thing and
5
+ * the host merges their results in `priority` order.
6
+ *
7
+ * Three references, three answers, because the facts have three different
8
+ * lifetimes and three different costs. A recording is asked about once per
9
+ * track, an artist once per artist, and a record once per album — so a rotation
10
+ * that revisits the same few hundred artists pays for them once rather than
11
+ * once per song. Only `enrichTrack` is required.
12
+ *
13
+ * Every shape here is JSON-safe.
14
+ */
15
+ /**
16
+ * How an enrichment plugin is asked to identify a track. `isrc` is the
17
+ * preferred key when present; otherwise match on the normalised
18
+ * `artist|title` pair.
19
+ */
20
+ export interface TrackRef {
21
+ /** Recording ISRC. When set, prefer it over the string fields. */
22
+ isrc?: string;
23
+ /**
24
+ * MusicBrainz RECORDING id, when the catalog has resolved one.
25
+ *
26
+ * The mirror of {@link ArtistRef.mbid} and {@link AlbumRef.mbid}, and it
27
+ * arrives the same way: something already resolved it and the host promoted
28
+ * it onto `tracks.mbid`, so a later pass gets it for free. Prefer it over
29
+ * every other field here when your source can take one, because it is the
30
+ * only identifier in this shape that cannot match the wrong record.
31
+ */
32
+ mbid?: string;
33
+ /** Primary artist name, as the source provider spells it. */
34
+ artist: string;
35
+ title: string;
36
+ album?: string;
37
+ durationMs?: number;
38
+ /** Release year, when known. Cheap disambiguator for covers and re-issues. */
39
+ year?: number;
40
+ }
41
+ /** Match keys an enrichment plugin can look a track up by. */
42
+ export declare const ENRICHMENT_MATCH_KEY_ISRC = "isrc";
43
+ export declare const ENRICHMENT_MATCH_KEY_ARTIST_TITLE = "artist-title";
44
+ export declare const KNOWN_ENRICHMENT_MATCH_KEYS: readonly ["isrc", "artist-title"];
45
+ export type EnrichmentMatchKey = (typeof KNOWN_ENRICHMENT_MATCH_KEYS)[number];
46
+ /** A named external identifier, e.g. `{ source: 'musicbrainz', id: '...' }`. */
47
+ export interface ExternalId {
48
+ source: string;
49
+ id: string;
50
+ }
51
+ /** A link out to the source, shown in the UI and usable as a citation. */
52
+ export interface ExternalLink {
53
+ label: string;
54
+ url: string;
55
+ }
56
+ /**
57
+ * A piece of PROSE about this thing, handed over for the host to read rather
58
+ * than for anyone to say.
59
+ *
60
+ * The difference between this and {@link TrackEnrichment.facts} is who wrote
61
+ * the sentence. A `fact` is a line your plugin composed and is willing to have
62
+ * spoken on air unchanged. A document is somebody else's article, verbatim: the
63
+ * host extracts claims from it, checks each claim against the text, and keeps
64
+ * the provenance. Nothing reads a document aloud, and nothing shows one on a
65
+ * page.
66
+ *
67
+ * Hand over the prose rather than your own summary of it. The host stores it,
68
+ * so a better extraction later costs no request to your upstream, and
69
+ * `sourceQuote` on the claims it produces has to be a span that really occurs
70
+ * in `text` or the claim is dropped.
71
+ *
72
+ * Plain text, not HTML and not wiki markup. Strip the furniture (navigation,
73
+ * licence footers, reference markers) the way a reader would ignore it.
74
+ */
75
+ export interface SourceDocument {
76
+ /** Where this text can be read by a person. Becomes the claim's citation, so it must be public. */
77
+ url: string;
78
+ /** The document's own title, e.g. the article name. */
79
+ title: string;
80
+ /** The prose, as plain text. */
81
+ text: string;
82
+ /** ISO-8601 instant. Never a `Date`. */
83
+ retrievedAt: string;
84
+ }
85
+ /**
86
+ * How an enrichment plugin is asked to identify an artist.
87
+ *
88
+ * Two identifiers, and the difference between them matters. `mbid` is the one
89
+ * id that crosses providers, so a plugin that is not MusicBrainz can still use
90
+ * it (Last.fm takes one directly) or ignore it and match on `name`.
91
+ * `providerRef` is this plugin's *own* last id for this artist, handed back so
92
+ * a second pass is a lookup rather than another search. Neither is promised:
93
+ * the first time anything asks about an artist, all there is is a name.
94
+ */
95
+ export interface ArtistRef {
96
+ /** Canonical artist name, as the catalog holds it. */
97
+ name: string;
98
+ /** MusicBrainz artist id, when the catalog has resolved one. */
99
+ mbid?: string;
100
+ /** The id this plugin itself used last time it answered about this artist. */
101
+ providerRef?: string;
102
+ }
103
+ /** The album equivalent of {@link ArtistRef}. `mbid` is a MusicBrainz release-group id. */
104
+ export interface AlbumRef {
105
+ name: string;
106
+ /** The album's artist, because a title alone does not identify a record. */
107
+ artist: string;
108
+ /** MusicBrainz release-group id, when the catalog has resolved one. */
109
+ mbid?: string;
110
+ providerRef?: string;
111
+ }
112
+ /**
113
+ * The union of facts enrichment can contribute. Every field is optional: a
114
+ * plugin returns a `Partial<TrackEnrichment>` containing only what it knows.
115
+ */
116
+ export interface TrackEnrichment {
117
+ /**
118
+ * Your own id for this thing, so the next pass can be a lookup rather than
119
+ * another search. The mirror of the `providerRef` on the ref you were
120
+ * handed: the host stores it against your plugin and gives it back to you,
121
+ * and only to you.
122
+ *
123
+ * Say it outright whenever you have one. It is not identity and it is not a
124
+ * claim about anyone else's ids — put those in {@link externalIds}, in
125
+ * whatever order suits you.
126
+ */
127
+ providerRef: string;
128
+ /** Canonical artist name, if the source has a better spelling than the provider. */
129
+ artist: string;
130
+ title: string;
131
+ album: string;
132
+ /** Original release year of the recording. */
133
+ year: number;
134
+ /** ISO-8601 date string (`YYYY-MM-DD` or `YYYY`). Never a `Date`. */
135
+ releaseDate: string;
136
+ genres: string[];
137
+ moods: string[];
138
+ /** Free-text background: label, session players, chart history. DJ patter fodder. */
139
+ biography: string;
140
+ /** Short trivia lines, each independently speakable. */
141
+ facts: string[];
142
+ /** Source prose for the host to extract claims from. See {@link SourceDocument}. */
143
+ documents: SourceDocument[];
144
+ /** Beats per minute. */
145
+ bpm: number;
146
+ /** Musical key, e.g. `A minor`. */
147
+ musicalKey: string;
148
+ label: string;
149
+ isrc: string;
150
+ artworkUrl: string;
151
+ externalIds: ExternalId[];
152
+ links: ExternalLink[];
153
+ }
154
+ /**
155
+ * What enrichment can say about an artist rather than a recording.
156
+ *
157
+ * Asked once per artist instead of once per track, which is the whole point of
158
+ * it being a separate method: a rotation revisits the same few hundred artists
159
+ * constantly, and an artist's background changes on a scale of years.
160
+ */
161
+ export interface ArtistEnrichment {
162
+ /** Your own id for this artist. See {@link TrackEnrichment.providerRef}. */
163
+ providerRef: string;
164
+ /** Canonical artist name, if the source has a better spelling than the provider. */
165
+ name: string;
166
+ /** Free-text background. DJ patter fodder. */
167
+ biography: string;
168
+ /** Short trivia lines, each independently speakable. */
169
+ facts: string[];
170
+ /** Source prose for the host to extract claims from. See {@link SourceDocument}. */
171
+ documents: SourceDocument[];
172
+ genres: string[];
173
+ imageUrl: string;
174
+ externalIds: ExternalId[];
175
+ links: ExternalLink[];
176
+ }
177
+ /**
178
+ * What enrichment can say about a record rather than a recording.
179
+ *
180
+ * The label, the pressing and the cover belong to the release, not to any one
181
+ * track on it, so they are asked for once per album. A track's own
182
+ * `TrackEnrichment.label` is still meaningful for a single that was never on a
183
+ * record, or for a compilation whose tracks were licensed separately.
184
+ */
185
+ export interface AlbumEnrichment {
186
+ /** Your own id for this record. See {@link TrackEnrichment.providerRef}. */
187
+ providerRef: string;
188
+ name: string;
189
+ /** Canonical artist name for the album, which is not always the track's. */
190
+ artist: string;
191
+ /** Release year of this record, as opposed to of any recording on it. */
192
+ year: number;
193
+ /** ISO-8601 date string (`YYYY-MM-DD` or `YYYY`). Never a `Date`. */
194
+ releaseDate: string;
195
+ label: string;
196
+ genres: string[];
197
+ facts: string[];
198
+ /** Source prose for the host to extract claims from. See {@link SourceDocument}. */
199
+ documents: SourceDocument[];
200
+ artworkUrl: string;
201
+ externalIds: ExternalId[];
202
+ links: ExternalLink[];
203
+ }
204
+ /**
205
+ * Implemented by an `enrichment` plugin.
206
+ */
207
+ export interface EnrichmentProvider {
208
+ /**
209
+ * Lower runs first and wins conflicts on merge. Use 100 for a canonical
210
+ * source (MusicBrainz), 500 for a supplementary one, 900 for a guess.
211
+ */
212
+ priority: number;
213
+ /** Which of the {@link TrackRef} fields this plugin can actually match on. */
214
+ matchKeys: EnrichmentMatchKey[];
215
+ /**
216
+ * How many refs this plugin will take in one {@link enrichTracks} call.
217
+ *
218
+ * The host chunks to it, so a batch call is a small fixed number of upstream
219
+ * round trips and can be given a deadline that means something. Ignored by a
220
+ * plugin that does not implement `enrichTracks`.
221
+ */
222
+ maxBatchSize?: number;
223
+ /** Return only the fields you actually resolved. Return `{}` on no match. */
224
+ enrichTrack(ref: TrackRef): Promise<Partial<TrackEnrichment>>;
225
+ /**
226
+ * The same question as {@link enrichTrack}, asked about several tracks at
227
+ * once. Optional, the way {@link enrichArtist} is: the host loops
228
+ * `enrichTrack` for any plugin that does not write it, so implementing it is
229
+ * an optimisation and never a requirement.
230
+ *
231
+ * Implement it only where the upstream can genuinely answer about many at
232
+ * once. A source paced at a request per second is the case this exists for:
233
+ * one query that identifies twenty-five tracks costs a second, where
234
+ * twenty-five `enrichTrack` calls cost twenty-five.
235
+ *
236
+ * Index-aligned with `refs`: entry `i` is the answer about `refs[i]`, the
237
+ * returned array is the same length, and `{}` at a position is a miss
238
+ * exactly as it is for `enrichTrack`. A source that could only account for
239
+ * some of the batch returns `{}` for the rest rather than a short array.
240
+ */
241
+ enrichTracks?(refs: TrackRef[]): Promise<Partial<TrackEnrichment>[]>;
242
+ /**
243
+ * Optional, the way a music provider's `resolveStreamUrl` is: a source
244
+ * that only knows recordings is still a valid enrichment plugin, and the
245
+ * host asks nothing of a plugin that did not write the method.
246
+ *
247
+ * Implement it for anything that belongs to the artist rather than to one
248
+ * of their recordings. The host asks once per artist, so the same answer
249
+ * covers every track they appear on.
250
+ */
251
+ enrichArtist?(ref: ArtistRef): Promise<Partial<ArtistEnrichment>>;
252
+ /** The album equivalent of {@link enrichArtist}, asked once per record. */
253
+ enrichAlbum?(ref: AlbumRef): Promise<Partial<AlbumEnrichment>>;
254
+ }
255
+ //# sourceMappingURL=enrichment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enrichment.d.ts","sourceRoot":"","sources":["../../src/capabilities/enrichment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACrB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAChD,eAAO,MAAM,iCAAiC,iBAAiB,CAAC;AAEhE,eAAO,MAAM,2BAA2B,mCAA0E,CAAC;AAEnH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,gFAAgF;AAChF,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;CACd;AAED,0EAA0E;AAC1E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