searxng: a search tool — tools-only, a stateless search has nothing to observe. icecast: status tool, emits stream.started/.stopped by diffing live mountpoints. photos: status/albums/recent tools, emits item.added (immich-shaped API, coded defensively since the stub ships a placeholder image — flagged in the code). Typecheck; manifests parse.
27 lines
717 B
TypeScript
27 lines
717 B
TypeScript
// icecast's tools (novox/hq ADR 0044), importing icecast's own client.
|
|
|
|
import { registerModuleTools, type ToolDefinition } from "@novox/mesh-sdk/tools";
|
|
import { IcecastClient } from "../client.js";
|
|
|
|
export function getIcecastTools(icecast: IcecastClient): ToolDefinition[] {
|
|
return [
|
|
{
|
|
name: "icecast_status",
|
|
description: "Icecast streaming status: live mountpoints, each with its listener count, plus the total.",
|
|
input: {},
|
|
run: async () => {
|
|
const status = await icecast.getStatus();
|
|
return status;
|
|
},
|
|
},
|
|
];
|
|
}
|
|
|
|
registerModuleTools("icecast", (env) => {
|
|
try {
|
|
return getIcecastTools(IcecastClient.fromEnv(env));
|
|
} catch {
|
|
return [];
|
|
}
|
|
});
|