feat: consolidate 26 tools into 10 tools with 90 actions

Refactor the entire tool layer to use the consolidated action pattern
(action: Literal[...] with QUERIES/MUTATIONS dicts). This reduces LLM
context from ~12k to ~5k tokens while adding ~60 new API capabilities.

New tools: unraid_info (19 actions), unraid_array (12), unraid_notifications (9),
unraid_users (8), unraid_keys (5). Rewritten: unraid_docker (15), unraid_vm (9),
unraid_storage (6), unraid_rclone (4), unraid_health (3).

Includes 129 tests across 10 test files, code review fixes for 16 issues
(severity ordering, PrefixedID regex, sensitive var redaction, etc.).

Removes tools/system.py (replaced by tools/info.py). Version bumped to 0.2.0.
This commit is contained in:
Jacob Magar
2026-02-08 08:49:47 -05:00
parent 67b775a9bc
commit 523b3edc76
33 changed files with 3538 additions and 1583 deletions

View File

@@ -15,7 +15,7 @@ import websockets
from websockets.legacy.protocol import Subprotocol
from ..config.logging import logger
from ..config.settings import UNRAID_API_KEY, UNRAID_API_URL
from ..config.settings import UNRAID_API_KEY, UNRAID_API_URL, UNRAID_VERIFY_SSL
from ..core.types import SubscriptionData
@@ -162,7 +162,8 @@ class SubscriptionManager:
subprotocols=[Subprotocol("graphql-transport-ws"), Subprotocol("graphql-ws")],
ping_interval=20,
ping_timeout=10,
close_timeout=10
close_timeout=10,
ssl=UNRAID_VERIFY_SSL
) as websocket:
selected_proto = websocket.subprotocol or "none"
@@ -180,15 +181,10 @@ class SubscriptionManager:
if UNRAID_API_KEY:
logger.debug(f"[AUTH:{subscription_name}] Adding authentication payload")
# Use standard X-API-Key header format (matching HTTP client)
auth_payload = {
"X-API-Key": UNRAID_API_KEY,
"x-api-key": UNRAID_API_KEY,
"authorization": f"Bearer {UNRAID_API_KEY}",
"Authorization": f"Bearer {UNRAID_API_KEY}",
"headers": {
"X-API-Key": UNRAID_API_KEY,
"x-api-key": UNRAID_API_KEY,
"Authorization": f"Bearer {UNRAID_API_KEY}"
"X-API-Key": UNRAID_API_KEY
}
}
init_payload["payload"] = auth_payload