diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 75baaa63..32a999f4 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -215,6 +215,14 @@ export async function initializeClients( clients.push(twitterClients); } + if (character.plugins.length > 0) { + character.plugins.forEach(async (plugin) => { + plugin.clients.forEach(async (client) => { + clients.push(await client.start(runtime)); + }); + }); + } + return clients; } @@ -224,7 +232,10 @@ export async function createAgent( token: string ) { console.log("Creating runtime for character", character.name); - console.log("character.settings.secrets?.WALLET_PUBLIC_KEY", character.settings.secrets?.WALLET_PUBLIC_KEY) + console.log( + "character.settings.secrets?.WALLET_PUBLIC_KEY", + character.settings.secrets?.WALLET_PUBLIC_KEY + ); return new AgentRuntime({ databaseAdapter: db, token, diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 962fe0e4..c68f614b 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -317,6 +317,7 @@ export type Plugin = { providers?: Provider[]; evaluators?: Evaluator[]; services?: Service[]; + clients?: Client[]; }; export enum Clients {