From 7ada729e709c14c9b2128eb4eaf663334e2465af Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Fri, 13 Dec 2024 12:16:46 +0530 Subject: [PATCH 01/10] changed types according to multiagent --- packages/core/src/environment.ts | 9 +++++++-- packages/core/src/types.ts | 12 ++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/core/src/environment.ts b/packages/core/src/environment.ts index 8e5f338936..593597d372 100644 --- a/packages/core/src/environment.ts +++ b/packages/core/src/environment.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ModelProviderName, Clients } from "./types"; +import { ModelProviderName, ClientType } from "./types"; // TODO: TO COMPLETE export const envSchema = z.object({ @@ -62,6 +62,11 @@ const PluginSchema = z.object({ clients: z.array(z.any()).optional(), }); +const clientSchema = z.object({ + type: z.nativeEnum(ClientType), + credentials: z.record(z.string()), +}); + // Main Character schema export const CharacterSchema = z.object({ id: z.string().uuid().optional(), @@ -77,7 +82,7 @@ export const CharacterSchema = z.object({ topics: z.array(z.string()), adjectives: z.array(z.string()), knowledge: z.array(z.string()).optional(), - clients: z.array(z.nativeEnum(Clients)), + clients: z.array(z.array(clientSchema)), plugins: z.union([ z.array(z.string()), z.array(PluginSchema), diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index b9790e98f7..f7be772867 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -601,13 +601,21 @@ export type Plugin = { /** * Available client platforms */ -export enum Clients { +export enum ClientType { DISCORD = "discord", DIRECT = "direct", TWITTER = "twitter", TELEGRAM = "telegram", - FARCASTER = "farcaster", + FARCASTER = "farcaster" } + +export type Clients = { + type: ClientType; + credentials: { + [key: string]: string; + }; +}; + /** * Configuration for an agent character */ From f0c0e19f64c5106dd36cea257bf7a89136a31800 Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Fri, 13 Dec 2024 13:46:31 +0530 Subject: [PATCH 02/10] Add twitter multi account config setup --- agent/src/index.ts | 21 ++++++---- packages/client-twitter/src/base.ts | 29 ++++++++----- packages/client-twitter/src/environment.ts | 15 +++++-- packages/client-twitter/src/index.ts | 18 ++++---- packages/client-twitter/src/interactions.ts | 46 +++++++++++---------- packages/client-twitter/src/post.ts | 21 ++++++---- packages/client-twitter/src/search.ts | 29 +++++++------ packages/core/src/environment.ts | 2 +- packages/core/src/tests/environment.test.ts | 4 +- packages/core/src/types.ts | 10 +++-- 10 files changed, 110 insertions(+), 85 deletions(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index bb631a8136..a4734fb373 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -10,6 +10,7 @@ import { AgentRuntime, CacheManager, Character, + ClientType, Clients, DbCacheAdapter, FsCacheAdapter, @@ -50,6 +51,7 @@ import path from "path"; import readline from "readline"; import { fileURLToPath } from "url"; import yargs from "yargs"; +import { customCharacter } from "../custom.character"; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file const __dirname = path.dirname(__filename); // get the name of the directory @@ -192,7 +194,7 @@ export async function loadCharacters( if (loadedCharacters.length === 0) { elizaLogger.info("No characters found, using default character"); - loadedCharacters.push(defaultCharacter); + loadedCharacters.push(customCharacter); } return loadedCharacters; @@ -324,29 +326,30 @@ export async function initializeClients( ) { const clients = []; const clientTypes = - character.clients?.map((str) => str.toLowerCase()) || []; + character.clients?.map((str) => str.type) || []; - if (clientTypes.includes("auto")) { + if (clientTypes.includes(ClientType.DIRECT)) { const autoClient = await AutoClientInterface.start(runtime); if (autoClient) clients.push(autoClient); } - if (clientTypes.includes("discord")) { + if (clientTypes.includes(ClientType.DISCORD)) { clients.push(await DiscordClientInterface.start(runtime)); } - if (clientTypes.includes("telegram")) { + if (clientTypes.includes(ClientType.TELEGRAM)) { const telegramClient = await TelegramClientInterface.start(runtime); if (telegramClient) clients.push(telegramClient); } - if (clientTypes.includes("twitter")) { + if (clientTypes.includes(ClientType.TWITTER)) { + const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; TwitterClientInterface.enableSearch = !isFalsish(getSecret(character, "TWITTER_SEARCH_ENABLE")); - const twitterClients = await TwitterClientInterface.start(runtime); + const twitterClients = await TwitterClientInterface.start(runtime, config); clients.push(twitterClients); } - if (clientTypes.includes("farcaster")) { + if (clientTypes.includes(ClientType.FARCASTER)) { const farcasterClients = new FarcasterAgentClient(runtime); farcasterClients.start(); clients.push(farcasterClients); @@ -542,7 +545,7 @@ const startAgents = async () => { let charactersArg = args.characters || args.character; - let characters = [defaultCharacter]; + let characters = [customCharacter]; if (charactersArg) { characters = await loadCharacters(charactersArg); diff --git a/packages/client-twitter/src/base.ts b/packages/client-twitter/src/base.ts index fd469a4dbd..72a2a5efc2 100644 --- a/packages/client-twitter/src/base.ts +++ b/packages/client-twitter/src/base.ts @@ -8,6 +8,7 @@ import { getEmbeddingZeroVector, elizaLogger, stringToUuid, + IAgentConfig, } from "@ai16z/eliza"; import { QueryTweetsResponse, @@ -85,6 +86,7 @@ export class ClientBase extends EventEmitter { static _twitterClients: { [accountIdentifier: string]: Scraper } = {}; twitterClient: Scraper; runtime: IAgentRuntime; + config: IAgentConfig; directions: string; lastCheckedTweetId: bigint | null = null; imageDescriptionService: IImageDescriptionService; @@ -134,10 +136,11 @@ export class ClientBase extends EventEmitter { ); } - constructor(runtime: IAgentRuntime) { + constructor(runtime: IAgentRuntime, config: IAgentConfig) { super(); this.runtime = runtime; - const username = this.runtime.getSetting("TWITTER_USERNAME"); + this.config = config; + const username = this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); if (ClientBase._twitterClients[username]) { this.twitterClient = ClientBase._twitterClients[username]; } else { @@ -154,16 +157,19 @@ export class ClientBase extends EventEmitter { async init() { //test - const username = this.runtime.getSetting("TWITTER_USERNAME"); + const username = this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); + const password = this.config.TWITTER_PASSWORD || this.runtime.getSetting("TWITTER_PASSWORD"); + const email = this.config.TWITTER_EMAIL || this.runtime.getSetting("TWITTER_EMAIL"); + const twitter2faSecret = this.config.TWITTER_2FA_SECRET || this.runtime.getSetting("TWITTER_2FA_SECRET") || undefined; + const cookies = this.config.TWITTER_COOKIES || this.runtime.getSetting("TWITTER_COOKIES"); + if (!username) { throw new Error("Twitter username not configured"); } // Check for Twitter cookies - if (this.runtime.getSetting("TWITTER_COOKIES")) { - const cookiesArray = JSON.parse( - this.runtime.getSetting("TWITTER_COOKIES") - ); + if (cookies) { + const cookiesArray = JSON.parse(cookies); await this.setCookiesFromArray(cookiesArray); } else { @@ -177,9 +183,9 @@ export class ClientBase extends EventEmitter { while (true) { await this.twitterClient.login( username, - this.runtime.getSetting("TWITTER_PASSWORD"), - this.runtime.getSetting("TWITTER_EMAIL"), - this.runtime.getSetting("TWITTER_2FA_SECRET") || undefined + password, + email, + twitter2faSecret ); if (await this.twitterClient.isLoggedIn()) { @@ -469,10 +475,11 @@ export class ClientBase extends EventEmitter { } const timeline = await this.fetchHomeTimeline(cachedTimeline ? 10 : 50); + const username = this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); // Get the most recent 20 mentions and interactions const mentionsAndInteractions = await this.fetchSearchTweets( - `@${this.runtime.getSetting("TWITTER_USERNAME")}`, + `@${username}`, 20, SearchMode.Latest ); diff --git a/packages/client-twitter/src/environment.ts b/packages/client-twitter/src/environment.ts index 8b22d0dc59..7dd952272b 100644 --- a/packages/client-twitter/src/environment.ts +++ b/packages/client-twitter/src/environment.ts @@ -1,4 +1,4 @@ -import { IAgentRuntime } from "@ai16z/eliza"; +import { IAgentConfig, IAgentRuntime } from "@ai16z/eliza"; import { z } from "zod"; export const DEFAULT_MAX_TWEET_LENGTH = 280; @@ -20,33 +20,40 @@ export const twitterEnvSchema = z.object({ export type TwitterConfig = z.infer; export async function validateTwitterConfig( - runtime: IAgentRuntime + runtime: IAgentRuntime, + config: IAgentConfig ): Promise { try { - const config = { + const twitterConfig = { TWITTER_DRY_RUN: + config.TWITTER_DRY_RUN || runtime.getSetting("TWITTER_DRY_RUN") || process.env.TWITTER_DRY_RUN || "false", TWITTER_USERNAME: + config.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME") || process.env.TWITTER_USERNAME, TWITTER_PASSWORD: + config.TWITTER_PASSWORD || runtime.getSetting("TWITTER_PASSWORD") || process.env.TWITTER_PASSWORD, TWITTER_EMAIL: + config.TWITTER_EMAIL || runtime.getSetting("TWITTER_EMAIL") || process.env.TWITTER_EMAIL, TWITTER_COOKIES: + config.TWITTER_COOKIES || runtime.getSetting("TWITTER_COOKIES") || process.env.TWITTER_COOKIES, MAX_TWEET_LENGTH: + config.MAX_TWEET_LENGTH || runtime.getSetting("MAX_TWEET_LENGTH") || process.env.MAX_TWEET_LENGTH || DEFAULT_MAX_TWEET_LENGTH.toString(), }; - return twitterEnvSchema.parse(config); + return twitterEnvSchema.parse(twitterConfig); } catch (error) { if (error instanceof z.ZodError) { const errorMessages = error.errors diff --git a/packages/client-twitter/src/index.ts b/packages/client-twitter/src/index.ts index b973b84eae..732e12181b 100644 --- a/packages/client-twitter/src/index.ts +++ b/packages/client-twitter/src/index.ts @@ -1,7 +1,7 @@ import { TwitterPostClient } from "./post.ts"; import { TwitterSearchClient } from "./search.ts"; import { TwitterInteractionClient } from "./interactions.ts"; -import { IAgentRuntime, Client, elizaLogger } from "@ai16z/eliza"; +import { IAgentRuntime, Client, elizaLogger, IAgentConfig } from "@ai16z/eliza"; import { validateTwitterConfig } from "./environment.ts"; import { ClientBase } from "./base.ts"; @@ -10,9 +10,9 @@ class TwitterManager { post: TwitterPostClient; search: TwitterSearchClient; interaction: TwitterInteractionClient; - constructor(runtime: IAgentRuntime, enableSearch:boolean) { - this.client = new ClientBase(runtime); - this.post = new TwitterPostClient(this.client, runtime); + constructor(runtime: IAgentRuntime, config: IAgentConfig, enableSearch:boolean) { + this.client = new ClientBase(runtime, config); + this.post = new TwitterPostClient(this.client, runtime, config); if (enableSearch) { // this searches topics from character file @@ -21,23 +21,23 @@ class TwitterManager { elizaLogger.warn('2. burns your rate limit') elizaLogger.warn('3. can get your account banned') elizaLogger.warn('use at your own risk') - this.search = new TwitterSearchClient(this.client, runtime); // don't start the search client by default + this.search = new TwitterSearchClient(this.client, runtime, config); // don't start the search client by default } - this.interaction = new TwitterInteractionClient(this.client, runtime); + this.interaction = new TwitterInteractionClient(this.client, runtime, config); } } export const TwitterClientInterface: Client = { - async start(runtime: IAgentRuntime) { - await validateTwitterConfig(runtime); + async start(runtime: IAgentRuntime, config: IAgentConfig) { + await validateTwitterConfig(runtime, config); elizaLogger.log("Twitter client started"); // enableSearch is just set previous to this call // so enableSearch can change over time // and changing it won't stop the SearchClient in the existing instance - const manager = new TwitterManager(runtime, this.enableSearch); + const manager = new TwitterManager(runtime, config ,this.enableSearch); await manager.client.init(); diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index 739b55bc28..f66ff7995f 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -14,6 +14,7 @@ import { stringToUuid, elizaLogger, getEmbeddingZeroVector, + IAgentConfig, } from "@ai16z/eliza"; import { ClientBase } from "./base"; import { buildConversationThread, sendTweet, wait } from "./utils.ts"; @@ -53,7 +54,7 @@ Here is the current post text again. Remember to include an action if the curren {{currentPost}} ` + messageCompletionFooter; -export const twitterShouldRespondTemplate = (targetUsersStr: string) => +export const twitterShouldRespondTemplate = (targetUsersStr: string) => `# INSTRUCTIONS: Determine if {{agentName}} (@{{twitterUserName}}) should respond to the message and participate in the conversation. Do not comment. Just respond with "true" or "false". Response options are RESPOND, IGNORE and STOP. @@ -89,10 +90,11 @@ Thread of Tweets You Are Replying To: export class TwitterInteractionClient { client: ClientBase; runtime: IAgentRuntime; - - constructor(client: ClientBase, runtime: IAgentRuntime) { + config: IAgentConfig; + constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { this.client = client; this.runtime = runtime; + this.config = config; } async start() { @@ -101,7 +103,7 @@ export class TwitterInteractionClient { setTimeout( handleTwitterInteractionsLoop, Number( - this.runtime.getSetting("TWITTER_POLL_INTERVAL") || 120 + this.config.TWITTER_POLL_INTERVAL || this.runtime.getSetting("TWITTER_POLL_INTERVAL") || 120 ) * 1000 // Default to 2 minutes ); }; @@ -111,7 +113,7 @@ export class TwitterInteractionClient { async handleTwitterInteractions() { elizaLogger.log("Checking Twitter interactions"); // Read from environment variable, fallback to default list if not set - const targetUsersStr = this.runtime.getSetting("TWITTER_TARGET_USERS"); + const targetUsersStr = this.config.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); const twitterUsername = this.client.profile.username; try { @@ -133,7 +135,7 @@ export class TwitterInteractionClient { .filter(u => u.length > 0); // Filter out empty strings after split elizaLogger.log("Processing target users:", TARGET_USERS); - + if (TARGET_USERS.length > 0) { // Create a map to store tweets by user const tweetsByUser = new Map(); @@ -142,24 +144,24 @@ export class TwitterInteractionClient { for (const username of TARGET_USERS) { try { const userTweets = (await this.client.twitterClient.fetchSearchTweets( - `from:${username}`, - 3, - SearchMode.Latest + `from:${username}`, + 3, + SearchMode.Latest )).tweets; // Filter for unprocessed, non-reply, recent tweets const validTweets = userTweets.filter(tweet => { - const isUnprocessed = !this.client.lastCheckedTweetId || + const isUnprocessed = !this.client.lastCheckedTweetId || parseInt(tweet.id) > this.client.lastCheckedTweetId; const isRecent = (Date.now() - (tweet.timestamp * 1000)) < 2 * 60 * 60 * 1000; - + elizaLogger.log(`Tweet ${tweet.id} checks:`, { isUnprocessed, isRecent, isReply: tweet.isReply, isRetweet: tweet.isRetweet }); - + return isUnprocessed && !tweet.isReply && !tweet.isRetweet && isRecent; }); @@ -191,7 +193,7 @@ export class TwitterInteractionClient { elizaLogger.log("No target users configured, processing only mentions"); } - + // Sort tweet candidates by ID in ascending order uniqueTweetCandidates @@ -319,7 +321,7 @@ export class TwitterInteractionClient { let state = await this.runtime.composeState(message, { twitterClient: this.client.twitterClient, - twitterUserName: this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), currentPost, formattedConversation, }); @@ -356,20 +358,20 @@ export class TwitterInteractionClient { } // 1. Get the raw target users string from settings - const targetUsersStr = this.runtime.getSetting("TWITTER_TARGET_USERS"); + const targetUsersStr = this.config.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); // 2. Process the string to get valid usernames - const validTargetUsersStr = targetUsersStr && targetUsersStr.trim() + const validTargetUsersStr = targetUsersStr && targetUsersStr.trim() ? targetUsersStr.split(',') // Split by commas: "user1,user2" -> ["user1", "user2"] .map(u => u.trim()) // Remove whitespace: [" user1 ", "user2 "] -> ["user1", "user2"] - .filter(u => u.length > 0) - .join(',') - : ''; + .filter(u => u.length > 0) + .join(',') + : ''; const shouldRespondContext = composeContext({ state, - template: this.runtime.character.templates?.twitterShouldRespondTemplate?.(validTargetUsersStr) || - this.runtime.character?.templates?.shouldRespondTemplate || + template: this.runtime.character.templates?.twitterShouldRespondTemplate?.(validTargetUsersStr) || + this.runtime.character?.templates?.shouldRespondTemplate || twitterShouldRespondTemplate(validTargetUsersStr), }); @@ -418,7 +420,7 @@ export class TwitterInteractionClient { this.client, response, message.roomId, - this.runtime.getSetting("TWITTER_USERNAME"), + this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), tweet.id ); return memories; diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index 51737e8cfe..b1f46c6b4a 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -7,6 +7,7 @@ import { ModelClass, stringToUuid, parseBooleanFromText, + IAgentConfig, } from "@ai16z/eliza"; import { elizaLogger } from "@ai16z/eliza"; import { ClientBase } from "./base.ts"; @@ -96,6 +97,8 @@ function truncateToCompleteSentence( export class TwitterPostClient { client: ClientBase; runtime: IAgentRuntime; + config: IAgentConfig; + twitterUsername: string; private isProcessing: boolean = false; private lastProcessTime: number = 0; private stopProcessingActions: boolean = false; @@ -111,7 +114,7 @@ export class TwitterPostClient { timestamp: number; }>( "twitter/" + - this.runtime.getSetting("TWITTER_USERNAME") + + this.twitterUsername + "/lastPost" ); @@ -187,9 +190,11 @@ export class TwitterPostClient { } } - constructor(client: ClientBase, runtime: IAgentRuntime) { + constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { this.client = client; this.runtime = runtime; + this.config = config; + this.twitterUsername = config.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); } private async generateNewTweet() { @@ -275,7 +280,7 @@ export class TwitterPostClient { // Final cleaning cleanedContent = removeQuotes(content); - if (this.runtime.getSetting("TWITTER_DRY_RUN") === "true") { + if ((this.config.TWITTER_DRY_RUN || this.runtime.getSetting("TWITTER_DRY_RUN")) === "true") { elizaLogger.info( `Dry run: would have posted tweet: ${cleanedContent}` ); @@ -309,7 +314,7 @@ export class TwitterPostClient { userId: this.client.profile.id, inReplyToStatusId: tweetResult.legacy.in_reply_to_status_id_str, - permanentUrl: `https://twitter.com/${this.runtime.getSetting("TWITTER_USERNAME")}/status/${tweetResult.rest_id}`, + permanentUrl: `https://twitter.com/${this.twitterUsername}/status/${tweetResult.rest_id}`, hashtags: [], mentions: [], photos: [], @@ -429,7 +434,7 @@ export class TwitterPostClient { await this.runtime.ensureUserExists( this.runtime.agentId, - this.runtime.getSetting("TWITTER_USERNAME"), + this.twitterUsername, this.runtime.character.name, "twitter" ); @@ -460,7 +465,7 @@ export class TwitterPostClient { content: { text: "", action: "" }, }, { - twitterUserName: this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.twitterUsername, currentTweet: `ID: ${tweet.id}\nFrom: ${tweet.name} (@${tweet.username})\nText: ${tweet.text}`, } ); @@ -546,7 +551,7 @@ export class TwitterPostClient { content: { text: tweet.text, action: "QUOTE" } }, { - twitterUserName: this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.twitterUsername, currentPost: `From @${tweet.username}: ${tweet.text}`, formattedConversation, imageContext: imageDescriptions.length > 0 @@ -695,7 +700,7 @@ export class TwitterPostClient { content: { text: tweet.text, action: "" } }, { - twitterUserName: this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.twitterUsername, currentPost: `From @${tweet.username}: ${tweet.text}`, formattedConversation, imageContext: imageDescriptions.length > 0 diff --git a/packages/client-twitter/src/search.ts b/packages/client-twitter/src/search.ts index 8cfeef8dc7..1f50432536 100644 --- a/packages/client-twitter/src/search.ts +++ b/packages/client-twitter/src/search.ts @@ -1,5 +1,5 @@ import { SearchMode } from "agent-twitter-client"; -import { composeContext } from "@ai16z/eliza"; +import { composeContext, IAgentConfig } from "@ai16z/eliza"; import { generateMessageResponse, generateText } from "@ai16z/eliza"; import { messageCompletionFooter } from "@ai16z/eliza"; import { @@ -45,11 +45,15 @@ Your response should not contain any questions. Brief, concise statements only. export class TwitterSearchClient { client: ClientBase; runtime: IAgentRuntime; + config: IAgentConfig; + twitterUsername: string; private respondedTweets: Set = new Set(); - constructor(client: ClientBase, runtime: IAgentRuntime) { + constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { this.client = client; this.runtime = runtime; + this.config = config; + this.twitterUsername = config.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); } async start() { @@ -108,13 +112,13 @@ export class TwitterSearchClient { const prompt = ` Here are some tweets related to the search term "${searchTerm}": - + ${[...slicedTweets, ...homeTimeline] .filter((tweet) => { // ignore tweets where any of the thread tweets contain a tweet by the bot const thread = tweet.thread; const botTweet = thread.find( - (t) => t.username === this.runtime.getSetting("TWITTER_USERNAME") + (t) => t.username === this.twitterUsername ); return !botTweet; }) @@ -126,7 +130,7 @@ export class TwitterSearchClient { ` ) .join("\n")} - + Which tweet is the most interesting and relevant for Ruby to reply to? Please provide only the ID of the tweet in your response. Notes: - Respond to English tweets only @@ -155,10 +159,7 @@ export class TwitterSearchClient { console.log("Selected tweet to reply to:", selectedTweet?.text); - if ( - selectedTweet.username === - this.runtime.getSetting("TWITTER_USERNAME") - ) { + if (selectedTweet.username === this.twitterUsername) { console.log("Skipping tweet from bot itself"); return; } @@ -209,9 +210,7 @@ export class TwitterSearchClient { const replies = selectedTweet.thread; const replyContext = replies .filter( - (reply) => - reply.username !== - this.runtime.getSetting("TWITTER_USERNAME") + (reply) => reply.username !== this.twitterUsername ) .map((reply) => `@${reply.username}: ${reply.text}`) .join("\n"); @@ -237,10 +236,10 @@ export class TwitterSearchClient { let state = await this.runtime.composeState(message, { twitterClient: this.client.twitterClient, - twitterUserName: this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.twitterUsername, timeline: formattedHomeTimeline, tweetContext: `${tweetBackground} - + Original Post: By @${selectedTweet.username} ${selectedTweet.text}${replyContext.length > 0 && `\nReplies to original post:\n${replyContext}`} @@ -282,7 +281,7 @@ export class TwitterSearchClient { this.client, response, message.roomId, - this.runtime.getSetting("TWITTER_USERNAME"), + this.twitterUsername, tweetId ); return memories; diff --git a/packages/core/src/environment.ts b/packages/core/src/environment.ts index 593597d372..5d00ce0de2 100644 --- a/packages/core/src/environment.ts +++ b/packages/core/src/environment.ts @@ -64,7 +64,7 @@ const PluginSchema = z.object({ const clientSchema = z.object({ type: z.nativeEnum(ClientType), - credentials: z.record(z.string()), + config: z.record(z.string()), }); // Main Character schema diff --git a/packages/core/src/tests/environment.test.ts b/packages/core/src/tests/environment.test.ts index f38b683919..d058432d07 100644 --- a/packages/core/src/tests/environment.test.ts +++ b/packages/core/src/tests/environment.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { validateEnv, validateCharacterConfig } from '../environment'; -import { Clients, ModelProviderName } from '../types'; +import { ClientType, ModelProviderName } from '../types'; describe('Environment Configuration', () => { const originalEnv = process.env; @@ -71,7 +71,7 @@ describe('Character Configuration', () => { postExamples: ['Test post'], topics: ['topic1'], adjectives: ['friendly'], - clients: [Clients.DISCORD], + clients: [{type: ClientType.TWITTER, config: {}}], plugins: ['test-plugin'], style: { all: ['style1'], diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index f7be772867..701c9ef057 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -566,7 +566,7 @@ export type Media = { */ export type Client = { /** Start client connection */ - start: (runtime: IAgentRuntime) => Promise; + start: (runtime: IAgentRuntime, config?: IAgentConfig) => Promise; /** Stop client connection */ stop: (runtime: IAgentRuntime) => Promise; @@ -609,11 +609,13 @@ export enum ClientType { FARCASTER = "farcaster" } +export interface IAgentConfig { + [key: string]: string; +} + export type Clients = { type: ClientType; - credentials: { - [key: string]: string; - }; + config: IAgentConfig; }; /** From 6caf7898de88406a13d89f7e0978f2646a96afaf Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Fri, 13 Dec 2024 15:52:07 +0530 Subject: [PATCH 03/10] Revert the generate twitter loop --- packages/client-twitter/src/post.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index b1f46c6b4a..7c4b4161e9 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -139,8 +139,6 @@ export class TwitterPostClient { elizaLogger.log(`Next tweet scheduled in ${randomMinutes} minutes`); }; - - const processActionsLoop = async () => { const actionInterval = parseInt( this.runtime.getSetting("ACTION_INTERVAL") @@ -188,6 +186,7 @@ export class TwitterPostClient { } else { elizaLogger.log("Action processing loop disabled by configuration"); } + generateNewTweetLoop(); } constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { From e56ecb3ec092939f966d24e124818e1daee05e8f Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Fri, 13 Dec 2024 18:05:43 +0530 Subject: [PATCH 04/10] Modify the twitter client documentation --- agent/src/index.ts | 2 +- docs/docs/packages/agent.md | 13 +++++++------ docs/docs/packages/agents.md | 17 +++++++---------- docs/docs/packages/clients.md | 4 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index a4734fb373..91bf7d3b50 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -326,7 +326,7 @@ export async function initializeClients( ) { const clients = []; const clientTypes = - character.clients?.map((str) => str.type) || []; + character.clients?.map((str) => str.type.toLowerCase()) || []; if (clientTypes.includes(ClientType.DIRECT)) { const autoClient = await AutoClientInterface.start(runtime); diff --git a/docs/docs/packages/agent.md b/docs/docs/packages/agent.md index 87108048b7..faa640178a 100644 --- a/docs/docs/packages/agent.md +++ b/docs/docs/packages/agent.md @@ -136,18 +136,19 @@ export async function initializeClients( runtime: IAgentRuntime, ) { const clients = []; - const clientTypes = character.clients?.map((str) => str.toLowerCase()) || []; + const clientTypes = character.clients?.map((str) => str.type.toLowerCase()) || []; - if (clientTypes.includes("discord")) { + if (clientTypes.includes(ClientType.DISCORD)) { clients.push(await DiscordClientInterface.start(runtime)); } - if (clientTypes.includes("telegram")) { + if (clientTypes.includes(ClientType.TELEGRAM)) { clients.push(await TelegramClientInterface.start(runtime)); } - if (clientTypes.includes("twitter")) { - clients.push(await TwitterClientInterface.start(runtime)); + if (clientTypes.includes(ClientType.TWITTER)) { + const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; + clients.push(await TwitterClientInterface.start(runtime, config)); } - if (clientTypes.includes("auto")) { + if (clientTypes.includes(ClientType.DIRECT)) { clients.push(await AutoClientInterface.start(runtime)); } diff --git a/docs/docs/packages/agents.md b/docs/docs/packages/agents.md index 7a57d65cfb..9e6a01c493 100644 --- a/docs/docs/packages/agents.md +++ b/docs/docs/packages/agents.md @@ -99,22 +99,19 @@ export async function initializeClients( runtime: IAgentRuntime, ) { const clients = []; - const clientTypes = character.clients?.map((str) => str.toLowerCase()) || []; + const clientTypes = character.clients?.map((str) => str.type.toLowerCase()) || []; - // Initialize requested clients - if (clientTypes.includes("discord")) { + if (clientTypes.includes(ClientType.DISCORD)) { clients.push(await DiscordClientInterface.start(runtime)); } - - if (clientTypes.includes("telegram")) { + if (clientTypes.includes(ClientType.TELEGRAM)) { clients.push(await TelegramClientInterface.start(runtime)); } - - if (clientTypes.includes("twitter")) { - clients.push(await TwitterClientInterface.start(runtime)); + if (clientTypes.includes(ClientType.TWITTER)) { + const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; + clients.push(await TwitterClientInterface.start(runtime, config)); } - - if (clientTypes.includes("auto")) { + if (clientTypes.includes(ClientType.DIRECT)) { clients.push(await AutoClientInterface.start(runtime)); } diff --git a/docs/docs/packages/clients.md b/docs/docs/packages/clients.md index 3d302aa631..de9b9f8908 100644 --- a/docs/docs/packages/clients.md +++ b/docs/docs/packages/clients.md @@ -134,9 +134,9 @@ The Twitter client enables posting, searching, and interacting with Twitter user ```typescript import { TwitterClientInterface } from "@eliza/client-twitter"; - +const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; // Initialize client -const client = await TwitterClientInterface.start(runtime); +const client = await TwitterClientInterface.start(runtime, config); // Configuration in .env TWITTER_USERNAME = your_username; From 373b29038dfc20f35d45f6057170646d4a5e04b1 Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Fri, 13 Dec 2024 18:19:58 +0530 Subject: [PATCH 05/10] Revert to default character in agent src index file --- agent/src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index 91bf7d3b50..06ba2f0657 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -51,7 +51,6 @@ import path from "path"; import readline from "readline"; import { fileURLToPath } from "url"; import yargs from "yargs"; -import { customCharacter } from "../custom.character"; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file const __dirname = path.dirname(__filename); // get the name of the directory @@ -194,7 +193,7 @@ export async function loadCharacters( if (loadedCharacters.length === 0) { elizaLogger.info("No characters found, using default character"); - loadedCharacters.push(customCharacter); + loadedCharacters.push(defaultCharacter); } return loadedCharacters; @@ -545,7 +544,7 @@ const startAgents = async () => { let charactersArg = args.characters || args.character; - let characters = [customCharacter]; + let characters = [defaultCharacter]; if (charactersArg) { characters = await loadCharacters(charactersArg); From 4c0666f2acea6f5d41960c19c0f2aef7143716da Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Fri, 13 Dec 2024 18:42:55 +0530 Subject: [PATCH 06/10] Resolve bug on optional config --- packages/client-twitter/src/base.ts | 14 +++++++------- packages/client-twitter/src/environment.ts | 12 ++++++------ packages/client-twitter/src/interactions.ts | 10 +++++----- packages/client-twitter/src/post.ts | 4 ++-- packages/client-twitter/src/search.ts | 2 +- packages/core/src/types.ts | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/client-twitter/src/base.ts b/packages/client-twitter/src/base.ts index 72a2a5efc2..4c7e98cb49 100644 --- a/packages/client-twitter/src/base.ts +++ b/packages/client-twitter/src/base.ts @@ -140,7 +140,7 @@ export class ClientBase extends EventEmitter { super(); this.runtime = runtime; this.config = config; - const username = this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); + const username = this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); if (ClientBase._twitterClients[username]) { this.twitterClient = ClientBase._twitterClients[username]; } else { @@ -157,11 +157,11 @@ export class ClientBase extends EventEmitter { async init() { //test - const username = this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); - const password = this.config.TWITTER_PASSWORD || this.runtime.getSetting("TWITTER_PASSWORD"); - const email = this.config.TWITTER_EMAIL || this.runtime.getSetting("TWITTER_EMAIL"); - const twitter2faSecret = this.config.TWITTER_2FA_SECRET || this.runtime.getSetting("TWITTER_2FA_SECRET") || undefined; - const cookies = this.config.TWITTER_COOKIES || this.runtime.getSetting("TWITTER_COOKIES"); + const username = this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); + const password = this.config?.TWITTER_PASSWORD || this.runtime.getSetting("TWITTER_PASSWORD"); + const email = this.config?.TWITTER_EMAIL || this.runtime.getSetting("TWITTER_EMAIL"); + const twitter2faSecret = this.config?.TWITTER_2FA_SECRET || this.runtime.getSetting("TWITTER_2FA_SECRET") || undefined; + const cookies = this.config?.TWITTER_COOKIES || this.runtime.getSetting("TWITTER_COOKIES"); if (!username) { @@ -475,7 +475,7 @@ export class ClientBase extends EventEmitter { } const timeline = await this.fetchHomeTimeline(cachedTimeline ? 10 : 50); - const username = this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); + const username = this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); // Get the most recent 20 mentions and interactions const mentionsAndInteractions = await this.fetchSearchTweets( diff --git a/packages/client-twitter/src/environment.ts b/packages/client-twitter/src/environment.ts index 7dd952272b..6c85b33861 100644 --- a/packages/client-twitter/src/environment.ts +++ b/packages/client-twitter/src/environment.ts @@ -26,28 +26,28 @@ export async function validateTwitterConfig( try { const twitterConfig = { TWITTER_DRY_RUN: - config.TWITTER_DRY_RUN || + config?.TWITTER_DRY_RUN || runtime.getSetting("TWITTER_DRY_RUN") || process.env.TWITTER_DRY_RUN || "false", TWITTER_USERNAME: - config.TWITTER_USERNAME || + config?.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME") || process.env.TWITTER_USERNAME, TWITTER_PASSWORD: - config.TWITTER_PASSWORD || + config?.TWITTER_PASSWORD || runtime.getSetting("TWITTER_PASSWORD") || process.env.TWITTER_PASSWORD, TWITTER_EMAIL: - config.TWITTER_EMAIL || + config?.TWITTER_EMAIL || runtime.getSetting("TWITTER_EMAIL") || process.env.TWITTER_EMAIL, TWITTER_COOKIES: - config.TWITTER_COOKIES || + config?.TWITTER_COOKIES || runtime.getSetting("TWITTER_COOKIES") || process.env.TWITTER_COOKIES, MAX_TWEET_LENGTH: - config.MAX_TWEET_LENGTH || + config?.MAX_TWEET_LENGTH || runtime.getSetting("MAX_TWEET_LENGTH") || process.env.MAX_TWEET_LENGTH || DEFAULT_MAX_TWEET_LENGTH.toString(), diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index f66ff7995f..26208adb85 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -103,7 +103,7 @@ export class TwitterInteractionClient { setTimeout( handleTwitterInteractionsLoop, Number( - this.config.TWITTER_POLL_INTERVAL || this.runtime.getSetting("TWITTER_POLL_INTERVAL") || 120 + this.config?.TWITTER_POLL_INTERVAL || this.runtime.getSetting("TWITTER_POLL_INTERVAL") || 120 ) * 1000 // Default to 2 minutes ); }; @@ -113,7 +113,7 @@ export class TwitterInteractionClient { async handleTwitterInteractions() { elizaLogger.log("Checking Twitter interactions"); // Read from environment variable, fallback to default list if not set - const targetUsersStr = this.config.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); + const targetUsersStr = this.config?.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); const twitterUsername = this.client.profile.username; try { @@ -321,7 +321,7 @@ export class TwitterInteractionClient { let state = await this.runtime.composeState(message, { twitterClient: this.client.twitterClient, - twitterUserName: this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), currentPost, formattedConversation, }); @@ -358,7 +358,7 @@ export class TwitterInteractionClient { } // 1. Get the raw target users string from settings - const targetUsersStr = this.config.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); + const targetUsersStr = this.config?.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); // 2. Process the string to get valid usernames const validTargetUsersStr = targetUsersStr && targetUsersStr.trim() @@ -420,7 +420,7 @@ export class TwitterInteractionClient { this.client, response, message.roomId, - this.config.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), + this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), tweet.id ); return memories; diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index 7c4b4161e9..b9dfd50826 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -193,7 +193,7 @@ export class TwitterPostClient { this.client = client; this.runtime = runtime; this.config = config; - this.twitterUsername = config.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); + this.twitterUsername = config?.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); } private async generateNewTweet() { @@ -279,7 +279,7 @@ export class TwitterPostClient { // Final cleaning cleanedContent = removeQuotes(content); - if ((this.config.TWITTER_DRY_RUN || this.runtime.getSetting("TWITTER_DRY_RUN")) === "true") { + if ((this.config?.TWITTER_DRY_RUN || this.runtime.getSetting("TWITTER_DRY_RUN")) === "true") { elizaLogger.info( `Dry run: would have posted tweet: ${cleanedContent}` ); diff --git a/packages/client-twitter/src/search.ts b/packages/client-twitter/src/search.ts index 1f50432536..4d79a5ed17 100644 --- a/packages/client-twitter/src/search.ts +++ b/packages/client-twitter/src/search.ts @@ -53,7 +53,7 @@ export class TwitterSearchClient { this.client = client; this.runtime = runtime; this.config = config; - this.twitterUsername = config.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); + this.twitterUsername = config?.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); } async start() { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 81334f330b..0608d81510 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -617,7 +617,7 @@ export interface IAgentConfig { export type Clients = { type: ClientType; - config: IAgentConfig; + config?: IAgentConfig; }; /** From 593da0226a0d6687ee6d54fa3c693b6a21e28ca7 Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Sat, 14 Dec 2024 00:54:19 +0530 Subject: [PATCH 07/10] Remove config --- agent/src/index.ts | 12 +++++------- docs/docs/packages/agent.md | 13 ++++++------- docs/docs/packages/agents.md | 10 +++++----- docs/docs/packages/clients.md | 3 +-- packages/client-twitter/src/base.ts | 19 ++++++++----------- packages/client-twitter/src/environment.ts | 11 ++--------- packages/client-twitter/src/index.ts | 18 +++++++++--------- packages/client-twitter/src/interactions.ts | 15 ++++++--------- packages/client-twitter/src/post.ts | 9 +++------ packages/client-twitter/src/search.ts | 8 +++----- packages/core/src/environment.ts | 9 ++------- packages/core/src/tests/environment.test.ts | 4 ++-- packages/core/src/types.ts | 15 ++++----------- 13 files changed, 56 insertions(+), 90 deletions(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index 22e165e95d..eba7dcf49c 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -10,7 +10,6 @@ import { AgentRuntime, CacheManager, Character, - ClientType, Clients, DbCacheAdapter, FsCacheAdapter, @@ -336,29 +335,28 @@ export async function initializeClients( character.clients?.map((str) => str.toLowerCase()) || []; elizaLogger.log('initializeClients', clientTypes, 'for', character.name) - if (clientTypes.includes(ClientType.DIRECT)) { + if (clientTypes.includes(Clients.DIRECT)) { const autoClient = await AutoClientInterface.start(runtime); if (autoClient) clients.auto = autoClient; } - if (clientTypes.includes("discord")) { + if (clientTypes.includes(Clients.DISCORD)) { const discordClient = await DiscordClientInterface.start(runtime); if (discordClient) clients.discord = discordClient; } - if (clientTypes.includes(ClientType.TELEGRAM)) { + if (clientTypes.includes(Clients.TELEGRAM)) { const telegramClient = await TelegramClientInterface.start(runtime); if (telegramClient) clients.telegram = telegramClient; } - if (clientTypes.includes(ClientType.TWITTER)) { - const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; + if (clientTypes.includes(Clients.TWITTER)) { TwitterClientInterface.enableSearch = !isFalsish(getSecret(character, "TWITTER_SEARCH_ENABLE")); const twitterClient = await TwitterClientInterface.start(runtime); if (twitterClient) clients.twitter = twitterClient; } - if (clientTypes.includes("farcaster")) { + if (clientTypes.includes(Clients.FARCASTER)) { // why is this one different :( const farcasterClient = new FarcasterAgentClient(runtime); if (farcasterClient) { diff --git a/docs/docs/packages/agent.md b/docs/docs/packages/agent.md index faa640178a..28d7f4c7cd 100644 --- a/docs/docs/packages/agent.md +++ b/docs/docs/packages/agent.md @@ -136,19 +136,18 @@ export async function initializeClients( runtime: IAgentRuntime, ) { const clients = []; - const clientTypes = character.clients?.map((str) => str.type.toLowerCase()) || []; + const clientTypes = character.clients?.map((str) => str.toLowerCase()) || []; - if (clientTypes.includes(ClientType.DISCORD)) { + if (clientTypes.includes(Clients.DISCORD)) { clients.push(await DiscordClientInterface.start(runtime)); } - if (clientTypes.includes(ClientType.TELEGRAM)) { + if (clientTypes.includes(Clients.TELEGRAM)) { clients.push(await TelegramClientInterface.start(runtime)); } - if (clientTypes.includes(ClientType.TWITTER)) { - const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; - clients.push(await TwitterClientInterface.start(runtime, config)); + if (clientTypes.includes(Clients.TWITTER)) { + clients.push(await TwitterClientInterface.start(runtime)); } - if (clientTypes.includes(ClientType.DIRECT)) { + if (clientTypes.includes(Clients.DIRECT)) { clients.push(await AutoClientInterface.start(runtime)); } diff --git a/docs/docs/packages/agents.md b/docs/docs/packages/agents.md index 9e6a01c493..d5b47ecca1 100644 --- a/docs/docs/packages/agents.md +++ b/docs/docs/packages/agents.md @@ -99,19 +99,19 @@ export async function initializeClients( runtime: IAgentRuntime, ) { const clients = []; - const clientTypes = character.clients?.map((str) => str.type.toLowerCase()) || []; + const clientTypes = character.clients?.map((str) => str.toLowerCase()) || []; - if (clientTypes.includes(ClientType.DISCORD)) { + if (clientTypes.includes(Clients.DISCORD)) { clients.push(await DiscordClientInterface.start(runtime)); } - if (clientTypes.includes(ClientType.TELEGRAM)) { + if (clientTypes.includes(Clients.TELEGRAM)) { clients.push(await TelegramClientInterface.start(runtime)); } - if (clientTypes.includes(ClientType.TWITTER)) { + if (clientTypes.includes(Clients.TWITTER)) { const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; clients.push(await TwitterClientInterface.start(runtime, config)); } - if (clientTypes.includes(ClientType.DIRECT)) { + if (clientTypes.includes(Clients.DIRECT)) { clients.push(await AutoClientInterface.start(runtime)); } diff --git a/docs/docs/packages/clients.md b/docs/docs/packages/clients.md index de9b9f8908..d586112a9b 100644 --- a/docs/docs/packages/clients.md +++ b/docs/docs/packages/clients.md @@ -134,9 +134,8 @@ The Twitter client enables posting, searching, and interacting with Twitter user ```typescript import { TwitterClientInterface } from "@eliza/client-twitter"; -const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; // Initialize client -const client = await TwitterClientInterface.start(runtime, config); +const client = await TwitterClientInterface.start(runtime); // Configuration in .env TWITTER_USERNAME = your_username; diff --git a/packages/client-twitter/src/base.ts b/packages/client-twitter/src/base.ts index 4c7e98cb49..577eef80de 100644 --- a/packages/client-twitter/src/base.ts +++ b/packages/client-twitter/src/base.ts @@ -8,7 +8,6 @@ import { getEmbeddingZeroVector, elizaLogger, stringToUuid, - IAgentConfig, } from "@ai16z/eliza"; import { QueryTweetsResponse, @@ -86,7 +85,6 @@ export class ClientBase extends EventEmitter { static _twitterClients: { [accountIdentifier: string]: Scraper } = {}; twitterClient: Scraper; runtime: IAgentRuntime; - config: IAgentConfig; directions: string; lastCheckedTweetId: bigint | null = null; imageDescriptionService: IImageDescriptionService; @@ -136,11 +134,10 @@ export class ClientBase extends EventEmitter { ); } - constructor(runtime: IAgentRuntime, config: IAgentConfig) { + constructor(runtime: IAgentRuntime) { super(); this.runtime = runtime; - this.config = config; - const username = this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); + const username = this.runtime.getSetting("TWITTER_USERNAME"); if (ClientBase._twitterClients[username]) { this.twitterClient = ClientBase._twitterClients[username]; } else { @@ -157,11 +154,11 @@ export class ClientBase extends EventEmitter { async init() { //test - const username = this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); - const password = this.config?.TWITTER_PASSWORD || this.runtime.getSetting("TWITTER_PASSWORD"); - const email = this.config?.TWITTER_EMAIL || this.runtime.getSetting("TWITTER_EMAIL"); - const twitter2faSecret = this.config?.TWITTER_2FA_SECRET || this.runtime.getSetting("TWITTER_2FA_SECRET") || undefined; - const cookies = this.config?.TWITTER_COOKIES || this.runtime.getSetting("TWITTER_COOKIES"); + const username = this.runtime.getSetting("TWITTER_USERNAME"); + const password = this.runtime.getSetting("TWITTER_PASSWORD"); + const email = this.runtime.getSetting("TWITTER_EMAIL"); + const twitter2faSecret = this.runtime.getSetting("TWITTER_2FA_SECRET") || undefined; + const cookies = this.runtime.getSetting("TWITTER_COOKIES"); if (!username) { @@ -475,7 +472,7 @@ export class ClientBase extends EventEmitter { } const timeline = await this.fetchHomeTimeline(cachedTimeline ? 10 : 50); - const username = this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"); + const username = this.runtime.getSetting("TWITTER_USERNAME"); // Get the most recent 20 mentions and interactions const mentionsAndInteractions = await this.fetchSearchTweets( diff --git a/packages/client-twitter/src/environment.ts b/packages/client-twitter/src/environment.ts index 6c85b33861..3340fc9674 100644 --- a/packages/client-twitter/src/environment.ts +++ b/packages/client-twitter/src/environment.ts @@ -1,4 +1,4 @@ -import { IAgentConfig, IAgentRuntime } from "@ai16z/eliza"; +import { IAgentRuntime } from "@ai16z/eliza"; import { z } from "zod"; export const DEFAULT_MAX_TWEET_LENGTH = 280; @@ -20,34 +20,27 @@ export const twitterEnvSchema = z.object({ export type TwitterConfig = z.infer; export async function validateTwitterConfig( - runtime: IAgentRuntime, - config: IAgentConfig + runtime: IAgentRuntime ): Promise { try { const twitterConfig = { TWITTER_DRY_RUN: - config?.TWITTER_DRY_RUN || runtime.getSetting("TWITTER_DRY_RUN") || process.env.TWITTER_DRY_RUN || "false", TWITTER_USERNAME: - config?.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME") || process.env.TWITTER_USERNAME, TWITTER_PASSWORD: - config?.TWITTER_PASSWORD || runtime.getSetting("TWITTER_PASSWORD") || process.env.TWITTER_PASSWORD, TWITTER_EMAIL: - config?.TWITTER_EMAIL || runtime.getSetting("TWITTER_EMAIL") || process.env.TWITTER_EMAIL, TWITTER_COOKIES: - config?.TWITTER_COOKIES || runtime.getSetting("TWITTER_COOKIES") || process.env.TWITTER_COOKIES, MAX_TWEET_LENGTH: - config?.MAX_TWEET_LENGTH || runtime.getSetting("MAX_TWEET_LENGTH") || process.env.MAX_TWEET_LENGTH || DEFAULT_MAX_TWEET_LENGTH.toString(), diff --git a/packages/client-twitter/src/index.ts b/packages/client-twitter/src/index.ts index 732e12181b..b973b84eae 100644 --- a/packages/client-twitter/src/index.ts +++ b/packages/client-twitter/src/index.ts @@ -1,7 +1,7 @@ import { TwitterPostClient } from "./post.ts"; import { TwitterSearchClient } from "./search.ts"; import { TwitterInteractionClient } from "./interactions.ts"; -import { IAgentRuntime, Client, elizaLogger, IAgentConfig } from "@ai16z/eliza"; +import { IAgentRuntime, Client, elizaLogger } from "@ai16z/eliza"; import { validateTwitterConfig } from "./environment.ts"; import { ClientBase } from "./base.ts"; @@ -10,9 +10,9 @@ class TwitterManager { post: TwitterPostClient; search: TwitterSearchClient; interaction: TwitterInteractionClient; - constructor(runtime: IAgentRuntime, config: IAgentConfig, enableSearch:boolean) { - this.client = new ClientBase(runtime, config); - this.post = new TwitterPostClient(this.client, runtime, config); + constructor(runtime: IAgentRuntime, enableSearch:boolean) { + this.client = new ClientBase(runtime); + this.post = new TwitterPostClient(this.client, runtime); if (enableSearch) { // this searches topics from character file @@ -21,23 +21,23 @@ class TwitterManager { elizaLogger.warn('2. burns your rate limit') elizaLogger.warn('3. can get your account banned') elizaLogger.warn('use at your own risk') - this.search = new TwitterSearchClient(this.client, runtime, config); // don't start the search client by default + this.search = new TwitterSearchClient(this.client, runtime); // don't start the search client by default } - this.interaction = new TwitterInteractionClient(this.client, runtime, config); + this.interaction = new TwitterInteractionClient(this.client, runtime); } } export const TwitterClientInterface: Client = { - async start(runtime: IAgentRuntime, config: IAgentConfig) { - await validateTwitterConfig(runtime, config); + async start(runtime: IAgentRuntime) { + await validateTwitterConfig(runtime); elizaLogger.log("Twitter client started"); // enableSearch is just set previous to this call // so enableSearch can change over time // and changing it won't stop the SearchClient in the existing instance - const manager = new TwitterManager(runtime, config ,this.enableSearch); + const manager = new TwitterManager(runtime, this.enableSearch); await manager.client.init(); diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index 26208adb85..6a12244aa1 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -14,7 +14,6 @@ import { stringToUuid, elizaLogger, getEmbeddingZeroVector, - IAgentConfig, } from "@ai16z/eliza"; import { ClientBase } from "./base"; import { buildConversationThread, sendTweet, wait } from "./utils.ts"; @@ -90,11 +89,9 @@ Thread of Tweets You Are Replying To: export class TwitterInteractionClient { client: ClientBase; runtime: IAgentRuntime; - config: IAgentConfig; - constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { + constructor(client: ClientBase, runtime: IAgentRuntime) { this.client = client; this.runtime = runtime; - this.config = config; } async start() { @@ -103,7 +100,7 @@ export class TwitterInteractionClient { setTimeout( handleTwitterInteractionsLoop, Number( - this.config?.TWITTER_POLL_INTERVAL || this.runtime.getSetting("TWITTER_POLL_INTERVAL") || 120 + this.runtime.getSetting("TWITTER_POLL_INTERVAL") || 120 ) * 1000 // Default to 2 minutes ); }; @@ -113,7 +110,7 @@ export class TwitterInteractionClient { async handleTwitterInteractions() { elizaLogger.log("Checking Twitter interactions"); // Read from environment variable, fallback to default list if not set - const targetUsersStr = this.config?.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); + const targetUsersStr = this.runtime.getSetting("TWITTER_TARGET_USERS"); const twitterUsername = this.client.profile.username; try { @@ -321,7 +318,7 @@ export class TwitterInteractionClient { let state = await this.runtime.composeState(message, { twitterClient: this.client.twitterClient, - twitterUserName: this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), + twitterUserName: this.runtime.getSetting("TWITTER_USERNAME"), currentPost, formattedConversation, }); @@ -358,7 +355,7 @@ export class TwitterInteractionClient { } // 1. Get the raw target users string from settings - const targetUsersStr = this.config?.TWITTER_TARGET_USERS || this.runtime.getSetting("TWITTER_TARGET_USERS"); + const targetUsersStr = this.runtime.getSetting("TWITTER_TARGET_USERS"); // 2. Process the string to get valid usernames const validTargetUsersStr = targetUsersStr && targetUsersStr.trim() @@ -420,7 +417,7 @@ export class TwitterInteractionClient { this.client, response, message.roomId, - this.config?.TWITTER_USERNAME || this.runtime.getSetting("TWITTER_USERNAME"), + this.runtime.getSetting("TWITTER_USERNAME"), tweet.id ); return memories; diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index aaf6b673d0..cf24f90698 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -7,7 +7,6 @@ import { ModelClass, stringToUuid, parseBooleanFromText, - IAgentConfig, } from "@ai16z/eliza"; import { elizaLogger } from "@ai16z/eliza"; import { ClientBase } from "./base.ts"; @@ -97,7 +96,6 @@ function truncateToCompleteSentence( export class TwitterPostClient { client: ClientBase; runtime: IAgentRuntime; - config: IAgentConfig; twitterUsername: string; private isProcessing: boolean = false; private lastProcessTime: number = 0; @@ -190,11 +188,10 @@ export class TwitterPostClient { generateNewTweetLoop(); } - constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { + constructor(client: ClientBase, runtime: IAgentRuntime) { this.client = client; this.runtime = runtime; - this.config = config; - this.twitterUsername = config?.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); + this.twitterUsername = runtime.getSetting("TWITTER_USERNAME"); } private async generateNewTweet() { @@ -281,7 +278,7 @@ export class TwitterPostClient { // Final cleaning cleanedContent = removeQuotes(content); - if ((this.config?.TWITTER_DRY_RUN || this.runtime.getSetting("TWITTER_DRY_RUN")) === "true") { + if ((this.runtime.getSetting("TWITTER_DRY_RUN")) === "true") { elizaLogger.info( `Dry run: would have posted tweet: ${cleanedContent}` ); diff --git a/packages/client-twitter/src/search.ts b/packages/client-twitter/src/search.ts index 4d79a5ed17..27190c7531 100644 --- a/packages/client-twitter/src/search.ts +++ b/packages/client-twitter/src/search.ts @@ -1,5 +1,5 @@ import { SearchMode } from "agent-twitter-client"; -import { composeContext, IAgentConfig } from "@ai16z/eliza"; +import { composeContext } from "@ai16z/eliza"; import { generateMessageResponse, generateText } from "@ai16z/eliza"; import { messageCompletionFooter } from "@ai16z/eliza"; import { @@ -45,15 +45,13 @@ Your response should not contain any questions. Brief, concise statements only. export class TwitterSearchClient { client: ClientBase; runtime: IAgentRuntime; - config: IAgentConfig; twitterUsername: string; private respondedTweets: Set = new Set(); - constructor(client: ClientBase, runtime: IAgentRuntime, config: IAgentConfig) { + constructor(client: ClientBase, runtime: IAgentRuntime) { this.client = client; this.runtime = runtime; - this.config = config; - this.twitterUsername = config?.TWITTER_USERNAME || runtime.getSetting("TWITTER_USERNAME"); + this.twitterUsername = runtime.getSetting("TWITTER_USERNAME"); } async start() { diff --git a/packages/core/src/environment.ts b/packages/core/src/environment.ts index 5d00ce0de2..8e5f338936 100644 --- a/packages/core/src/environment.ts +++ b/packages/core/src/environment.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { ModelProviderName, ClientType } from "./types"; +import { ModelProviderName, Clients } from "./types"; // TODO: TO COMPLETE export const envSchema = z.object({ @@ -62,11 +62,6 @@ const PluginSchema = z.object({ clients: z.array(z.any()).optional(), }); -const clientSchema = z.object({ - type: z.nativeEnum(ClientType), - config: z.record(z.string()), -}); - // Main Character schema export const CharacterSchema = z.object({ id: z.string().uuid().optional(), @@ -82,7 +77,7 @@ export const CharacterSchema = z.object({ topics: z.array(z.string()), adjectives: z.array(z.string()), knowledge: z.array(z.string()).optional(), - clients: z.array(z.array(clientSchema)), + clients: z.array(z.nativeEnum(Clients)), plugins: z.union([ z.array(z.string()), z.array(PluginSchema), diff --git a/packages/core/src/tests/environment.test.ts b/packages/core/src/tests/environment.test.ts index d058432d07..f38b683919 100644 --- a/packages/core/src/tests/environment.test.ts +++ b/packages/core/src/tests/environment.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import { validateEnv, validateCharacterConfig } from '../environment'; -import { ClientType, ModelProviderName } from '../types'; +import { Clients, ModelProviderName } from '../types'; describe('Environment Configuration', () => { const originalEnv = process.env; @@ -71,7 +71,7 @@ describe('Character Configuration', () => { postExamples: ['Test post'], topics: ['topic1'], adjectives: ['friendly'], - clients: [{type: ClientType.TWITTER, config: {}}], + clients: [Clients.DISCORD], plugins: ['test-plugin'], style: { all: ['style1'], diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 920cb8ede8..812e882107 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -568,7 +568,7 @@ export type Media = { */ export type Client = { /** Start client connection */ - start: (runtime: IAgentRuntime, config?: IAgentConfig) => Promise; + start: (runtime: IAgentRuntime) => Promise; /** Stop client connection */ stop: (runtime: IAgentRuntime) => Promise; @@ -603,25 +603,18 @@ export type Plugin = { /** * Available client platforms */ -export enum ClientType { +export enum Clients { DISCORD = "discord", -// you can't specify this in characters -// all characters are registered with this -// DIRECT = "direct", + DIRECT = "direct", TWITTER = "twitter", TELEGRAM = "telegram", - FARCASTER = "farcaster" + FARCASTER = "farcaster", } export interface IAgentConfig { [key: string]: string; } -export type Clients = { - type: ClientType; - config?: IAgentConfig; -}; - /** * Configuration for an agent character */ From f224fbfc4b062286a525049fc14acb5a703b2bb8 Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Sat, 14 Dec 2024 01:02:25 +0530 Subject: [PATCH 08/10] Remove unuse config related code --- docs/docs/packages/agents.md | 3 +-- packages/client-twitter/src/interactions.ts | 3 +-- packages/client-twitter/src/post.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/docs/packages/agents.md b/docs/docs/packages/agents.md index d5b47ecca1..4984edb143 100644 --- a/docs/docs/packages/agents.md +++ b/docs/docs/packages/agents.md @@ -108,8 +108,7 @@ export async function initializeClients( clients.push(await TelegramClientInterface.start(runtime)); } if (clientTypes.includes(Clients.TWITTER)) { - const config = character.clients?.find((client) => client.type === ClientType.TWITTER)?.config; - clients.push(await TwitterClientInterface.start(runtime, config)); + clients.push(await TwitterClientInterface.start(runtime)); } if (clientTypes.includes(Clients.DIRECT)) { clients.push(await AutoClientInterface.start(runtime)); diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index 6a12244aa1..a832434931 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -148,8 +148,7 @@ export class TwitterInteractionClient { // Filter for unprocessed, non-reply, recent tweets const validTweets = userTweets.filter(tweet => { - const isUnprocessed = !this.client.lastCheckedTweetId || - parseInt(tweet.id) > this.client.lastCheckedTweetId; + const isUnprocessed = !this.client.lastCheckedTweetId || parseInt(tweet.id) > this.client.lastCheckedTweetId; const isRecent = (Date.now() - (tweet.timestamp * 1000)) < 2 * 60 * 60 * 1000; elizaLogger.log(`Tweet ${tweet.id} checks:`, { diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index cf24f90698..bccac5ac69 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -278,7 +278,7 @@ export class TwitterPostClient { // Final cleaning cleanedContent = removeQuotes(content); - if ((this.runtime.getSetting("TWITTER_DRY_RUN")) === "true") { + if (this.runtime.getSetting("TWITTER_DRY_RUN") === "true") { elizaLogger.info( `Dry run: would have posted tweet: ${cleanedContent}` ); From 7242eaefa57ce9d93d05ad0bb2d9f15b366a6942 Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Sat, 14 Dec 2024 01:09:54 +0530 Subject: [PATCH 09/10] Update lockfile to match package.json --- pnpm-lock.yaml | 212 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 154 insertions(+), 58 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1332136fa1..7e3affaec7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,10 @@ importers: version: 0.2.1(bufferutil@4.0.8)(ethers@6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) '@coinbase/coinbase-sdk': specifier: 0.10.0 - version: 0.10.0(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 0.10.0(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) + '@deepgram/sdk': + specifier: ^3.9.0 + version: 3.9.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) '@vitest/eslint-plugin': specifier: 1.0.1 version: 1.0.1(@typescript-eslint/utils@8.16.0(eslint@9.16.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.16.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0)) @@ -28,7 +31,7 @@ importers: version: 5.6.0 ollama-ai-provider: specifier: 0.16.1 - version: 0.16.1(zod@3.23.8) + version: 0.16.1(zod@3.24.1) optional: specifier: 0.1.4 version: 0.1.4 @@ -510,6 +513,9 @@ importers: libsodium-wrappers: specifier: 0.7.15 version: 0.7.15 + lodash: + specifier: ^4.17.21 + version: 4.17.21 prism-media: specifier: 1.3.5 version: 1.3.5(@discordjs/opus@https://codeload.github.com/discordjs/opus/tar.gz/31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02(encoding@0.1.13))(ffmpeg-static@5.2.0) @@ -531,7 +537,10 @@ importers: version: link:../core '@neynar/nodejs-sdk': specifier: ^2.0.3 - version: 2.2.3(bufferutil@4.0.8)(class-transformer@0.5.1)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 2.2.3(bufferutil@4.0.8)(class-transformer@0.5.1)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) + viem: + specifier: 2.21.53 + version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) devDependencies: tsup: specifier: ^8.3.5 @@ -554,6 +563,9 @@ importers: simple-git: specifier: 3.27.0 version: 3.27.0 + zod: + specifier: ^3.24.1 + version: 3.24.1 devDependencies: '@types/glob': specifier: 8.1.0 @@ -899,6 +911,9 @@ importers: node-fetch: specifier: ^2.6.1 version: 2.7.0(encoding@0.1.13) + zod: + specifier: 3.23.8 + version: 3.23.8 devDependencies: '@types/node': specifier: ^20.0.0 @@ -915,6 +930,12 @@ importers: cive: specifier: 0.7.1 version: 0.7.1(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10) + viem: + specifier: 2.21.53 + version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) + zod: + specifier: ^3.24.1 + version: 3.24.1 packages/plugin-echochambers: dependencies: @@ -938,7 +959,7 @@ importers: version: 5.15.5 '@lifi/sdk': specifier: 3.4.1 - version: 3.4.1(@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.6.3)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)) + version: 3.4.1(@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.6.3)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@lifi/types': specifier: 16.3.0 version: 16.3.0 @@ -947,7 +968,7 @@ importers: version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) viem: specifier: 2.21.53 - version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) whatwg-url: specifier: 7.1.0 version: 7.1.0 @@ -1017,16 +1038,16 @@ importers: version: 0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) '@goat-sdk/plugin-erc20': specifier: 0.1.7 - version: 0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)) + version: 0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@goat-sdk/wallet-viem': specifier: 0.1.3 - version: 0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)) + version: 0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) viem: specifier: 2.21.53 - version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) whatwg-url: specifier: 7.1.0 version: 7.1.0 @@ -1091,6 +1112,9 @@ importers: whatwg-url: specifier: 7.1.0 version: 7.1.0 + zod: + specifier: ^3.24.1 + version: 3.24.1 packages/plugin-node: dependencies: @@ -1106,6 +1130,9 @@ importers: '@cliqz/adblocker-playwright': specifier: 1.34.0 version: 1.34.0(playwright@1.48.2) + '@deepgram/sdk': + specifier: ^3.9.0 + version: 3.9.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) '@echogarden/espeak-ng-emscripten': specifier: 0.3.3 version: 0.3.3 @@ -1147,7 +1174,7 @@ importers: version: 1.6.0 echogarden: specifier: 2.0.7 - version: 2.0.7(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(encoding@0.1.13)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 2.0.7(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(encoding@0.1.13)(utf-8-validate@5.0.10)(zod@3.24.1) espeak-ng: specifier: 1.0.2 version: 1.0.2 @@ -1311,6 +1338,9 @@ importers: tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) + uuid: + specifier: 11.0.3 + version: 11.0.3 vitest: specifier: 2.1.4 version: 2.1.4(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.37.0) @@ -1355,7 +1385,7 @@ importers: version: link:../core '@phala/dstack-sdk': specifier: 0.1.6 - version: 0.1.6(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 0.1.6(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) '@solana/spl-token': specifier: 0.4.9 version: 0.4.9(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(encoding@0.1.13)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -1382,7 +1412,7 @@ importers: version: 8.3.5(@swc/core@1.10.1(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) viem: specifier: 2.21.53 - version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + version: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) whatwg-url: specifier: 7.1.0 version: 7.1.0 @@ -3026,6 +3056,14 @@ packages: peerDependencies: postcss: ^8.4 + '@deepgram/captions@1.2.0': + resolution: {integrity: sha512-8B1C/oTxTxyHlSFubAhNRgCbQ2SQ5wwvtlByn8sDYZvdDtdn/VE2yEPZ4BvUnrKWmsbTQY6/ooLV+9Ka2qmDSQ==} + engines: {node: '>=18.0.0'} + + '@deepgram/sdk@3.9.0': + resolution: {integrity: sha512-X/7JzoYjCObyEaPb2Dgnkwk2LwRe4bw0FJJCLdkjpnFfJCFgA9IWgRD8FEUI6/hp8dW/CqqXkGPA2Q3DIsVG8A==} + engines: {node: '>=18.0.0'} + '@derhuerst/http-basic@8.2.4': resolution: {integrity: sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==} engines: {node: '>=6.0.0'} @@ -3088,6 +3126,7 @@ packages: resolution: {integrity: sha512-hArn9FF5ZYi1IkxdJEVnJi+OxlwLV0NJYWpKXsmNOojtGtAZHxmsELA+MZlu2KW1F/K1/nt7lFOfcMXNYweq9w==} version: 0.17.0 engines: {node: '>=16.11.0'} + deprecated: This version uses deprecated encryption modes. Please use a newer version. '@discordjs/ws@1.1.1': resolution: {integrity: sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==} @@ -16876,6 +16915,9 @@ packages: zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + zod@3.24.1: + resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} + zwitch@1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} @@ -16962,6 +17004,15 @@ snapshots: optionalDependencies: zod: 3.23.8 + '@ai-sdk/provider-utils@1.0.22(zod@3.24.1)': + dependencies: + '@ai-sdk/provider': 0.0.26 + eventsource-parser: 1.1.2 + nanoid: 3.3.8 + secure-json-parse: 2.7.0 + optionalDependencies: + zod: 3.24.1 + '@ai-sdk/provider-utils@2.0.2(zod@3.23.8)': dependencies: '@ai-sdk/provider': 1.0.1 @@ -18784,13 +18835,13 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@bigmi/core@0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.6.3))(bs58@6.0.0)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))': + '@bigmi/core@0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.6.3))(bs58@6.0.0)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@noble/hashes': 1.6.1 bech32: 2.0.0 bitcoinjs-lib: 7.0.0-rc.0(typescript@5.6.3) bs58: 6.0.0 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) '@braintree/sanitize-url@7.1.0': {} @@ -18844,10 +18895,10 @@ snapshots: transitivePeerDependencies: - encoding - '@coinbase/coinbase-sdk@0.10.0(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)': + '@coinbase/coinbase-sdk@0.10.0(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)': dependencies: '@scure/bip32': 1.6.0 - abitype: 1.0.7(typescript@5.6.3)(zod@3.23.8) + abitype: 1.0.7(typescript@5.6.3)(zod@3.24.1) axios: 1.7.8(debug@4.4.0) axios-mock-adapter: 1.22.0(axios@1.7.8) axios-retry: 4.5.0(axios@1.7.8) @@ -18858,7 +18909,7 @@ snapshots: ethers: 6.13.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) node-jose: 2.2.0 secp256k1: 5.0.1 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) transitivePeerDependencies: - bufferutil - debug @@ -19268,6 +19319,23 @@ snapshots: dependencies: postcss: 8.4.49 + '@deepgram/captions@1.2.0': + dependencies: + dayjs: 1.11.13 + + '@deepgram/sdk@3.9.0(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)': + dependencies: + '@deepgram/captions': 1.2.0 + '@types/node': 18.19.68 + cross-fetch: 3.1.8(encoding@0.1.13) + deepmerge: 4.3.1 + events: 3.3.0 + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@derhuerst/http-basic@8.2.4': dependencies: caseless: 0.12.0 @@ -20694,25 +20762,25 @@ snapshots: '@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)': dependencies: '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10) - abitype: 1.0.7(typescript@5.6.3)(zod@3.23.8) - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - zod: 3.23.8 + abitype: 1.0.7(typescript@5.6.3)(zod@3.24.1) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) + zod: 3.24.1 transitivePeerDependencies: - bufferutil - encoding - typescript - utf-8-validate - '@goat-sdk/plugin-erc20@0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))': + '@goat-sdk/plugin-erc20@0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@goat-sdk/core': 0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - zod: 3.23.8 + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) + zod: 3.24.1 - '@goat-sdk/wallet-viem@0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))': + '@goat-sdk/wallet-viem@0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10))(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@goat-sdk/core': 0.3.8(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10) - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) '@google-cloud/vertexai@1.9.2(encoding@0.1.13)': dependencies: @@ -21131,8 +21199,8 @@ snapshots: p-queue: 6.6.2 p-retry: 4.6.2 uuid: 10.0.0 - zod: 3.23.8 - zod-to-json-schema: 3.24.1(zod@3.23.8) + zod: 3.24.1 + zod-to-json-schema: 3.24.1(zod@3.24.1) transitivePeerDependencies: - openai @@ -21140,9 +21208,9 @@ snapshots: dependencies: '@langchain/core': 0.3.23(openai@4.73.0(encoding@0.1.13)(zod@3.23.8)) js-tiktoken: 1.0.15 - openai: 4.73.0(encoding@0.1.13)(zod@3.23.8) - zod: 3.23.8 - zod-to-json-schema: 3.24.1(zod@3.23.8) + openai: 4.73.0(encoding@0.1.13)(zod@3.24.1) + zod: 3.24.1 + zod-to-json-schema: 3.24.1(zod@3.24.1) transitivePeerDependencies: - encoding @@ -21238,9 +21306,9 @@ snapshots: dependencies: '@lifi/types': 16.3.0 - '@lifi/sdk@3.4.1(@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.6.3)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8))': + '@lifi/sdk@3.4.1(@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.6.3)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: - '@bigmi/core': 0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.6.3))(bs58@6.0.0)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)) + '@bigmi/core': 0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.6.3))(bs58@6.0.0)(viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@lifi/types': 16.3.0 '@noble/curves': 1.7.0 '@noble/hashes': 1.6.1 @@ -21249,7 +21317,7 @@ snapshots: bech32: 2.0.0 bitcoinjs-lib: 7.0.0-rc.0(typescript@5.6.3) bs58: 6.0.0 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) transitivePeerDependencies: - typescript @@ -21404,11 +21472,11 @@ snapshots: transitivePeerDependencies: - encoding - '@neynar/nodejs-sdk@2.2.3(bufferutil@4.0.8)(class-transformer@0.5.1)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)': + '@neynar/nodejs-sdk@2.2.3(bufferutil@4.0.8)(class-transformer@0.5.1)(encoding@0.1.13)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)': dependencies: '@openapitools/openapi-generator-cli': 2.15.3(class-transformer@0.5.1)(encoding@0.1.13) semver: 7.6.3 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) transitivePeerDependencies: - '@nestjs/microservices' - '@nestjs/platform-express' @@ -22330,9 +22398,9 @@ snapshots: tslib: 2.8.1 webcrypto-core: 1.8.1 - '@phala/dstack-sdk@0.1.6(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8)': + '@phala/dstack-sdk@0.1.6(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1)': optionalDependencies: - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) transitivePeerDependencies: - bufferutil - typescript @@ -25241,15 +25309,15 @@ snapshots: fs-extra: 10.1.0 yargs: 17.7.2 - abitype@1.0.6(typescript@5.6.3)(zod@3.23.8): + abitype@1.0.6(typescript@5.6.3)(zod@3.24.1): optionalDependencies: typescript: 5.6.3 - zod: 3.23.8 + zod: 3.24.1 - abitype@1.0.7(typescript@5.6.3)(zod@3.23.8): + abitype@1.0.7(typescript@5.6.3)(zod@3.24.1): optionalDependencies: typescript: 5.6.3 - zod: 3.23.8 + zod: 3.24.1 abort-controller@3.0.0: dependencies: @@ -26315,8 +26383,8 @@ snapshots: '@noble/hashes': 1.6.1 '@scure/bip32': 1.6.0 '@scure/bip39': 1.5.0 - viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8) - zod: 3.23.8 + viem: 2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1) + zod: 3.24.1 transitivePeerDependencies: - bufferutil - typescript @@ -27620,7 +27688,7 @@ snapshots: dependencies: safe-buffer: 5.2.1 - echogarden@2.0.7(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(encoding@0.1.13)(utf-8-validate@5.0.10)(zod@3.23.8): + echogarden@2.0.7(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(encoding@0.1.13)(utf-8-validate@5.0.10)(zod@3.24.1): dependencies: '@aws-sdk/client-polly': 3.709.0 '@aws-sdk/client-transcribe-streaming': 3.709.0 @@ -27654,7 +27722,7 @@ snapshots: microsoft-cognitiveservices-speech-sdk: 1.41.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) msgpack-lite: 0.1.26 onnxruntime-node: 1.20.1 - openai: 4.73.0(encoding@0.1.13)(zod@3.23.8) + openai: 4.73.0(encoding@0.1.13)(zod@3.24.1) sam-js: 0.3.1 strip-ansi: 7.1.0 tar: 7.4.3 @@ -30526,8 +30594,8 @@ snapshots: p-retry: 4.6.2 uuid: 10.0.0 yaml: 2.6.1 - zod: 3.23.8 - zod-to-json-schema: 3.24.1(zod@3.23.8) + zod: 3.24.1 + zod-to-json-schema: 3.24.1(zod@3.24.1) optionalDependencies: axios: 1.7.8(debug@4.4.0) handlebars: 4.7.8 @@ -32313,6 +32381,14 @@ snapshots: optionalDependencies: zod: 3.23.8 + ollama-ai-provider@0.16.1(zod@3.24.1): + dependencies: + '@ai-sdk/provider': 0.0.26 + '@ai-sdk/provider-utils': 1.0.22(zod@3.24.1) + partial-json: 0.1.7 + optionalDependencies: + zod: 3.24.1 + omggif@1.0.10: {} on-exit-leak-free@0.2.0: {} @@ -32399,6 +32475,20 @@ snapshots: transitivePeerDependencies: - encoding + openai@4.73.0(encoding@0.1.13)(zod@3.24.1): + dependencies: + '@types/node': 18.19.68 + '@types/node-fetch': 2.6.12 + abort-controller: 3.0.0 + agentkeepalive: 4.5.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0(encoding@0.1.13) + optionalDependencies: + zod: 3.24.1 + transitivePeerDependencies: + - encoding + openapi-types@12.1.3: {} opener@1.5.2: {} @@ -32455,14 +32545,14 @@ snapshots: dependencies: '@noble/hashes': 1.5.0 - ox@0.1.2(typescript@5.6.3)(zod@3.23.8): + ox@0.1.2(typescript@5.6.3)(zod@3.24.1): dependencies: '@adraffy/ens-normalize': 1.11.0 - '@noble/curves': 1.6.0 - '@noble/hashes': 1.5.0 - '@scure/bip32': 1.5.0 - '@scure/bip39': 1.4.0 - abitype: 1.0.6(typescript@5.6.3)(zod@3.23.8) + '@noble/curves': 1.7.0 + '@noble/hashes': 1.6.1 + '@scure/bip32': 1.6.0 + '@scure/bip39': 1.5.0 + abitype: 1.0.7(typescript@5.6.3)(zod@3.24.1) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.6.3 @@ -36376,15 +36466,15 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.23.8): + viem@2.21.53(bufferutil@4.0.8)(typescript@5.6.3)(utf-8-validate@5.0.10)(zod@3.24.1): dependencies: '@noble/curves': 1.6.0 '@noble/hashes': 1.5.0 '@scure/bip32': 1.5.0 '@scure/bip39': 1.4.0 - abitype: 1.0.6(typescript@5.6.3)(zod@3.23.8) + abitype: 1.0.6(typescript@5.6.3)(zod@3.24.1) isows: 1.0.6(ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - ox: 0.1.2(typescript@5.6.3)(zod@3.23.8) + ox: 0.1.2(typescript@5.6.3)(zod@3.24.1) webauthn-p256: 0.0.10 ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: @@ -36608,8 +36698,8 @@ snapshots: webauthn-p256@0.0.10: dependencies: - '@noble/curves': 1.6.0 - '@noble/hashes': 1.5.0 + '@noble/curves': 1.7.0 + '@noble/hashes': 1.6.1 webcrypto-core@1.8.1: dependencies: @@ -37035,8 +37125,14 @@ snapshots: dependencies: zod: 3.23.8 + zod-to-json-schema@3.24.1(zod@3.24.1): + dependencies: + zod: 3.24.1 + zod@3.23.8: {} + zod@3.24.1: {} + zwitch@1.0.5: {} zwitch@2.0.4: {} @@ -37044,4 +37140,4 @@ snapshots: zx@8.2.4: optionalDependencies: '@types/fs-extra': 11.0.4 - '@types/node': 20.17.9 \ No newline at end of file + '@types/node': 20.17.9 From 40df2db40e73f1a3236550d149e75f35d508d261 Mon Sep 17 00:00:00 2001 From: BalanaguYashwanth Date: Sat, 14 Dec 2024 01:26:06 +0530 Subject: [PATCH 10/10] ReUpdate lockfile to match package.json --- pnpm-lock.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e3affaec7..44083fa740 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -584,7 +584,7 @@ importers: version: 0.0.1 zod: specifier: ^3.22.4 - version: 3.23.8 + version: 3.24.1 devDependencies: '@types/node': specifier: ^20.0.0 @@ -32548,11 +32548,11 @@ snapshots: ox@0.1.2(typescript@5.6.3)(zod@3.24.1): dependencies: '@adraffy/ens-normalize': 1.11.0 - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 - '@scure/bip32': 1.6.0 - '@scure/bip39': 1.5.0 - abitype: 1.0.7(typescript@5.6.3)(zod@3.24.1) + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/bip32': 1.5.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.6(typescript@5.6.3)(zod@3.24.1) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.6.3 @@ -36698,8 +36698,8 @@ snapshots: webauthn-p256@0.0.10: dependencies: - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 webcrypto-core@1.8.1: dependencies: