diff --git a/dist/mua-2026.11.21.r039-x86_64-1.txz.sha256 b/dist/mua-2026.11.21.r039-x86_64-1.txz.sha256 deleted file mode 100644 index 81e61c8..0000000 --- a/dist/mua-2026.11.21.r039-x86_64-1.txz.sha256 +++ /dev/null @@ -1 +0,0 @@ -49f9187d532089d261e6ee26b495168b7ff369d94a6ab889530f37154a23a48a mua-2026.11.21.r039-x86_64-1.txz diff --git a/dist/mua-2026.11.21.r039-x86_64-1.txz b/dist/mua-2026.11.24.r040-x86_64-1.txz similarity index 71% rename from dist/mua-2026.11.21.r039-x86_64-1.txz rename to dist/mua-2026.11.24.r040-x86_64-1.txz index 6b41f63..a7a0a07 100644 Binary files a/dist/mua-2026.11.21.r039-x86_64-1.txz and b/dist/mua-2026.11.24.r040-x86_64-1.txz differ diff --git a/dist/mua-2026.11.24.r040-x86_64-1.txz.sha256 b/dist/mua-2026.11.24.r040-x86_64-1.txz.sha256 new file mode 100644 index 0000000..6d50e8d --- /dev/null +++ b/dist/mua-2026.11.24.r040-x86_64-1.txz.sha256 @@ -0,0 +1 @@ +a1e1c0c58da49d4a206c63185676315f721b8369ef1a653425463580a3833508 mua-2026.11.24.r040-x86_64-1.txz diff --git a/package.json b/package.json index b02374e..201e60e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mua", - "version": "2026.11.21.r039", + "version": "2026.11.24.r040", "description": "Mikes Unraid Agent - MCP over HTTP(S) (Streamable HTTP) for Unraid", "type": "module", "main": "src/index.ts", diff --git a/plugin/mua.plg b/plugin/mua.plg index eee0eae..2fcf49b 100644 --- a/plugin/mua.plg +++ b/plugin/mua.plg @@ -2,13 +2,13 @@ - + - - + + ]> +### 2026.11.24.r040 +- Neutrale Beispielnamen in Werkzeugbeschreibungen (z. B. Nextcloud statt eines Medien-Containers). +- WebGUI: kein veraltetes curl_close() mehr (Deprecation-Meldung ab PHP 8.5). +- Interne Typprüfung der Prozessausgabe; Tests laufen jetzt auch auf macOS und mit PHP 8.5. + ### 2026.11.21.r039 - WebGUI: neuer Bereich „Verbindung“ mit beiden Endpunkten (Vollständig /mcp/full, Kompakt /mcp/lite), Kopier-Buttons und Auswahl des Standardprofils für /mcp. - WebGUI: Hinweis auf neue, noch nicht freigegebene Werkzeuge mit Button „Neue Lesewerkzeuge freigeben“; Profile „Nur Lesen“ und „Betrieb + Diagnose“ um die neuen Werkzeuge ergänzt. @@ -246,7 +251,7 @@ Das .txz enthält: install/doinst.sh (läuft nach Installation) =========================================== --> - + &txzURL; &txzSHA256; diff --git a/plugin/plugin.json b/plugin/plugin.json index ce928df..bbc2ec4 100644 --- a/plugin/plugin.json +++ b/plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "mua", "author": "Michael", - "version": "2026.11.21.r039", + "version": "2026.11.24.r040", "minver": "7.0.0", "pluginDirectory": "/usr/local/emhttp/plugins/mua", "configDirectory": "/boot/config/plugins/mua", diff --git a/scripts/mua.page b/scripts/mua.page index e034372..375c8d0 100644 --- a/scripts/mua.page +++ b/scripts/mua.page @@ -31,7 +31,6 @@ function mua_api($method, $path, $payload, $token, $port) { curl_setopt_array($ch, $options); $raw = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); return [$code, $raw !== false ? json_decode($raw, true) : null]; } diff --git a/scripts/verify-live-shell.php b/scripts/verify-live-shell.php index df8f5ce..eab0f08 100644 --- a/scripts/verify-live-shell.php +++ b/scripts/verify-live-shell.php @@ -2,7 +2,7 @@ // Read-only acceptance; credentials stay on Unraid. No file copies or private logs. function need($ok,$label){if(!$ok)throw new RuntimeException($label);} $config=[];foreach(file('/boot/config/plugins/mua/mua.conf') as $line){$parts=explode('=',trim($line),2);if(count($parts)===2)$config[trim($parts[0])]=trim($parts[1]);} -function request($method,$params,$authenticated=true){global $config;$headers=['Content-Type: application/json','Accept: application/json, text/event-stream'];if($authenticated)$headers[]='Authorization: Bearer '.$config['MUA_API_KEY'];$c=curl_init('http://127.0.0.1:3002/mcp');curl_setopt_array($c,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_POST=>true,CURLOPT_HTTPHEADER=>$headers,CURLOPT_POSTFIELDS=>json_encode(['jsonrpc'=>'2.0','id'=>1,'method'=>$method,'params'=>$params]),CURLOPT_TIMEOUT=>30]);$body=curl_exec($c);$code=curl_getinfo($c,CURLINFO_HTTP_CODE);$errno=curl_errno($c);curl_close($c);need($errno===0,'Local test transport failed');return [$code,json_decode($body,true)];} +function request($method,$params,$authenticated=true){global $config;$headers=['Content-Type: application/json','Accept: application/json, text/event-stream'];if($authenticated)$headers[]='Authorization: Bearer '.$config['MUA_API_KEY'];$c=curl_init('http://127.0.0.1:3002/mcp');curl_setopt_array($c,[CURLOPT_RETURNTRANSFER=>true,CURLOPT_POST=>true,CURLOPT_HTTPHEADER=>$headers,CURLOPT_POSTFIELDS=>json_encode(['jsonrpc'=>'2.0','id'=>1,'method'=>$method,'params'=>$params]),CURLOPT_TIMEOUT=>30]);$body=curl_exec($c);$code=curl_getinfo($c,CURLINFO_HTTP_CODE);$errno=curl_errno($c);need($errno===0,'Local test transport failed');return [$code,json_decode($body,true)];} function rpc($method,$params){[$code,$r]=request($method,$params);need($code===200&&isset($r['result'])&&empty($r['result']['isError']),'Authenticated MCP request failed');return $r['result'];} [$unauth]=request('initialize',(object)[],false);need($unauth===401,'Unauthenticated request must be rejected'); $i=rpc('initialize',['protocolVersion'=>'2025-03-26','capabilities'=>(object)[],'clientInfo'=>['name'=>'read-only-shell-acceptance','version'=>'1']]);need($i['serverInfo']['version']==='2026.10.12.r031','Expected loaded r031'); diff --git a/src/helpers.ts b/src/helpers.ts index d790053..4dee244 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -19,7 +19,7 @@ import { redactKnownSecrets } from "./redact"; // ── Konstanten ────────────────────────────────────────────────────────── export const MUA_SERVER_NAME = "mua"; -export const MUA_VERSION = "2026.11.21.r039"; +export const MUA_VERSION = "2026.11.24.r040"; export const MUA_PROTOCOL_VERSION = "2025-03-26"; export const PHP_HELPER = "/usr/local/bin/unraid-docker-mcp-helper.php"; export const STATUS_HELPER = "/usr/local/bin/unraid-mcp-status-helper.php"; diff --git a/src/process-output.ts b/src/process-output.ts index 0eaa8f0..54f1281 100644 --- a/src/process-output.ts +++ b/src/process-output.ts @@ -6,13 +6,16 @@ export interface ProcessOutput { /** Keep a bounded head or tail while consuming a subprocess pipe. */ export async function readProcessOutput( - stream: ReadableStream, + stream: ReadableStream | number | undefined, maxBytes: number, options: { mode?: "head" | "tail"; stopOnLimit?: boolean; signal?: AbortSignal } = {}, ): Promise { if (!Number.isSafeInteger(maxBytes) || maxBytes < 1) { throw new Error("Output budget must be a positive safe integer"); } + if (!(stream instanceof ReadableStream)) { + throw new TypeError("Process output must be spawned with \"pipe\""); + } const { mode = "head", stopOnLimit = true, signal } = options; const reader = stream.getReader(); const cancel = () => { void reader.cancel().catch(() => {}); }; diff --git a/test/unraid-fixtures.ts b/test/unraid-fixtures.ts index b4a092a..b2279c1 100644 --- a/test/unraid-fixtures.ts +++ b/test/unraid-fixtures.ts @@ -1,10 +1,10 @@ -import { mkdtempSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; +import { mkdtempSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { tmpdir } from "node:os"; // Synthetic filesystem only; never redirect fixture generation at a NAS. export function unraidRoot(version = "7.0.0", scenario = "yes-local", config?: string) { - const root = mkdtempSync(join(tmpdir(), "mua-unraid-layout-")); + const root = realpathSync(mkdtempSync(join(tmpdir(), "mua-unraid-layout-"))); for (const directory of ["etc/nginx/conf.d", "var/local/emhttp", "boot/config/ssl/certs"]) mkdirSync(join(root, directory), { recursive: true }); writeFileSync(join(root, "etc/unraid-version"), `version="${version}"\n`); writeFileSync(join(root, "var/local/emhttp/nginx.ini"),