searxng, icecast, photos: full nox modules (ADR 0044/0046)
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.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// 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 [];
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user