27 lines
717 B
TypeScript
27 lines
717 B
TypeScript
// icecast's tools (novox/hq ADR 0039), 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 [];
|
|
}
|
|
});
|