Files
mesh-catalog/modules/tautulli/tools/index.ts
T
jschoubben eccfc70991 grafana, tautulli, nextcloud, nodered: full nox modules (ADR 0044/0046)
grafana: status/datasources/dashboards/alerts tools, emits alert.firing.
tautulli: activity/history/stats tools, emits watch.recorded. nextcloud:
users/shares/apps/occ tools (occ via docker exec, shares over OCS), emits
user.created/share.created. nodered: flows/nodes/deploy tools, emits
flows.deployed inline from the deploy tool. All typecheck; manifests parse.
2026-09-04 02:43:20 +02:00

45 lines
1.6 KiB
TypeScript

// tautulli's tools — importing tautulli's own client (novox/hq ADR 0044). They return structured
// data; the mesh serves them through the sdk's tool harness.
import { registerModuleTools, type ToolDefinition } from "@novox/mesh-sdk/tools";
import { TautulliClient } from "../client.js";
export function getTautulliTools(tautulli: TautulliClient): ToolDefinition[] {
return [
{
name: "tautulli_activity",
description: "Current Plex activity as Tautulli sees it — who is streaming what, and progress.",
input: {},
run: async () => tautulli.getActivity(),
},
{
name: "tautulli_history",
description: "Recent Plex watch history — who watched what, and whether they finished.",
input: { length: { type: "number", description: "how many rows (default 25)" } },
run: async (args) => {
const history = await tautulli.getHistory(args.length ? Number(args.length) : 25);
return { count: history.length, history };
},
},
{
name: "tautulli_stats",
description: "Tautulli home statistics — most-watched media, most-active users, and platforms.",
input: {},
run: async () => {
const stats = await tautulli.getHomeStats();
return { count: stats.length, stats };
},
},
];
}
// The tools exist only when an API key can be resolved; without one, tautulli contributes none
// rather than failing the whole tool runtime.
registerModuleTools("tautulli", (env) => {
try {
return getTautulliTools(TautulliClient.fromEnv(env));
} catch {
return [];
}
});