Fix Navidrome schemas for llama.cpp

This commit is contained in:
Mikei386
2026-08-23 15:29:46 +02:00
parent a8a12d2ec1
commit e5dffbc2ba
3 changed files with 15 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
FROM ghcr.io/blakeem/navidrome-mcp:2.2.0@sha256:047f911a5a8f7cc8f185bb4d6e7ca6c435542edefff4694a00c2f718ab0ee7f5
# llama.cpp's tool-schema converter requires every JSON-Schema regex to be
# fully anchored. Upstream 2.2.0 omits the trailing `$` on exactly two radio
# URL fields. Fail the build if upstream changes instead of patching blindly.
USER root
RUN node -e 'const fs=require("node:fs"); const p="/app/dist/tools/handlers/radio-handlers.js"; let s=fs.readFileSync(p,"utf8"); const a="pattern: '\''^https?://.+'\''"; const b="pattern: '\''^https?://.+$'\''"; const n=s.split(a).length-1; if(n!==2) throw new Error(`expected 2 schema patterns, found ${n}`); fs.writeFileSync(p,s.split(a).join(b));'
USER node