Resolve review
This commit is contained in:
parent
f5518781da
commit
f24d0cfe8a
@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user