@deadair/plugin-sdk 0.9.0 → 0.10.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.
package/README.md CHANGED
@@ -18,7 +18,7 @@ A plugin extends deadair by declaring capabilities:
18
18
  | `analysis` | measure a track's audio: bytes in, cue points and loudness out |
19
19
  | `mixer` | make one piece of audio out of several: parts in, audio out |
20
20
  | `charts` | say what is popular: a chart id in, ranked names out |
21
- | `similarity` | say who else sounds like this: an artist in, artists out |
21
+ | `similarity` | say what sounds like this: an artist or a record in, names out |
22
22
  | `news` | say what happened outside the station: a feed in, entries out |
23
23
  | `podcast` | carry somebody else's programme: a show in, episodes out |
24
24
  | `search` | ask the open web a question: words in, pages out |
@@ -1,4 +1,4 @@
1
- import type { ArtistRef } from './enrichment.js';
1
+ import type { ArtistRef, TrackRef } from './enrichment.js';
2
2
  /**
3
3
  * The `similarity` kind. A similarity plugin answers "who else sounds like this",
4
4
  * and optionally "what should I play by them".
@@ -97,5 +97,19 @@ export interface SimilarityProvider {
97
97
  * is its own id coming back.
98
98
  */
99
99
  artistTopTracks?(ref: ArtistRef, limit: number): Promise<ArtistTrack[]>;
100
+ /**
101
+ * Records that sound like this one record, best first.
102
+ *
103
+ * Optional, and a finer question than {@link similarArtists}: that one answers who sounds
104
+ * like an ARTIST, and a record chosen from the answer is only as close as the artist's best
105
+ * known track happens to be. This answers from the record itself, which is what the host wants
106
+ * when it is putting something straight after a record a listener has just heard.
107
+ *
108
+ * `ref` is the enrichment capability's {@link TrackRef}; a source that matches on a
109
+ * MusicBrainz recording id should prefer `mbid` when it is there. Every record answered must
110
+ * carry its own LEAD artist, which is usually not the one asked about. An empty array is an
111
+ * ordinary answer, and the host falls back to the artist-level walk when it gets one.
112
+ */
113
+ similarTracks?(ref: TrackRef, limit: number): Promise<ArtistTrack[]>;
100
114
  }
101
115
  //# sourceMappingURL=similarity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"similarity.d.ts","sourceRoot":"","sources":["../../src/capabilities/similarity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;;;;;OASG;IACH,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAExE;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAC3E"}
1
+ {"version":3,"file":"similarity.d.ts","sourceRoot":"","sources":["../../src/capabilities/similarity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;;;;;OASG;IACH,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAExE;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAExE;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CACxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deadair/plugin-sdk",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "The contract a deadair plugin is written against: the manifest, the capabilities, the host it is handed, and a fake host for its tests.",
5
5
  "keywords": [
6
6
  "deadair",