Resolve review

This commit is contained in:
Haakam Aujla 2026-01-27 23:34:03 -08:00
parent f5518781da
commit f24d0cfe8a

View File

@ -1,13 +1,18 @@
import type { ChannelAgentTool } from "clawdbot/plugin-sdk"; import type { ChannelAgentTool } from "clawdbot/plugin-sdk";
import { AgentMailToolkit } from "agentmail-toolkit/clawdbot"; import { AgentMailToolkit } from "agentmail-toolkit/clawdbot";
import { getAgentMailClient } from "./client.js"; import { getResolvedCredentials } from "./client.js";
import { AgentMailClient } from "agentmail";
/** /**
* Returns all AgentMail agent tools. * Returns all AgentMail agent tools.
* Returns empty array if AgentMail is not configured (no token).
*/ */
export function createAgentMailTools(): ChannelAgentTool[] { export function createAgentMailTools(): ChannelAgentTool[] {
const client = getAgentMailClient(); const { apiKey } = getResolvedCredentials();
if (!apiKey) return [];
const client = new AgentMailClient({ apiKey });
const toolkit = new AgentMailToolkit(client); const toolkit = new AgentMailToolkit(client);
return toolkit.getTools(); return toolkit.getTools();
} }