release: r019 idempotent batch container updates

This commit is contained in:
Mikei386 committed 2026-08-24 11:21:19 +02:00
1 parent 47c27b06c4
commit d90874ed18
11 files changed
+174 -14

No files matched your search

+27 -1
View File
@@ -40,6 +40,7 @@ const CRITICAL_TOOLS = new Set([
"unraid_docker_create",
"unraid_docker_modify",
"unraid_docker_update",
"unraid_docker_update_verified_batch",
"unraid_docker_rebuild",
"unraid_system_shell",
"unraid_ca_install",
@@ -281,7 +282,8 @@ export const TOOLS: ToolDef[] = [
},
{
name: "unraid_docker_update",
description: "Update a container (pull latest image, rebuild).",
description:
"Update one explicitly named container (pull latest image and rebuild). For two or more containers, or when update status may be stale, use unraid_docker_update_verified_batch instead.",
inputSchema: {
type: "object",
properties: { container: str("Container/template name") },
@@ -289,6 +291,30 @@ export const TOOLS: ToolDef[] = [
},
handler: (a) => runPhpHelper("update", validateName(a["container"], "container")),
},
{
name: "unraid_docker_update_verified_batch",
description:
"Authoritative one-call Docker image update workflow for 1-25 explicitly named Unraid containers. Pulls each configured image, compares immutable image IDs, skips already-current containers even if Unraid's cached status is stale, rebuilds only when the image actually changed, preserves every original running/stopped state, and returns compact post-verification (container ID change, state, restart count and health). Use this after read-only update discovery when the user explicitly requested the updates.",
inputSchema: {
type: "object",
properties: {
containers: str(
"One to 25 exact container names separated by |, as returned by Unraid inventory/update status",
),
},
required: ["containers"],
additionalProperties: false,
},
handler: (a) => {
const raw = String(a["containers"] ?? "");
const containers = raw.split("|").map((name) => name.trim()).filter(Boolean);
if (containers.length < 1 || containers.length > 25) {
throw new Error("containers must contain 1-25 names separated by |");
}
const unique = [...new Set(containers.map((name) => validateName(name, "container")))];
return runPhpHelper("update-verified-batch", unique.join("|"));
},
},
{
name: "unraid_docker_rebuild",
description: