refactor!: rename chat providers to channels
This commit is contained in:
17
src/agents/channel-tools.ts
Normal file
17
src/agents/channel-tools.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { listChannelPlugins } from "../channels/plugins/index.js";
|
||||
import type { ChannelAgentTool } from "../channels/plugins/types.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
|
||||
export function listChannelAgentTools(params: {
|
||||
cfg?: ClawdbotConfig;
|
||||
}): ChannelAgentTool[] {
|
||||
// Channel docking: aggregate channel-owned tools (login, etc.).
|
||||
const tools: ChannelAgentTool[] = [];
|
||||
for (const plugin of listChannelPlugins()) {
|
||||
const entry = plugin.agentTools;
|
||||
if (!entry) continue;
|
||||
const resolved = typeof entry === "function" ? entry(params) : entry;
|
||||
if (Array.isArray(resolved)) tools.push(...resolved);
|
||||
}
|
||||
return tools;
|
||||
}
|
||||
Reference in New Issue
Block a user