deep-roon-mcp 0.5.4 → 0.5.6
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/dist/deep-roon-mcp.js +26 -97
- package/package.json +1 -1
package/dist/deep-roon-mcp.js
CHANGED
|
@@ -9246,7 +9246,7 @@ function parseAlbumEditInfo(decoded4) {
|
|
|
9246
9246
|
raw: decoded4
|
|
9247
9247
|
};
|
|
9248
9248
|
}
|
|
9249
|
-
var ROOT_SERVICE_GUID, RoonClient
|
|
9249
|
+
var ROOT_SERVICE_GUID, RoonClient;
|
|
9250
9250
|
var init_client = __esm({
|
|
9251
9251
|
"src/intern/proto/client.ts"() {
|
|
9252
9252
|
"use strict";
|
|
@@ -9720,97 +9720,16 @@ var init_client = __esm({
|
|
|
9720
9720
|
const decoded4 = this.graph.decodeReturnValue(Uint8Array.from(res.payload));
|
|
9721
9721
|
return parseAlbumEditInfo(decoded4);
|
|
9722
9722
|
}
|
|
9723
|
-
//
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
* title, rating, genres and labels (set then call again with the prior values to
|
|
9727
|
-
* restore). `albumId` is the AlbumLite::AlbumId long (see albumIdOf), NOT the oid.
|
|
9728
|
-
*
|
|
9729
|
-
* Encoding (validated against the live core): a LibraryEdit by-value struct whose
|
|
9730
|
-
* Albums is an IList<AlbumEdit> (LengthPrefixed: int(len)+flexInt(count)+items);
|
|
9731
|
-
* each AlbumEdit member uses a nested Edit*<T> wrapper (EditRequiredRef<string>
|
|
9732
|
-
* for Title, EditOptionalVal<int> for Rating, EditList<string> for Genres/Labels).
|
|
9733
|
-
*
|
|
9734
|
-
* NOTE: boolean flags (IsPick/IsUserHidden/IsCompilation/…) are intentionally not
|
|
9735
|
-
* supported — the core does not respond to EditOptionalVal<bool> edits (the apply
|
|
9736
|
-
* hangs server-side; the encoding is correct). Genres/labels must be values Roon
|
|
9737
|
-
* recognises; unknown strings return Success but are silently dropped.
|
|
9738
|
-
*/
|
|
9739
|
-
editAlbum(albumId, edits) {
|
|
9740
|
-
const fields = [];
|
|
9741
|
-
if (edits.title !== void 0) {
|
|
9742
|
-
const w = this.structArg(EDIT_REQUIRED_REF_STR, [
|
|
9743
|
-
{ name: `string ${EDIT_REQUIRED_REF_STR}::EditValue`, propType: 20 /* String */, value: new BinaryWriter().string(edits.title).toBuffer() }
|
|
9744
|
-
]);
|
|
9745
|
-
fields.push({ name: `${EDIT_REQUIRED_REF_STR} ${ALBUM_EDIT}::Title`, propType: 23 /* Object */, value: w });
|
|
9746
|
-
}
|
|
9747
|
-
if (edits.rating !== void 0) {
|
|
9748
|
-
const w = this.structArg(EDIT_OPTIONAL_VAL_INT, [
|
|
9749
|
-
{ name: `int? ${EDIT_OPTIONAL_VAL_INT}::EditValue`, propType: 10 /* NullableInt */, value: new BinaryWriter().boolean(true).integer(edits.rating).toBuffer() }
|
|
9750
|
-
]);
|
|
9751
|
-
fields.push({ name: `${EDIT_OPTIONAL_VAL_INT} ${ALBUM_EDIT}::Rating`, propType: 23 /* Object */, value: w });
|
|
9752
|
-
}
|
|
9753
|
-
if (edits.addGenres || edits.removeGenres) {
|
|
9754
|
-
fields.push({ name: `${EDIT_LIST_STR} ${ALBUM_EDIT}::Genres`, propType: 23 /* Object */, value: this.editListStr(edits.addGenres ?? [], edits.removeGenres ?? []) });
|
|
9755
|
-
}
|
|
9756
|
-
if (edits.addLabels || edits.removeLabels) {
|
|
9757
|
-
fields.push({ name: `${EDIT_LIST_STR} ${ALBUM_EDIT}::Labels`, propType: 23 /* Object */, value: this.editListStr(edits.addLabels ?? [], edits.removeLabels ?? []) });
|
|
9758
|
-
}
|
|
9759
|
-
if (!fields.length) throw new Error("editAlbum: no edits supplied");
|
|
9760
|
-
return this.editAlbumStruct(albumId, fields);
|
|
9761
|
-
}
|
|
9762
|
-
/** Convenience: set just an album's rating (see editAlbum). */
|
|
9763
|
-
editAlbumRating(albumId, rating) {
|
|
9764
|
-
return this.editAlbum(albumId, { rating });
|
|
9765
|
-
}
|
|
9766
|
-
/** AlbumLite::AlbumId (the long id Library::Edit keys on). */
|
|
9723
|
+
// Geen schrijfkant voor albumgegevens (René, 26 okt 2026): editAlbum (titel, waardering, genres, labels via
|
|
9724
|
+
// Library::Edit) is eruit — er hing geen tool aan, en wat er niet in staat kan ook niet per ongeluk aangesloten worden.
|
|
9725
|
+
/** AlbumLite::AlbumId (the long id favoriteAlbum keys on). */
|
|
9767
9726
|
albumIdOf(album2) {
|
|
9768
9727
|
for (const [k, v] of Object.entries(album2.fields)) {
|
|
9769
9728
|
if (k.endsWith("::AlbumId")) return typeof v === "bigint" ? v : BigInt(String(v));
|
|
9770
9729
|
}
|
|
9771
9730
|
return void 0;
|
|
9772
9731
|
}
|
|
9773
|
-
/** Build an EditList<string> wrapper value (AddValues/RemoveValues). */
|
|
9774
|
-
editListStr(add, remove) {
|
|
9775
|
-
const list = /* @__PURE__ */ __name((xs) => {
|
|
9776
|
-
const w = new BinaryWriter().flexInt(xs.length);
|
|
9777
|
-
for (const x of xs) w.string(x);
|
|
9778
|
-
const b = w.toBuffer();
|
|
9779
|
-
return new BinaryWriter().integer(b.length).bytes(b).toBuffer();
|
|
9780
|
-
}, "list");
|
|
9781
|
-
return this.structArg(EDIT_LIST_STR, [
|
|
9782
|
-
{ name: `System.Collections.Generic.IList<string> ${EDIT_LIST_STR}::AddValues`, propType: 24 /* LengthPrefixed */, value: list(add) },
|
|
9783
|
-
{ name: `System.Collections.Generic.IList<string> ${EDIT_LIST_STR}::RemoveValues`, propType: 24 /* LengthPrefixed */, value: list(remove) }
|
|
9784
|
-
]);
|
|
9785
|
-
}
|
|
9786
|
-
/** Build + send a single-album Library::Edit from pre-serialized AlbumEdit member fields. */
|
|
9787
|
-
editAlbumStruct(albumId, fields) {
|
|
9788
|
-
const albumEdit = this.structArg(ALBUM_EDIT, [
|
|
9789
|
-
{ name: `long ${ALBUM_EDIT}::AlbumId`, propType: 1 /* Long */, value: new BinaryWriter().long(albumId).toBuffer() },
|
|
9790
|
-
...fields
|
|
9791
|
-
]);
|
|
9792
|
-
const blob = new BinaryWriter().flexInt(1).bytes(albumEdit).toBuffer();
|
|
9793
|
-
const libraryEdit = this.structArg(LIBRARY_EDIT, [
|
|
9794
|
-
{
|
|
9795
|
-
name: `System.Collections.Generic.IList<${ALBUM_EDIT}> ${LIBRARY_EDIT}::Albums`,
|
|
9796
|
-
propType: 24 /* LengthPrefixed */,
|
|
9797
|
-
value: new BinaryWriter().integer(blob.length).bytes(blob).toBuffer()
|
|
9798
|
-
}
|
|
9799
|
-
]);
|
|
9800
|
-
return this.call(
|
|
9801
|
-
"Library",
|
|
9802
|
-
"Edit",
|
|
9803
|
-
[{ type: "LibraryEdit", name: "edit" }, { type: "ResultCallback", name: "cb" }],
|
|
9804
|
-
libraryEdit,
|
|
9805
|
-
this.serviceOid("Library")
|
|
9806
|
-
);
|
|
9807
|
-
}
|
|
9808
9732
|
};
|
|
9809
|
-
ALBUM_EDIT = "Sooloos.Broker.Api.AlbumEdit";
|
|
9810
|
-
EDIT_OPTIONAL_VAL_INT = "Sooloos.Broker.Api.EditOptionalVal<int>";
|
|
9811
|
-
EDIT_REQUIRED_REF_STR = "Sooloos.Broker.Api.EditRequiredRef<string>";
|
|
9812
|
-
EDIT_LIST_STR = "Sooloos.Broker.Api.EditList<string>";
|
|
9813
|
-
LIBRARY_EDIT = "Sooloos.Broker.Api.LibraryEdit";
|
|
9814
9733
|
__name(member, "member");
|
|
9815
9734
|
__name(decodeStringList, "decodeStringList");
|
|
9816
9735
|
__name(editField, "editField");
|
|
@@ -15538,7 +15457,7 @@ var require_lib2 = __commonJS({
|
|
|
15538
15457
|
var version2;
|
|
15539
15458
|
var init_package = __esm({
|
|
15540
15459
|
"package.json"() {
|
|
15541
|
-
version2 = "0.5.
|
|
15460
|
+
version2 = "0.5.6";
|
|
15542
15461
|
}
|
|
15543
15462
|
});
|
|
15544
15463
|
|
|
@@ -16730,6 +16649,8 @@ async function focusMembers(c, f, people = ["artist", "composer", "producer"]) {
|
|
|
16730
16649
|
m.push({ name: "RequireRatings", propType: 23, value: intList(Array.from({ length: 11 - min }, (_, i) => min + i)) });
|
|
16731
16650
|
}
|
|
16732
16651
|
if (f.favorites) m.push(yes("RequireIsFavorite"));
|
|
16652
|
+
if (f.hidden) m.push(yes("IncludeHidden"));
|
|
16653
|
+
if (f.hidden === "only") m.push(yes("RequireHidden"));
|
|
16733
16654
|
if (f.text) m.push(text("TextFilter", f.text));
|
|
16734
16655
|
if (f.genre) m.push({ name: "RequireGenres", propType: 23, value: textList(names(f.genre)) });
|
|
16735
16656
|
if (f.label) m.push({ name: "RequireLabels", propType: 23, value: textList(names(f.label)) });
|
|
@@ -49812,8 +49733,8 @@ function playParams(c, p, shuffle = false) {
|
|
|
49812
49733
|
return c.structArg("Sooloos.Broker.Api.PlayParameters", members2);
|
|
49813
49734
|
}
|
|
49814
49735
|
__name(playParams, "playParams");
|
|
49815
|
-
function playAlbum(c, zone3, album2, p, shuffle) {
|
|
49816
|
-
const args = Buffer.concat([buildArgs([Arg.ref(zone3), Arg.sooid(c.profile())]), playParams(c, p, shuffle), buildArgs([Arg.ref(album2), Arg.bool(false), Arg.bool(
|
|
49736
|
+
function playAlbum(c, zone3, album2, p, shuffle, includeHidden = false) {
|
|
49737
|
+
const args = Buffer.concat([buildArgs([Arg.ref(zone3), Arg.sooid(c.profile())]), playParams(c, p, shuffle), buildArgs([Arg.ref(album2), Arg.bool(false), Arg.bool(includeHidden)])]);
|
|
49817
49738
|
return c.call(
|
|
49818
49739
|
"Transport",
|
|
49819
49740
|
"PlayAlbum",
|
|
@@ -49863,12 +49784,12 @@ async function started2(zoneName, p) {
|
|
|
49863
49784
|
return { started: false, state };
|
|
49864
49785
|
}
|
|
49865
49786
|
__name(started2, "started");
|
|
49866
|
-
async function play(key, zoneName, how, shuffle) {
|
|
49787
|
+
async function play(key, zoneName, how, shuffle, includeHidden = false) {
|
|
49867
49788
|
const p = PRIORITY[how];
|
|
49868
49789
|
const r = await withCore(async (c) => {
|
|
49869
49790
|
const z2 = findZone(c, zoneName);
|
|
49870
49791
|
const album2 = await findAlbum(c, key);
|
|
49871
|
-
const res = await playAlbum(c, z2.oid, album2.oid, p, shuffle);
|
|
49792
|
+
const res = await playAlbum(c, z2.oid, album2.oid, p, shuffle, includeHidden);
|
|
49872
49793
|
log(`play (${how}${shuffle ? ", shuffled" : ""}): ${field2(album2, "Title")} on ${z2.name} \u2192 ${res.success ? "ok" : res.status}`);
|
|
49873
49794
|
if (!res.success) throw new RoonError(`Roon refused to play it (${res.status})`);
|
|
49874
49795
|
return { zone: z2.name, how, shuffle: shuffle || void 0, title: field2(album2, "Title"), artist: clean(field2(album2, "PerformedBy")) };
|
|
@@ -50213,19 +50134,27 @@ async function cover(zoneName) {
|
|
|
50213
50134
|
const tr = obj(c, field2(items(c, field2(obj(c, field2(z2, "NowPlaying")), "Tracks"))[0], "Track"));
|
|
50214
50135
|
const al = obj(c, field2(tr, "Album"));
|
|
50215
50136
|
const url2 = String(field2(obj(c, field2(al, "Image")), "Url") ?? field2(obj(c, field2(tr, "Image")), "Url") ?? "");
|
|
50216
|
-
const
|
|
50217
|
-
return { key
|
|
50218
|
-
});
|
|
50219
|
-
const off =
|
|
50220
|
-
const
|
|
50137
|
+
const key = /^broker:\/\/\/image\/([^.]+)\./.exec(url2)?.[1];
|
|
50138
|
+
return { key, title: field2(tr, "Title"), album: field2(al, "Title"), artist: clean(field2(al, "PerformedBy")), zone: pick2?.name ?? zoneNames(c).get(String(z2.oid)) };
|
|
50139
|
+
});
|
|
50140
|
+
const off = info.zone ? officialZone(info.zone) : void 0;
|
|
50141
|
+
const urls = [
|
|
50142
|
+
off?.now_playing?.image_key && `/api/image/${off.now_playing.image_key}?scale=fit&width=600&height=600`,
|
|
50143
|
+
info.key && `/image/${info.key}.jpg?scale=fit&width=600&height=600`
|
|
50144
|
+
].filter(Boolean);
|
|
50221
50145
|
const lines = off?.now_playing?.three_line;
|
|
50222
50146
|
if (!info.title && lines?.line1) {
|
|
50223
50147
|
info.title = lines.line1;
|
|
50224
50148
|
info.artist = lines.line2 ?? "";
|
|
50225
50149
|
info.album = lines.line3;
|
|
50226
50150
|
}
|
|
50227
|
-
if (!
|
|
50228
|
-
|
|
50151
|
+
if (!urls.length) throw new RoonError("Roon has no cover for what plays", "not_found");
|
|
50152
|
+
let r = null;
|
|
50153
|
+
for (const u of urls) {
|
|
50154
|
+
r = await fetch(`http://${t.host}:${t.port}${u}`).catch(() => null);
|
|
50155
|
+
if (r?.ok) break;
|
|
50156
|
+
log(`cover: ${u.split("?")[0]} \u2192 ${r ? r.status : "no answer"}`);
|
|
50157
|
+
}
|
|
50229
50158
|
if (!r?.ok) throw new RoonError("Roon doesn't hand over the cover right now", "unavailable");
|
|
50230
50159
|
return {
|
|
50231
50160
|
info: { zone: info.zone, title: info.title, album: info.album, artist: info.artist },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deep-roon-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "An MCP server for Roon that reaches the parts the official API doesn't: reviews, biographies, Qobuz's and TIDAL's shelves, TIDAL's playlists, your history, search across your library and the streaming services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "René Bouwmeester <21277119+renebouwmeester@users.noreply.github.com>",
|