diff --git a/.env.example b/.env.example index aab617e8cf3..f9278194d4d 100644 --- a/.env.example +++ b/.env.example @@ -248,6 +248,12 @@ AO_MARKET_ID= AO_USERNAME= AO_WALLET_ID= +# Story Protocol +STORY_WALLET= +STORY_USERNAME= +STORY_WALLET_ID= +STORY_MARKET_ID= + # Grok Configuration GROK_API_KEY= # GROK/xAI API Key SMALL_GROK_MODEL= # Default: grok-2-1212 diff --git a/agent/package.json b/agent/package.json index bd7cf3ad085..9d9ab471a05 100644 --- a/agent/package.json +++ b/agent/package.json @@ -26,7 +26,7 @@ "@elizaos/adapter-qdrant": "workspace:*", "@elizaos/adapter-mongodb": "workspace:*", "@elizaos/client-auto": "workspace:*", - "@elizaos/client-ao": "workspace:*", + "@elizaos/client-clara": "workspace:*", "@elizaos/client-direct": "workspace:*", "@elizaos/client-discord": "workspace:*", "@elizaos/client-farcaster": "workspace:*", diff --git a/agent/src/index.ts b/agent/src/index.ts index faef8b4903e..ebba0e8f923 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -157,7 +157,7 @@ import { ankrPlugin } from "@elizaos/plugin-ankr"; import { formPlugin } from "@elizaos/plugin-form"; import { MongoClient } from "mongodb"; import { quickIntelPlugin } from "@elizaos/plugin-quick-intel"; -import AoTheComputerClientInterface from "@elizaos/client-ao"; +import ClaraClientInterface from "@elizaos/client-clara"; import { aoPlugin } from "@elizaos/plugin-ao"; import twitterPlugin from "@elizaos/plugin-twitter"; @@ -815,9 +815,9 @@ export async function initializeClients( if (xmtpClient) clients.xmtp = xmtpClient; } - if (clientTypes.includes(Clients.AO)) { - const aoTheComputer = await AoTheComputerClientInterface.start(runtime); - if (aoTheComputer) clients.aoTheComputer = aoTheComputer; + if (clientTypes.includes(Clients.CLARA)) { + const claraClient = await ClaraClientInterface.start(runtime); + if (claraClient) clients.clara = claraClient; } if (clientTypes.includes(Clients.DISCORD)) { diff --git a/client/src/lib/info.json b/client/src/lib/info.json index 1023abca0a9..6a42d0bbd27 100644 --- a/client/src/lib/info.json +++ b/client/src/lib/info.json @@ -1 +1 @@ -{"version": "0.1.9"} +{"version": "0.25.6-alpha.1"} diff --git a/package.json b/package.json index 341b5b78530..b55ca757515 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@commitlint/cli": "18.6.1", "@commitlint/config-conventional": "18.6.3", "@permaweb/aoconnect": "^0.0.62", + "@story-protocol/core-sdk": "1.2.0-rc.3", "@types/jest": "^29.5.11", "concurrently": "9.1.0", "cross-env": "7.0.3", diff --git a/packages/client-ao/src/AoClient.ts b/packages/client-ao/src/AoClient.ts deleted file mode 100644 index 7fd28f3018d..00000000000 --- a/packages/client-ao/src/AoClient.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { createDataItemSigner } from "@permaweb/aoconnect"; -import { AoSigner, NodeType } from "./ao_types.ts"; -import { GQL_TX_QUERY, GQL_TXS_QUERY } from "./ao_graphql_query.ts"; -import { Content, elizaLogger } from "@elizaos/core"; -import { AoClaraMarket } from "./AoClaraMarket.ts"; - -export class AoClient { - profileId: string; - walletId: string; - signer: AoSigner; - claraMarket: AoClaraMarket; - - constructor(profileId: string, walletId: string) { - this.profileId = profileId; - this.walletId = walletId; - this.claraMarket = new AoClaraMarket(this.profileId); - } - - async init() { - this.signer = createDataItemSigner(JSON.parse(process.env.AO_WALLET)); - await this.claraMarket.init(); - } - - async sendTaskResult(taskId: string, result: Content) { - try { - const response = await this.claraMarket.profile.sendTaskResult({ - taskId, - result, - }); - elizaLogger.info( - `Task result for id: ${taskId} sent`, - JSON.stringify(response) - ); - return response; - } catch (e) { - elizaLogger.error( - `Could not send task result for task: ${taskId}.`, - e - ); - return false; - } - } - - async getMessage(messageId: string): Promise { - elizaLogger.log(`AO Client getMessage`, messageId); - const messageRes = await fetch( - "https://arweave-search.goldsky.com/graphql", - { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify({ - query: GQL_TX_QUERY, - variables: { - id: messageId, - }, - }), - } - ).then((res) => res.json()); - - const message = messageRes.data.transaction; - message.data.value = await this.getMessageData(messageId); - - return message; - } - - async getMessageData(messageId: string): Promise { - return await fetch(`https://arweave.net/${messageId}`).then((res) => - res.text() - ); - } - - async fetchIncomingMessages(count: number): Promise { - elizaLogger.log( - `AO Client getMessages`, - this.profileId, - this.walletId, - count - ); - const reqBody = { - query: GQL_TXS_QUERY, - variables: { - cursor: "", - entityId: this.walletId, - limit: count, - sortOrder: "INGESTED_AT_DESC", - processId: process.env.AO_MARKET_ID, - }, - }; - - const messageResponse = await fetch( - "https://arweave-search.goldsky.com/graphql", - { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(reqBody), - } - ).then((res) => res.json()); - const messages = messageResponse.data.transactions.edges.map( - (e) => e.node - ); - - for (const m of messages) { - m.data.value = await this.getMessageData(m.id); - m.conversationId = m.id; - } - - return messages; - } -} diff --git a/packages/client-ao/src/ao_graphql_query.ts b/packages/client-ao/src/ao_graphql_query.ts deleted file mode 100644 index a93f144bfb1..00000000000 --- a/packages/client-ao/src/ao_graphql_query.ts +++ /dev/null @@ -1,64 +0,0 @@ -export const GQL_TX_QUERY = ` -query ($id: ID!) { - transaction(id: $id) { - id - ingested_at - recipient - block { - timestamp - height - } - tags { - name - value - } - data { - size - } - owner { - address - } - } -} - -`; - -export const GQL_TXS_QUERY = `query ($entityId: String!, $limit: Int!, $sortOrder: SortOrder!, $cursor: String, $processId: String!) { - transactions( - sort: $sortOrder - first: $limit - after: $cursor - recipients: [$entityId] - tags: { - name: "From-Process", - values: [$processId] - } - ) { - count - ...MessageFields - } -} -fragment MessageFields on TransactionConnection { - edges { - cursor - node { - id - ingested_at - recipient - block { - timestamp - height - } - tags { - name - value - } - data { - size - } - owner { - address - } - } - } -}`; diff --git a/packages/client-ao/src/ao_types.ts b/packages/client-ao/src/ao_types.ts deleted file mode 100644 index 7910ef0c4f6..00000000000 --- a/packages/client-ao/src/ao_types.ts +++ /dev/null @@ -1,63 +0,0 @@ -export type AoSigner = { - ( - args_0: { - data?: any; - tags?: { value?: string; name?: string }[]; - anchor?: string; - target?: string; - }, - ...args: unknown[] - ): Promise<{ id?: string; raw?: any }>; -}; - -export type TagType = { name: string; value: string }; - -export type Message = { - id: string; - owner?: { - address: string; - key: string; - }; - data: string; - tags: TagType[]; - signature: string; - target: string; -}; - -export type NodeDataType = { - size: string; - type: string; - value?: string; -}; - -export type NodeType = { - id: string; - tags: TagType[]; - data: NodeDataType; - ingested_at: number; - url?: string; - block?: { - height: number; - timestamp: number; - }; - owner?: { - address: string; - }; - address?: string; - conversationId: string; -}; - -export type AoTaskType = { - id: string; - requester: string; - originalId: string; - matchingStrategy: string; - block: number; - agentId: string; - contextId: string; - topic: string; - timestamp: number; - requesterId: string; - reward: string; - payload: string; -}; diff --git a/packages/client-ao/src/base.ts b/packages/client-ao/src/base.ts deleted file mode 100644 index b2bbe1bbe96..00000000000 --- a/packages/client-ao/src/base.ts +++ /dev/null @@ -1,219 +0,0 @@ -import { - elizaLogger, - getEmbeddingZeroVector, - IAgentRuntime, - IImageDescriptionService, - Memory, - State, -} from "@elizaos/core"; -import { EventEmitter } from "events"; -import { AoConfig } from "./environment.ts"; -import { AoClient } from "./AoClient.ts"; -import { NodeType } from "./ao_types.ts"; - -class RequestQueue { - private queue: (() => Promise)[] = []; - private processing: boolean = false; - - async add(request: () => Promise): Promise { - return new Promise((resolve, reject) => { - this.queue.push(async () => { - try { - const result = await request(); - resolve(result); - } catch (error) { - reject(error); - } - }); - this.processQueue(); - }); - } - - private async processQueue(): Promise { - if (this.processing || this.queue.length === 0) { - return; - } - this.processing = true; - - while (this.queue.length > 0) { - const request = this.queue.shift()!; - try { - await request(); - } catch (error) { - console.error("Error processing request:", error); - this.queue.unshift(request); - await this.exponentialBackoff(this.queue.length); - } - await this.randomDelay(); - } - - this.processing = false; - } - - private async exponentialBackoff(retryCount: number): Promise { - const delay = Math.pow(2, retryCount) * 1000; - await new Promise((resolve) => setTimeout(resolve, delay)); - } - - private async randomDelay(): Promise { - const delay = Math.floor(Math.random() * 2000) + 1500; - await new Promise((resolve) => setTimeout(resolve, delay)); - } -} - -export class ClientBase extends EventEmitter { - static _aoClients: { [accountIdentifier: string]: AoClient } = {}; - aoClient: AoClient; - runtime: IAgentRuntime; - aoConfig: AoConfig; - directions: string; - lastCheckedMessageTs: number | null = null; - imageDescriptionService: IImageDescriptionService; - temperature: number = 0.5; - requestQueue: RequestQueue = new RequestQueue(); - profileId: string; - walletId: string; - - async cacheMessage(message: NodeType): Promise { - if (!message) { - console.warn("Message is undefined, skipping cache"); - return; - } - - this.runtime.cacheManager.set(`ao/messages/${message.id}`, message); - } - - async getCachedMessage(messageId: string): Promise { - const cached = await this.runtime.cacheManager.get( - `ao/messages/${messageId}` - ); - - return cached; - } - - async getMessage(messageId: string): Promise { - const cachedMessage = await this.getCachedMessage(messageId); - - if (cachedMessage) { - return cachedMessage; - } - - const message = await this.requestQueue.add(() => - this.aoClient.getMessage(messageId) - ); - - await this.cacheMessage(message); - return message; - } - - callback: (self: ClientBase) => any = null; - - onReady() { - throw new Error( - "Not implemented in base class, please call from subclass" - ); - } - - constructor(runtime: IAgentRuntime, aoConfig: AoConfig) { - super(); - this.runtime = runtime; - this.aoConfig = aoConfig; - this.profileId = this.runtime.agentId + "_" + aoConfig.AO_USERNAME; - this.walletId = aoConfig.AO_WALLET_ID; - if (ClientBase._aoClients[this.profileId]) { - this.aoClient = ClientBase._aoClients[this.profileId]; - } else { - this.aoClient = new AoClient(this.profileId, this.walletId); - ClientBase._aoClients[this.profileId] = this.aoClient; - } - - this.directions = - "- " + - this.runtime.character.style.all.join("\n- ") + - "- " + - this.runtime.character.style.post.join(); - } - - async init() { - await this.aoClient.init(); - - if (this.profileId) { - elizaLogger.log("AO profile ID:", this.profileId); - // Store profile info for use in responses - this.runtime.character.twitterProfile = { - id: this.profileId, - username: this.runtime.agentId, - screenName: this.aoConfig.AO_USERNAME, - bio: this.profileId, - }; - } else { - throw new Error("Failed to load profile id"); - } - - await this.loadLatestCheckedMessage(); - } - - async fetchIncomingMessages(count: number): Promise { - elizaLogger.debug("fetching home timeline"); - const incomingMessages = - await this.aoClient.fetchIncomingMessages(count); - - elizaLogger.debug(incomingMessages, { depth: Infinity }); - return incomingMessages; - } - - async fetchTimelineForActions(count: number): Promise { - elizaLogger.debug("fetching timeline for actions"); - return await this.aoClient.fetchIncomingMessages(count); - } - - - async saveRequestMessage(message: Memory, state: State) { - if (message.content.text) { - const recentMessage = await this.runtime.messageManager.getMemories( - { - roomId: message.roomId, - count: 1, - unique: false, - } - ); - - if ( - recentMessage.length > 0 && - recentMessage[0].content === message.content - ) { - elizaLogger.debug("Message already saved", recentMessage[0].id); - } else { - await this.runtime.messageManager.createMemory({ - ...message, - embedding: getEmbeddingZeroVector(), - }); - } - - await this.runtime.evaluate(message, { - ...state, - twitterClient: this.aoClient, - }); - } - } - - async loadLatestCheckedMessage(): Promise { - const latestCheckedMessageTs = - await this.runtime.cacheManager.get( - `ao/${this.profileId}/latest_checked_message_ts` - ); - - if (latestCheckedMessageTs) { - this.lastCheckedMessageTs = latestCheckedMessageTs; - } - } - - async cacheLatestCheckedMessageTimestamp() { - if (this.lastCheckedMessageTs) { - await this.runtime.cacheManager.set( - `ao/${this.profileId}/latest_checked_message_ts`, - this.lastCheckedMessageTs - ); - } - } -} diff --git a/packages/client-ao/src/environment.ts b/packages/client-ao/src/environment.ts deleted file mode 100644 index 064f71a6ea3..00000000000 --- a/packages/client-ao/src/environment.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { parseBooleanFromText, IAgentRuntime } from "@elizaos/core"; -import { z, ZodError } from "zod"; - -export const AO_DEFAULT_MAX_MESSAGE_LENGTH = 280; - -/** - * This schema defines all required/optional environment settings - */ -export const aoEnvSchema = z.object({ - AO_USERNAME: z.string().min(1, "AO username is required"), - AO_WALLET: z.string().min(1, "AO wallet is required"), - AO_WALLET_ID: z.string().min(1, "AO wallet id is required"), - AO_MARKET_ID: z.string().min(1, "AO market protocol id is required"), - AO_MAX_MESSAGE_LENGTH: z - .number() - .int() - .default(AO_DEFAULT_MAX_MESSAGE_LENGTH), - AO_RETRY_LIMIT: z.number().int(), - AO_POLL_INTERVAL: z.number().int(), - // I guess it's possible to do the transformation with zod - // not sure it's preferable, maybe a readability issue - // since more people will know js/ts than zod - /* - z - .string() - .transform((val) => val.trim()) - .pipe( - z.string() - .transform((val) => - val ? val.split(',').map((u) => u.trim()).filter(Boolean) : [] - ) - .pipe( - z.array( - z.string() - .min(1) - .max(15) - .regex( - /^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]$|^[A-Za-z]$/, - 'Invalid AO username format' - ) - ) - ) - .transform((users) => users.join(',')) - ) - .optional() - .default(''), - */ - AO_MESSAGE_INTERVAL_MIN: z.number().int(), - AO_MESSAGE_INTERVAL_MAX: z.number().int(), - AO_MESSAGE_IMMEDIATELY: z.boolean(), -}); - -export type AoConfig = z.infer; - -function safeParseInt( - value: string | undefined | null, - defaultValue: number -): number { - if (!value) return defaultValue; - const parsed = parseInt(value, 10); - return isNaN(parsed) ? defaultValue : Math.max(1, parsed); -} - -/** - * Validates or constructs AO config object using zod, - * taking values from the IAgentRuntime or process.env as needed. - */ -// This also is organized to serve as a point of documentation for the client -// most of the inputs from the framework (env/character) - -// we also do a lot of typing/parsing here -// so we can do it once and only once per character -export async function validateAoConfig( - runtime: IAgentRuntime -): Promise { - try { - const aoConfig = { - AO_USERNAME: - runtime.getSetting("AO_USERNAME") || process.env.AO_USERNAME, - - AO_WALLET: runtime.getSetting("AO_WALLET") || process.env.AO_WALLET, - - AO_WALLET_ID: - runtime.getSetting("AO_WALLET_ID") || process.env.AO_WALLET_ID, - - AO_MARKET_ID: - runtime.getSetting("AO_MARKET_ID") || process.env.AO_MARKET_ID, - - // number as string? - AO_MAX_MESSAGE_LENGTH: safeParseInt( - runtime.getSetting("AO_MAX_MESSAGE_LENGTH") || - process.env.AO_MAX_MESSAGE_LENGTH, - AO_DEFAULT_MAX_MESSAGE_LENGTH - ), - - // int - AO_RETRY_LIMIT: safeParseInt( - runtime.getSetting("AO_RETRY_LIMIT") || - process.env.AO_RETRY_LIMIT, - 5 - ), - - // int in seconds - AO_POLL_INTERVAL: safeParseInt( - runtime.getSetting("AO_POLL_INTERVAL") || - process.env.AO_POLL_INTERVAL, - 120 // 2m - ), - - // int in minutes - AO_MESSAGE_INTERVAL_MIN: safeParseInt( - runtime.getSetting("AO_MESSAGE_INTERVAL_MIN") || - process.env.AO_MESSAGE_INTERVAL_MIN, - 90 // 1.5 hours - ), - - // int in minutes - AO_MESSAGE_INTERVAL_MAX: safeParseInt( - runtime.getSetting("AO_MESSAGE_INTERVAL_MAX") || - process.env.AO_MESSAGE_INTERVAL_MAX, - 180 // 3 hours - ), - - // bool - AO_MESSAGE_IMMEDIATELY: - parseBooleanFromText( - runtime.getSetting("AO_MESSAGE_IMMEDIATELY") || - process.env.AO_MESSAGE_IMMEDIATELY - ) ?? false, - }; - - return aoEnvSchema.parse(aoConfig); - } catch (error) { - if (error instanceof ZodError) { - const errorMessages = error.errors - .map((err) => `${err.path.join(".")}: ${err.message}`) - .join("\n"); - throw new Error( - `X/AO configuration validation failed:\n${errorMessages}` - ); - } - throw error; - } -} diff --git a/packages/client-ao/src/index.ts b/packages/client-ao/src/index.ts deleted file mode 100644 index 3e2aabd23af..00000000000 --- a/packages/client-ao/src/index.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Client, elizaLogger, IAgentRuntime } from "@elizaos/core"; -import { ClientBase } from "./base.ts"; -import { validateAoConfig, AoConfig } from "./environment.ts"; -import { AoTaskClient } from "./tasks/AoTaskClient.ts"; - -/** - * A manager that orchestrates all specialized AoTheComputer logic: - * - client: base operations (login, timeline caching, etc.) - * - interaction: fetching assigned tasks - */ -class AoManager { - client: ClientBase; - tasks: AoTaskClient; - - constructor(runtime: IAgentRuntime, aoConfig: AoConfig) { - // Pass aoConfig to the base client - this.client = new ClientBase(runtime, aoConfig); - - // Mentions and interactions - this.tasks = new AoTaskClient(this.client, runtime); - } -} - -export const AoTheComputerClientInterface: Client = { - async start(runtime: IAgentRuntime) { - const aoTheComputerConfig: AoConfig = await validateAoConfig(runtime); - - elizaLogger.log("===== AoTheComputer client started"); - - const manager = new AoManager(runtime, aoTheComputerConfig); - - // Initialize login/session - await manager.client.init(); - - // Start fetching interactions - await manager.tasks.start(); - - return manager; - }, - - async stop(_runtime: IAgentRuntime) { - elizaLogger.warn("AoTheComputer client does not support stopping yet"); - }, -}; - -export default AoTheComputerClientInterface; diff --git a/packages/client-ao/src/tasks/AoTaskClient.ts b/packages/client-ao/src/tasks/AoTaskClient.ts deleted file mode 100644 index 796bb0e95dd..00000000000 --- a/packages/client-ao/src/tasks/AoTaskClient.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { IAgentRuntime, elizaLogger } from "@elizaos/core"; -import { ClientBase } from "../base.ts"; -import { AoMessageHandler } from "./handlers/AoMessageHandler.ts"; - -export const AO_TASK_ASSIGNMENT_TAG_NAME = "Task-Assignment"; - -export class AoTaskClient { - client: ClientBase; - runtime: IAgentRuntime; - messageHandler: AoMessageHandler; - - constructor(client: ClientBase, runtime: IAgentRuntime) { - this.client = client; - this.runtime = runtime; - this.messageHandler = new AoMessageHandler(this.runtime, this.client); - } - - async start() { - const handleAoTasksLoop = () => { - this.handleAoTasks(); - setTimeout( - handleAoTasksLoop, - this.client.aoConfig.AO_POLL_INTERVAL * 1000 - ); - }; - handleAoTasksLoop(); - } - - private async handleAoTasks() { - elizaLogger.log("Checking AO tasks"); - try { - const aoMessage = - await this.client.aoClient.claraMarket.profile.loadNextAssignedTask(); - if ( - aoMessage && - (!this.client.lastCheckedMessageTs || - aoMessage.timestamp > this.client.lastCheckedMessageTs) - ) { - this.messageHandler.handle(aoMessage); - } - await this.client.cacheLatestCheckedMessageTimestamp(); - elizaLogger.log("Finished checking AO tasks"); - } catch (error) { - console.log(error); - elizaLogger.error("Error handling AO tasks:", error); - } - } -} diff --git a/packages/client-ao/src/tasks/handlers/AoMessageHandler.ts b/packages/client-ao/src/tasks/handlers/AoMessageHandler.ts deleted file mode 100644 index fd606e9212a..00000000000 --- a/packages/client-ao/src/tasks/handlers/AoMessageHandler.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { elizaLogger, IAgentRuntime, stringToUuid, UUID } from "@elizaos/core"; -import { AoTaskType } from "../../ao_types"; -import { ClientBase } from "../../base"; -import { AoTaskHandler } from "./AoTaskHandler"; -import { AoTask } from "../AoTask"; - -export class AoMessageHandler extends AoTask { - private aoTaskHandler: AoTaskHandler; - private aoMessage: AoTaskType; - constructor(runtime: IAgentRuntime, client: ClientBase) { - super(client, runtime); - this.aoTaskHandler = new AoTaskHandler(this.client, this.runtime); - } - - async handle(aoMessage: AoTaskType) { - this.aoMessage = aoMessage; - const { id, payload } = this.aoMessage; - const aoMessageId = stringToUuid(id); - const aoRoomId = stringToUuid(id + "-" + this.agentId); - - elizaLogger.log(`Started processing AO message: ${id}.`); - const valid = await this.validate(aoMessageId); - if (!valid) { - this.updateLastCheckedMessage(); - return; - } - if (!payload) { - elizaLogger.log(`Skipping AO message, could not locate prompt.`); - this.updateLastCheckedMessage(); - return; - } - - await this.aoTaskHandler.handle({ - aoMessage, - aoMessageId, - aoRoomId, - }); - this.updateLastCheckedMessage(); - elizaLogger.log(`Finished processing AO message ${id}.`); - } - - private updateLastCheckedMessage() { - this.client.lastCheckedMessageTs = this.aoMessage.timestamp; - } - - private async validate(aoMessageId: UUID): Promise { - const { requester } = this.aoMessage; - if (requester === this.walletId) { - elizaLogger.log(`Skipping AO message, message from current agent.`); - return false; - } - - const existingResponse = - await this.runtime.messageManager.getMemoryById(aoMessageId); - if (existingResponse) { - elizaLogger.log(`Skipping AO message, already processed task.`); - return false; - } - return true; - } -} diff --git a/packages/client-ao/.npmignore b/packages/client-clara/.npmignore similarity index 100% rename from packages/client-ao/.npmignore rename to packages/client-clara/.npmignore diff --git a/packages/client-ao/eslint.config.mjs b/packages/client-clara/eslint.config.mjs similarity index 100% rename from packages/client-ao/eslint.config.mjs rename to packages/client-clara/eslint.config.mjs diff --git a/packages/client-ao/package.json b/packages/client-clara/package.json similarity index 82% rename from packages/client-ao/package.json rename to packages/client-clara/package.json index 1715baddeba..4b0c053c704 100644 --- a/packages/client-ao/package.json +++ b/packages/client-clara/package.json @@ -1,5 +1,5 @@ { - "name": "@elizaos/client-ao", + "name": "@elizaos/client-clara", "version": "0.1.7", "type": "module", "main": "dist/index.js", @@ -22,11 +22,13 @@ "@elizaos/core": "workspace:*", "@permaweb/aoconnect": "^0.0.62", "glob": "11.0.0", - "redstone-clara-sdk": "^0.0.21", + "redstone-clara-sdk": "^0.0.23", "zod": "3.23.8" }, "devDependencies": { - "tsup": "8.3.5" + "tsup": "8.3.5", + "@story-protocol/core-sdk": "1.2.0-rc.3", + "viem": "2.21.58" }, "scripts": { "build": "tsup --format esm --dts", diff --git a/packages/client-clara/src/ClaraClient.ts b/packages/client-clara/src/ClaraClient.ts new file mode 100644 index 00000000000..4f304a27143 --- /dev/null +++ b/packages/client-clara/src/ClaraClient.ts @@ -0,0 +1,43 @@ +import { Content, elizaLogger } from "@elizaos/core"; +import { AoClaraMarket } from "./market/AoClaraMarket.ts"; +import { ClaraConfig } from "./utils/environment.ts"; +import { StoryClaraMarket } from "./market/StoryClaraMarket.ts"; +import { IClaraMarket } from "./market/IClaraMarket.ts"; + +export class ClaraClient { + claraMarket: IClaraMarket; + + constructor(private profileId: string, private claraConfig: ClaraConfig) { + this.claraMarket = + this.claraConfig.CLARA_IMPL == "ao" + ? new AoClaraMarket(this.profileId, this.claraConfig) + : new StoryClaraMarket(this.profileId, this.claraConfig); + } + + async init() { + await this.claraMarket.init(); + } + + async sendTaskResult(taskId: string, result: Content) { + try { + const response = await this.claraMarket + .getProfile() + .sendTaskResult({ + taskId, + result: JSON.stringify(result), + }); + elizaLogger.info( + `Task result for id: ${taskId} sent`, + JSON.stringify(response) + ); + return response; + } catch (e) { + console.log(e); + elizaLogger.error( + `Could not send task result for task: ${taskId}.`, + e + ); + return false; + } + } +} diff --git a/packages/client-clara/src/base.ts b/packages/client-clara/src/base.ts new file mode 100644 index 00000000000..875b2f67de2 --- /dev/null +++ b/packages/client-clara/src/base.ts @@ -0,0 +1,109 @@ +import { + elizaLogger, + getEmbeddingZeroVector, + IAgentRuntime, + Memory, + State, +} from "@elizaos/core"; +import { EventEmitter } from "events"; +import { ClaraConfig } from "./utils/environment.ts"; +import { ClaraClient } from "./ClaraClient.ts"; + +export class ClientBase extends EventEmitter { + static _claraClients: { [accountIdentifier: string]: ClaraClient } = {}; + claraClient: ClaraClient; + runtime: IAgentRuntime; + claraConfig: ClaraConfig; + directions: string; + lastCheckedMessage: number | null = null; + profileId: string; + walletId: string; + callback: (self: ClientBase) => any = null; + + onReady() { + throw new Error( + "Not implemented in base class, please call from subclass" + ); + } + + constructor(runtime: IAgentRuntime, claraConfig: ClaraConfig) { + super(); + this.runtime = runtime; + this.claraConfig = claraConfig; + this.profileId = `${this.runtime.agentId}_${claraConfig.CLARA_USERNAME}`; + this.walletId = claraConfig.CLARA_WALLET_ID; + if (ClientBase._claraClients[this.profileId]) { + this.claraClient = ClientBase._claraClients[this.profileId]; + } else { + this.claraClient = new ClaraClient( + this.profileId, + this.claraConfig + ); + ClientBase._claraClients[this.profileId] = this.claraClient; + } + + this.directions = + "- " + + this.runtime.character.style.all.join("\n- ") + + "- " + + this.runtime.character.style.post.join(); + } + + async init() { + await this.claraClient.init(); + if (this.profileId) { + elizaLogger.log("Clara profile ID:", this.profileId); + } else { + throw new Error("Failed to load profile id"); + } + + await this.loadLatestCheckedMessage(this.claraConfig.CLARA_IMPL); + } + + async saveRequestMessage(message: Memory, state: State) { + if (message.content.text) { + const recentMessage = await this.runtime.messageManager.getMemories( + { + roomId: message.roomId, + count: 1, + unique: false, + } + ); + if ( + recentMessage.length > 0 && + recentMessage[0].content === message.content + ) { + elizaLogger.debug("Message already saved", recentMessage[0].id); + } else { + await this.runtime.messageManager.createMemory({ + ...message, + embedding: getEmbeddingZeroVector(), + }); + } + await this.runtime.evaluate(message, { + ...state, + twitterClient: this.claraClient, + }); + } + } + + async loadLatestCheckedMessage(claraImpl: string): Promise { + const latestCheckedMessage = + await this.runtime.cacheManager.get( + `${claraImpl}/${this.profileId}/latest_checked_message` + ); + + if (latestCheckedMessage) { + this.lastCheckedMessage = latestCheckedMessage; + } + } + + async cacheLatestCheckedMessage(claraImpl: string) { + if (this.lastCheckedMessage) { + await this.runtime.cacheManager.set( + `${claraImpl}/${this.profileId}/latest_checked_message`, + this.lastCheckedMessage + ); + } + } +} diff --git a/packages/client-clara/src/index.ts b/packages/client-clara/src/index.ts new file mode 100644 index 00000000000..adf730ddfc4 --- /dev/null +++ b/packages/client-clara/src/index.ts @@ -0,0 +1,42 @@ +import { Client, elizaLogger, IAgentRuntime } from "@elizaos/core"; +import { ClientBase } from "./base.ts"; +import { + validateAoConfig, + validateStoryConfig, + ClaraConfig, +} from "./utils/environment.ts"; +import { ClaraTaskClient } from "./tasks/ClaraTaskClient.ts"; + +class ClaraManager { + client: ClientBase; + tasks: ClaraTaskClient; + + constructor(runtime: IAgentRuntime, claraConfig: ClaraConfig) { + this.client = new ClientBase(runtime, claraConfig); + this.tasks = new ClaraTaskClient(this.client, runtime); + } +} + +export const ClaraClientInterface: Client = { + async start(runtime: IAgentRuntime) { + let claraConfig: ClaraConfig; + if (runtime.getSetting("AO_WALLET") || process.env.AO_WALLET) { + claraConfig = await validateAoConfig(runtime); + } else { + claraConfig = await validateStoryConfig(runtime); + } + elizaLogger.log( + `===== Clara client started: ${claraConfig.CLARA_IMPL}` + ); + const manager = new ClaraManager(runtime, claraConfig); + await manager.client.init(); + await manager.tasks.start(); + return manager; + }, + + async stop(_runtime: IAgentRuntime) { + elizaLogger.warn("Clara client does not support stopping yet"); + }, +}; + +export default ClaraClientInterface; diff --git a/packages/client-ao/src/AoClaraMarket.ts b/packages/client-clara/src/market/AoClaraMarket.ts similarity index 63% rename from packages/client-ao/src/AoClaraMarket.ts rename to packages/client-clara/src/market/AoClaraMarket.ts index a78c267d0e3..ab1e87fb3ad 100644 --- a/packages/client-ao/src/AoClaraMarket.ts +++ b/packages/client-clara/src/market/AoClaraMarket.ts @@ -1,15 +1,27 @@ import { ClaraMarket, ClaraProfile } from "redstone-clara-sdk"; import { elizaLogger } from "@elizaos/core"; import fs from "fs"; +import { ClaraConfig } from "../utils/environment"; +import { IClaraMarket } from "./IClaraMarket"; +import { parseEther } from "viem"; -export class AoClaraMarket { - profile: ClaraProfile; +export class AoClaraMarket implements IClaraMarket { + private profile: ClaraProfile; private market: ClaraMarket; - private aoWallet: string; + private wallet: string; - constructor(private profileId: string) { - this.market = new ClaraMarket(process.env.AO_MARKET_ID); - this.aoWallet = process.env.AO_WALLET; + constructor(private profileId: string, private claraConfig: ClaraConfig) { + this.market = new ClaraMarket(this.claraConfig.CLARA_MARKET_ID); + this.wallet = this.claraConfig.CLARA_WALLET; + } + getProfile() { + return this.profile; + } + getMarket() { + return this.market; + } + getWallet(): string { + return this.wallet; } async init() { @@ -18,7 +30,7 @@ export class AoClaraMarket { async connectProfile(): Promise { elizaLogger.info("connecting profile", this.profileId); - const parsedWallet = JSON.parse(this.aoWallet); + const parsedWallet = JSON.parse(this.wallet); if (fs.existsSync(`../profiles/${this.profileId}`)) { elizaLogger.info( `Agent already registered, connecting`, @@ -36,7 +48,7 @@ export class AoClaraMarket { this.profile = await this.market.registerAgent(parsedWallet, { metadata: { description: this.profileId }, topic: "tweet", - fee: 100000000, + fee: parseEther("0.000000000001"), agentId: this.profileId, }); } catch (e) { diff --git a/packages/client-clara/src/market/IClaraMarket.ts b/packages/client-clara/src/market/IClaraMarket.ts new file mode 100644 index 00000000000..559285d68fe --- /dev/null +++ b/packages/client-clara/src/market/IClaraMarket.ts @@ -0,0 +1,15 @@ +import { + ClaraProfile, + ClaraProfileStory, + ClaraMarket, + ClaraMarketStory, +} from "redstone-clara-sdk"; + +export interface IClaraMarket { + getProfile(): ClaraProfile | ClaraProfileStory; + getMarket(): ClaraMarket | ClaraMarketStory; + //wallet: string; + getWallet(): string; + init(): Promise; + connectProfile(): Promise; +} diff --git a/packages/client-clara/src/market/StoryClaraMarket.ts b/packages/client-clara/src/market/StoryClaraMarket.ts new file mode 100644 index 00000000000..ebb09cb188a --- /dev/null +++ b/packages/client-clara/src/market/StoryClaraMarket.ts @@ -0,0 +1,62 @@ +import { ClaraMarketStory, ClaraProfileStory } from "redstone-clara-sdk"; +import { elizaLogger } from "@elizaos/core"; +import fs from "fs"; +import { ClaraConfig } from "../utils/environment"; +import { IClaraMarket } from "./IClaraMarket"; + +export class StoryClaraMarket implements IClaraMarket { + private profile: ClaraProfileStory; + private market: ClaraMarketStory; + private wallet: string; + + constructor(private profileId: string, private claraConfig: ClaraConfig) { + this.market = new ClaraMarketStory(this.claraConfig.CLARA_MARKET_ID); + this.wallet = this.claraConfig.CLARA_WALLET; + } + + async init() { + await this.connectProfile(); + } + + getProfile() { + return this.profile; + } + getMarket() { + return this.market; + } + getWallet(): string { + return this.wallet; + } + + async connectProfile(): Promise { + elizaLogger.info("connecting profile", this.profileId); + if (fs.existsSync(`../profiles/${this.profileId}`)) { + elizaLogger.info( + `Agent already registered, connecting`, + this.profileId + ); + elizaLogger.info(this.wallet, this.claraConfig.CLARA_MARKET_ID); + try { + this.profile = new ClaraProfileStory( + this.wallet, + this.claraConfig.CLARA_MARKET_ID + ); + } catch (e) { + console.log(e); + } + } else { + try { + this.profile = await this.market.registerAgent(this.wallet, { + metadata: { description: this.profileId }, + topic: "tweet", + fee: 10000000, + agentId: this.profileId, + }); + } catch (e) { + elizaLogger.error(`Could not create Clara profile`, e); + throw new Error(e); + } + fs.mkdirSync(`../profiles/${this.profileId}`, { recursive: true }); + } + } +} diff --git a/packages/client-ao/src/tasks/AoTask.ts b/packages/client-clara/src/tasks/ClaraTask.ts similarity index 91% rename from packages/client-ao/src/tasks/AoTask.ts rename to packages/client-clara/src/tasks/ClaraTask.ts index 73400bc9dce..559342215f0 100644 --- a/packages/client-ao/src/tasks/AoTask.ts +++ b/packages/client-clara/src/tasks/ClaraTask.ts @@ -1,7 +1,7 @@ import { IAgentRuntime, UUID } from "@elizaos/core"; import { ClientBase } from "../base"; -export abstract class AoTask { +export abstract class ClaraTask { protected walletId: string; protected agentId: UUID; constructor( diff --git a/packages/client-clara/src/tasks/ClaraTaskClient.ts b/packages/client-clara/src/tasks/ClaraTaskClient.ts new file mode 100644 index 00000000000..99a8d19a6ef --- /dev/null +++ b/packages/client-clara/src/tasks/ClaraTaskClient.ts @@ -0,0 +1,93 @@ +import { IAgentRuntime, elizaLogger } from "@elizaos/core"; +import { ClientBase } from "../base.ts"; +import { ClaraMessageHandler } from "./handlers/ClaraMessageHandler.ts"; +import { ClaraLoadTaskType, ClaraTaskType } from "../utils/claraTypes.ts"; + +export const CLARA_TASK_ASSIGNMENT_TAG_NAME = "Task-Assignment"; + +export class ClaraTaskClient { + client: ClientBase; + runtime: IAgentRuntime; + messageHandler: ClaraMessageHandler; + + constructor(client: ClientBase, runtime: IAgentRuntime) { + this.client = client; + this.runtime = runtime; + this.messageHandler = new ClaraMessageHandler( + this.runtime, + this.client + ); + } + + async start() { + const handleTasksLoop = () => { + this.handleTasks(); + setTimeout( + handleTasksLoop, + this.client.claraConfig.CLARA_POLL_INTERVAL * 1000 + ); + }; + handleTasksLoop(); + } + + private async handleTasks() { + elizaLogger.log("Checking CLARA tasks"); + try { + const messageToProcess = await this.getMessageToProcess(); + if (messageToProcess) { + await this.messageHandler.handle(messageToProcess); + } + await this.client.cacheLatestCheckedMessage( + this.client.claraConfig.CLARA_IMPL + ); + elizaLogger.log("Finished checking Clara tasks"); + } catch (error) { + console.log(error); + elizaLogger.error("Error handling Clara tasks:", error); + } + } + + private async getMessageToProcess(): Promise { + switch (this.client.claraConfig.CLARA_IMPL) { + case "ao": { + const message = (await this.client.claraClient.claraMarket + .getProfile() + .loadNextAssignedTask()) as ClaraTaskType; + if ( + message && + (!this.client.lastCheckedMessage || + message.timestamp > this.client.lastCheckedMessage) + ) { + return message; + } + } + case "story": { + const cursor = this.client.lastCheckedMessage; + const loadTaskResult = cursor + ? ((await this.client.claraClient.claraMarket + .getProfile() + .loadNextAssignedTask( + BigInt(cursor) + )) as ClaraLoadTaskType) + : ((await this.client.claraClient.claraMarket + .getProfile() + .loadNextAssignedTask()) as ClaraLoadTaskType); + if (loadTaskResult?.result) { + const message: ClaraTaskType = { + ...loadTaskResult.result, + id: loadTaskResult.result.id.toString(), + timestamp: Number(loadTaskResult.result.timestamp), + contextId: loadTaskResult.result.contextId.toString(), + cursor: loadTaskResult.cursor, + reward: loadTaskResult.result.reward.toString(), + }; + return message; + } else { + return null; + } + } + default: + return null; + } + } +} diff --git a/packages/client-clara/src/tasks/handlers/ClaraMessageHandler.ts b/packages/client-clara/src/tasks/handlers/ClaraMessageHandler.ts new file mode 100644 index 00000000000..d4329f4edd1 --- /dev/null +++ b/packages/client-clara/src/tasks/handlers/ClaraMessageHandler.ts @@ -0,0 +1,76 @@ +import { elizaLogger, IAgentRuntime, stringToUuid, UUID } from "@elizaos/core"; +import { ClaraTaskType } from "../../utils/claraTypes"; +import { ClientBase } from "../../base"; +import { ClaraTaskHandler } from "./ClaraTaskHandler"; +import { ClaraTask } from "../ClaraTask"; + +export class ClaraMessageHandler extends ClaraTask { + private claraTaskHandler: ClaraTaskHandler; + private claraMessage: ClaraTaskType; + constructor(runtime: IAgentRuntime, client: ClientBase) { + super(client, runtime); + this.claraTaskHandler = new ClaraTaskHandler(this.client, this.runtime); + } + + async handle(claraMessage: ClaraTaskType) { + this.claraMessage = claraMessage; + const { id, payload } = this.claraMessage; + const claraMessageId = stringToUuid(id); + const claraRoomId = stringToUuid(id + "-" + this.agentId); + + elizaLogger.log(`Started processing Clara message: ${id}.`); + const valid = await this.validate(claraMessageId); + if (!valid) { + this.updateLastCheckedMessage(); + return; + } + if (!payload) { + elizaLogger.log(`Skipping Clara message, could not locate prompt.`); + this.updateLastCheckedMessage(); + return; + } + + await this.claraTaskHandler.handle({ + claraMessage, + claraMessageId, + claraRoomId, + }); + this.updateLastCheckedMessage(); + elizaLogger.log(`Finished processing Clara message ${id}.`); + } + + private updateLastCheckedMessage() { + switch (this.client.claraConfig.CLARA_IMPL) { + case "ao": + this.client.lastCheckedMessage = this.claraMessage.timestamp; + break; + case "story": + this.client.lastCheckedMessage = Number( + this.claraMessage.cursor + ); + break; + default: + throw new Error( + `Unknown Clara impl: ${this.client.claraConfig.CLARA_IMPL}` + ); + } + } + + private async validate(claraMessageId: UUID): Promise { + const { requester } = this.claraMessage; + if (requester === this.walletId) { + elizaLogger.log( + `Skipping Clara message, message from current agent.` + ); + return false; + } + + const existingResponse = + await this.runtime.messageManager.getMemoryById(claraMessageId); + if (existingResponse) { + elizaLogger.log(`Skipping Clara message, already processed task.`); + return false; + } + return true; + } +} diff --git a/packages/client-ao/src/tasks/handlers/AoStateCompositionHandler.ts b/packages/client-clara/src/tasks/handlers/ClaraStateCompositionHandler.ts similarity index 62% rename from packages/client-ao/src/tasks/handlers/AoStateCompositionHandler.ts rename to packages/client-clara/src/tasks/handlers/ClaraStateCompositionHandler.ts index e847efcadbd..719c9b078b8 100644 --- a/packages/client-ao/src/tasks/handlers/AoStateCompositionHandler.ts +++ b/packages/client-clara/src/tasks/handlers/ClaraStateCompositionHandler.ts @@ -1,22 +1,22 @@ import { elizaLogger, IAgentRuntime, Memory, State } from "@elizaos/core"; -import { AoTaskType } from "../../ao_types"; +import { ClaraTaskType } from "../../utils/claraTypes"; import { ClientBase } from "../../base"; -import { AoTask } from "../AoTask"; -import { buildConversationThread } from "../../utils"; +import { ClaraTask } from "../ClaraTask"; +import { buildConversationThread } from "../../utils/utils"; -export class AoStateCompositionHandler extends AoTask { +export class ClaraStateCompositionHandler extends ClaraTask { constructor(runtime: IAgentRuntime, client: ClientBase) { super(client, runtime); } async handle( - aoMessage: AoTaskType, + claraMessage: ClaraTaskType, prompt: string, memory: Memory ): Promise { - const currentMessage = this.formatMessage(aoMessage, prompt); + const currentMessage = this.formatMessage(claraMessage, prompt); const thread = await buildConversationThread( - aoMessage, + claraMessage, prompt, this.client ); @@ -36,21 +36,21 @@ export class AoStateCompositionHandler extends AoTask { .join("\n\n"); elizaLogger.info( - `Formated conversation for message id: ${aoMessage.id}`, + `Formated conversation for message id: ${claraMessage.id}`, formattedConversation ); return await this.runtime.composeState(memory, { - aoClient: this.client.aoClient, - aoUserName: this.client.aoConfig.AO_USERNAME, + claraClient: this.client.claraClient, + claraUserName: this.client.claraConfig.CLARA_USERNAME, currentMessage, formattedConversation, recentPostInteractions: [formattedConversation], }); } - formatMessage(aoMessage: AoTaskType, prompt: string) { - return ` ID: ${aoMessage.id} - From: ${aoMessage.requester} (@${aoMessage.requester}) + formatMessage(claraMessage: ClaraTaskType, prompt: string) { + return ` ID: ${claraMessage.id} + From: ${claraMessage.requester} (@${claraMessage.requester}) Text: ${prompt}`; } } diff --git a/packages/client-ao/src/tasks/handlers/AoTaskHandler.ts b/packages/client-clara/src/tasks/handlers/ClaraTaskHandler.ts similarity index 70% rename from packages/client-ao/src/tasks/handlers/AoTaskHandler.ts rename to packages/client-clara/src/tasks/handlers/ClaraTaskHandler.ts index c3d983ced4a..eedfa7d2676 100644 --- a/packages/client-ao/src/tasks/handlers/AoTaskHandler.ts +++ b/packages/client-clara/src/tasks/handlers/ClaraTaskHandler.ts @@ -11,23 +11,23 @@ import { UUID, } from "@elizaos/core"; import { ClientBase } from "../../base"; -import { AoTaskType } from "../../ao_types"; -import { AoStateCompositionHandler } from "./AoStateCompositionHandler"; -import { wait } from "../../utils"; -import { AoTask } from "../AoTask"; +import { ClaraTaskType } from "../../utils/claraTypes"; +import { ClaraStateCompositionHandler } from "./ClaraStateCompositionHandler"; +import { wait } from "../../utils/utils"; +import { ClaraTask } from "../ClaraTask"; -export class AoTaskHandler extends AoTask { - private stateCompositionHandler: AoStateCompositionHandler; +export class ClaraTaskHandler extends ClaraTask { + private stateCompositionHandler: ClaraStateCompositionHandler; constructor(client: ClientBase, runtime: IAgentRuntime) { super(client, runtime); - this.stateCompositionHandler = new AoStateCompositionHandler( + this.stateCompositionHandler = new ClaraStateCompositionHandler( this.runtime, this.client ); } - async handle({ aoMessage, aoMessageId, aoRoomId }): Promise { - const { payload, id, topic, requester } = aoMessage; + async handle({ claraMessage, claraMessageId, claraRoomId }): Promise { + const { payload, id, topic, requester } = claraMessage; if (!payload || typeof payload !== "string") { elizaLogger.error(`Task id ${id}, invalid payload : `, payload); return; @@ -46,55 +46,55 @@ export class AoTaskHandler extends AoTask { ) ) { elizaLogger.log( - `AO task could not be processed, no action with name ${topic}.` + `Clara task could not be processed, no action with name ${topic}.` ); } const userIdUUID = this.buildUserUUID(requester); await this.runtime.ensureConnection( userIdUUID, - aoRoomId, + claraRoomId, requester, requester, - "ao" + "clara" ); - const memory = this.buildMemory(prompt, aoRoomId, userIdUUID); + const memory = this.buildMemory(prompt, claraRoomId, userIdUUID); const state = await this.stateCompositionHandler.handle( - aoMessage, + claraMessage, prompt, memory ); - await this.saveAoTaskIfNeeded( - aoMessage, - aoRoomId, - aoMessageId, + await this.saveClaraTaskIfNeeded( + claraMessage, + claraRoomId, + claraMessageId, prompt, state ); await this.processTaskInActions( state, memory, - aoMessage, - aoRoomId, - aoMessageId, + claraMessage, + claraRoomId, + claraMessageId, prompt, topic, id ); } - private async saveAoTaskIfNeeded( - aoMessage: AoTaskType, + private async saveClaraTaskIfNeeded( + claraMessage: ClaraTaskType, roomId: UUID, messageId: UUID, prompt: string, state: State ) { - const { timestamp, requester } = aoMessage; - const aoMessageExists = + const { timestamp, requester } = claraMessage; + const claraMessageExists = await this.runtime.messageManager.getMemoryById(messageId); - if (!aoMessageExists) { - elizaLogger.log("AO message does not exist, saving"); + if (!claraMessageExists) { + elizaLogger.log("Clara message does not exist, saving"); const userIdUUID = stringToUuid(requester); const message = { @@ -115,18 +115,18 @@ export class AoTaskHandler extends AoTask { private async processTaskInActions( state: any, memory: any, - aoMessage: AoTaskType, + claraMessage: ClaraTaskType, roomId: UUID, messageId: UUID, prompt: string, task: string, taskId: string ) { - const { id } = aoMessage; + const { id } = claraMessage; const self = this; try { const callback: HandlerCallback = async (content: Content) => { - await self.client.aoClient.sendTaskResult(taskId, content); + await self.client.claraClient.sendTaskResult(taskId, content); return []; }; const responseMessage: Memory = { @@ -137,8 +137,8 @@ export class AoTaskHandler extends AoTask { content: { text: prompt, action: task, - source: "AoTheComputer", - url: `https://www.ao.link/#/message/${id}`, + source: "Clara", + // url: `https://www.ao.link/#/message/${id}`, // inReplyTo: stringToUuid( // id + "-" + this.client.runtime.agentId // ), @@ -162,12 +162,12 @@ export class AoTaskHandler extends AoTask { } } - private buildMemory(prompt: string, aoRoomId: UUID, userIdUUID: UUID) { + private buildMemory(prompt: string, claraRoomId: UUID, userIdUUID: UUID) { return { content: { text: prompt }, agentId: this.runtime.agentId, userId: userIdUUID, - roomId: aoRoomId, + roomId: claraRoomId, }; } diff --git a/packages/client-clara/src/utils/claraTypes.ts b/packages/client-clara/src/utils/claraTypes.ts new file mode 100644 index 00000000000..390fcacd41a --- /dev/null +++ b/packages/client-clara/src/utils/claraTypes.ts @@ -0,0 +1,21 @@ +export type ClaraTaskType = { + id: string; + requester: string; + originalId: string; + matchingStrategy: string; + agentId: string; + contextId: string; + topic: string; + timestamp: number; + requesterId: string; + reward: string; + payload: string; + block?: number; + blockNumber?: number; + cursor?: number; +}; + +export type ClaraLoadTaskType = { + result: ClaraTaskType; + cursor: number; +}; diff --git a/packages/client-clara/src/utils/environment.ts b/packages/client-clara/src/utils/environment.ts new file mode 100644 index 00000000000..b2d6dbb71b9 --- /dev/null +++ b/packages/client-clara/src/utils/environment.ts @@ -0,0 +1,107 @@ +import { IAgentRuntime } from "@elizaos/core"; +import { z, ZodError } from "zod"; + +export const claraEnvSchema = z.object({ + CLARA_USERNAME: z.string().min(1, "CLARA username is required"), + CLARA_WALLET: z.string().min(1, "CLARA wallet is required"), + CLARA_WALLET_ID: z.string().min(1, "CLARA wallet id is required"), + CLARA_MARKET_ID: z.string().min(1, "CLARA market protocol id is required"), + CLARA_POLL_INTERVAL: z.number().int(), +}); + +export type ClaraSchema = z.infer; +export type ClaraConfig = ClaraSchema & { CLARA_IMPL: string }; + +export async function validateAoConfig( + runtime: IAgentRuntime +): Promise { + try { + const aoConfig = { + CLARA_USERNAME: + runtime.getSetting("AO_USERNAME") || process.env.AO_USERNAME, + + CLARA_WALLET: + runtime.getSetting("AO_WALLET") || process.env.AO_WALLET, + + CLARA_WALLET_ID: + runtime.getSetting("AO_WALLET_ID") || process.env.AO_WALLET_ID, + + CLARA_MARKET_ID: + runtime.getSetting("AO_MARKET_ID") || process.env.AO_MARKET_ID, + + CLARA_POLL_INTERVAL: safeParseInt( + runtime.getSetting("AO_POLL_INTERVAL") || + process.env.AO_POLL_INTERVAL, + 120 // 2m + ), + }; + + return { + ...claraEnvSchema.parse(aoConfig), + CLARA_IMPL: "ao", + }; + } catch (error) { + if (error instanceof ZodError) { + const errorMessages = error.errors + .map((err) => `${err.path.join(".")}: ${err.message}`) + .join("\n"); + throw new Error( + `X/AO configuration validation failed:\n${errorMessages}` + ); + } + throw error; + } +} + +export async function validateStoryConfig( + runtime: IAgentRuntime +): Promise { + try { + const storyConfig = { + CLARA_USERNAME: + runtime.getSetting("STORY_USERNAME") || + process.env.STORY_USERNAME, + + CLARA_WALLET: + runtime.getSetting("STORY_WALLET") || process.env.STORY_WALLET, + + CLARA_WALLET_ID: + runtime.getSetting("STORY_WALLET_ID") || + process.env.STORY_WALLET_ID, + + CLARA_MARKET_ID: + runtime.getSetting("STORY_MARKET_ID") || + process.env.STORY_MARKET_ID, + + CLARA_POLL_INTERVAL: safeParseInt( + runtime.getSetting("AO_POLL_INTERVAL") || + process.env.AO_POLL_INTERVAL, + 120 // 2m + ), + }; + + return { + ...claraEnvSchema.parse(storyConfig), + CLARA_IMPL: "story", + }; + } catch (error) { + if (error instanceof ZodError) { + const errorMessages = error.errors + .map((err) => `${err.path.join(".")}: ${err.message}`) + .join("\n"); + throw new Error( + `X/AO configuration validation failed:\n${errorMessages}` + ); + } + throw error; + } +} + +function safeParseInt( + value: string | undefined | null, + defaultValue: number +): number { + if (!value) return defaultValue; + const parsed = parseInt(value, 10); + return isNaN(parsed) ? defaultValue : Math.max(1, parsed); +} diff --git a/packages/client-ao/src/utils.ts b/packages/client-clara/src/utils/utils.ts similarity index 91% rename from packages/client-ao/src/utils.ts rename to packages/client-clara/src/utils/utils.ts index 8f3e35385c9..a2de63e25ba 100644 --- a/packages/client-ao/src/utils.ts +++ b/packages/client-clara/src/utils/utils.ts @@ -1,8 +1,8 @@ import { getEmbeddingZeroVector } from "@elizaos/core"; import { stringToUuid } from "@elizaos/core"; -import { ClientBase } from "./base"; +import { ClientBase } from "../base.ts"; import { elizaLogger } from "@elizaos/core"; -import { AoTaskType, NodeType } from "./ao_types.ts"; +import { ClaraTaskType } from "./claraTypes.ts"; export const wait = (minTime: number = 1000, maxTime: number = 3000) => { const waitTime = @@ -11,16 +11,16 @@ export const wait = (minTime: number = 1000, maxTime: number = 3000) => { }; export async function buildConversationThread( - aoMessage: AoTaskType, + aoMessage: ClaraTaskType, prompt: string, client: ClientBase, maxReplies: number = 10 -): Promise { - const thread: AoTaskType[] = []; +): Promise { + const thread: ClaraTaskType[] = []; const visited: Set = new Set(); async function processThread( - currentMessage: AoTaskType, + currentMessage: ClaraTaskType, depth: number = 0 ) { elizaLogger.debug("Processing message:", { @@ -54,7 +54,7 @@ export async function buildConversationThread( roomId, currentMessage.requester, currentMessage.requester, - "ao" + "clara" ); await client.runtime.messageManager.createMemory({ @@ -64,7 +64,7 @@ export async function buildConversationThread( agentId: client.runtime.agentId, content: { text: prompt, - source: "AoTheComputer", + source: "Clara", url: currentMessage.id, }, createdAt: currentMessage.timestamp, diff --git a/packages/client-ao/tsconfig.json b/packages/client-clara/tsconfig.json similarity index 100% rename from packages/client-ao/tsconfig.json rename to packages/client-clara/tsconfig.json diff --git a/packages/client-ao/tsup.config.ts b/packages/client-clara/tsup.config.ts similarity index 100% rename from packages/client-ao/tsup.config.ts rename to packages/client-clara/tsup.config.ts diff --git a/packages/core/src/defaultCharacter.ts b/packages/core/src/defaultCharacter.ts index 8faaa64f2b4..cebfa66f35f 100644 --- a/packages/core/src/defaultCharacter.ts +++ b/packages/core/src/defaultCharacter.ts @@ -1,10 +1,10 @@ -import { Character, ModelProviderName } from "./types.ts"; +import { Character, Clients, ModelProviderName } from "./types.ts"; export const defaultCharacter: Character = { name: "Eliza", username: "eliza", plugins: [], - clients: [], + clients: [Clients.CLARA], modelProvider: ModelProviderName.LLAMALOCAL, settings: { secrets: {}, diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 9fe90681b54..be60ec94a5f 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -649,7 +649,7 @@ export type Plugin = { */ export enum Clients { ALEXA= "alexa", - AO = "ao", + CLARA = "clara", DISCORD = "discord", DIRECT = "direct", TWITTER = "twitter", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed52b9e0295..319dcfcf051 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,6 +82,12 @@ importers: '@commitlint/config-conventional': specifier: 18.6.3 version: 18.6.3 + '@permaweb/aoconnect': + specifier: ^0.0.62 + version: 0.0.62 + '@story-protocol/core-sdk': + specifier: 1.2.0-rc.3 + version: 1.2.0-rc.3(bufferutil@4.0.9)(typescript@5.6.3)(utf-8-validate@6.0.5)(zod@3.24.1) '@types/jest': specifier: ^29.5.11 version: 29.5.14 @@ -151,6 +157,9 @@ importers: '@elizaos/client-auto': specifier: workspace:* version: link:../packages/client-auto + '@elizaos/client-clara': + specifier: workspace:* + version: link:../packages/client-clara '@elizaos/client-deva': specifier: workspace:* version: link:../packages/client-deva @@ -214,6 +223,9 @@ importers: '@elizaos/plugin-ankr': specifier: workspace:* version: link:../packages/plugin-ankr + '@elizaos/plugin-ao': + specifier: workspace:* + version: link:../packages/plugin-ao '@elizaos/plugin-aptos': specifier: workspace:* version: link:../packages/plugin-aptos @@ -1005,6 +1017,37 @@ importers: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.14(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + packages/client-clara: + dependencies: + '@elizaos/core': + specifier: workspace:* + version: link:../core + '@permaweb/aoconnect': + specifier: ^0.0.62 + version: 0.0.62 + glob: + specifier: 11.0.0 + version: 11.0.0 + redstone-clara-sdk: + specifier: ^0.0.23 + version: 0.0.23(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + whatwg-url: + specifier: 7.1.0 + version: 7.1.0 + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + '@story-protocol/core-sdk': + specifier: 1.2.0-rc.3 + version: 1.2.0-rc.3(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + tsup: + specifier: 8.3.5 + version: 8.3.5(@swc/core@1.10.14(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + viem: + specifier: 2.21.58 + version: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + packages/client-deva: dependencies: '@elizaos/core': @@ -1894,6 +1937,33 @@ importers: specifier: ^3.0.0 version: 3.0.5(@types/debug@4.1.12)(@types/node@22.13.1)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.38.0) + packages/plugin-ao: + dependencies: + '@elizaos/core': + specifier: workspace:* + version: link:../core + '@permaweb/aoconnect': + specifier: ^0.0.62 + version: 0.0.62 + form-data: + specifier: 4.0.1 + version: 4.0.1 + node-cache: + specifier: 5.1.2 + version: 5.1.2 + redstone-clara-sdk: + specifier: ^0.0.21 + version: 0.0.21 + tsup: + specifier: 8.3.5 + version: 8.3.5(@swc/core@1.10.14(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) + vitest: + specifier: 2.1.4 + version: 2.1.4(@types/node@22.13.1)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.38.0) + whatwg-url: + specifier: 7.1.0 + version: 7.1.0 + packages/plugin-apro: dependencies: '@elizaos/core': @@ -2462,7 +2532,7 @@ importers: version: link:../core '@skip-go/client': specifier: ^0.16.3 - version: 0.16.8(@types/react@19.0.8)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(starknet@6.18.0(encoding@0.1.13))(utf-8-validate@5.0.10)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) + version: 0.16.8(@types/react@19.0.8)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(starknet@6.18.0(encoding@0.1.13))(utf-8-validate@5.0.10)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) axios: specifier: ^1.7.9 version: 1.7.9 @@ -2818,7 +2888,7 @@ importers: version: 5.15.5 '@lifi/sdk': specifier: 3.4.1 - version: 3.4.1(@solana/wallet-adapter-base@0.9.23)(typescript@5.7.3)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1)) + version: 3.4.1(@solana/wallet-adapter-base@0.9.23)(typescript@5.7.3)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1)) '@lifi/types': specifier: 16.3.0 version: 16.3.0 @@ -3044,16 +3114,16 @@ importers: version: 0.4.6(zod@3.23.8) '@goat-sdk/plugin-erc20': specifier: 0.2.2 - version: 0.2.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) + version: 0.2.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) '@goat-sdk/plugin-kim': specifier: 0.1.2 - version: 0.1.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) + version: 0.1.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) '@goat-sdk/wallet-evm': specifier: 0.2.0 version: 0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) '@goat-sdk/wallet-viem': specifier: 0.2.0 - version: 0.2.0(@goat-sdk/wallet-evm@0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) + version: 0.2.0(@goat-sdk/wallet-evm@0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) tsup: specifier: 8.3.5 version: 8.3.5(@swc/core@1.10.14(@swc/helpers@0.5.15))(jiti@2.4.2)(postcss@8.5.1)(tsx@4.19.2)(typescript@5.7.3)(yaml@2.7.0) @@ -3451,7 +3521,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.9)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.7.3)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) + version: 3.4.1(@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.7.3)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@lifi/types': specifier: 16.3.0 version: 16.3.0 @@ -4254,13 +4324,13 @@ importers: version: 0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10) '@goat-sdk/plugin-coingecko': specifier: 0.1.4 - version: 0.1.4(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) + version: 0.1.4(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@goat-sdk/plugin-erc20': specifier: 0.1.7 - version: 0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) + version: 0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.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.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) + version: 0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@solana/web3.js': specifier: npm:@solana/web3.js@1.95.8 version: 1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10) @@ -5082,16 +5152,16 @@ importers: version: 0.4.6(zod@3.23.8) '@goat-sdk/plugin-zilliqa': specifier: 0.1.3 - version: 0.1.3(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-zilliqa@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5))(encoding@0.1.13)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) + version: 0.1.3(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-zilliqa@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5))(encoding@0.1.13)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) '@goat-sdk/wallet-evm': specifier: 0.2.6 version: 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) '@goat-sdk/wallet-viem': specifier: 0.2.6 - version: 0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) + version: 0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) '@goat-sdk/wallet-zilliqa': specifier: 0.2.6 - version: 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5) + version: 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5) '@zilliqa-js/account': specifier: ^3.5.0 version: 3.5.0(encoding@0.1.13) @@ -11026,6 +11096,17 @@ packages: resolution: {integrity: sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg==} engines: {node: '>=10.12.0'} + '@permaweb/ao-scheduler-utils@0.0.25': + resolution: {integrity: sha512-b0UYSTgnLMIYLScrfNBgcqK7ZMmd78L3J0Jz4RIsIq2P5PtkdRqQ7fYqLlltg7bD1f3dvl4TkO1925ED4ei7LA==} + engines: {node: '>=18'} + + '@permaweb/aoconnect@0.0.62': + resolution: {integrity: sha512-e42yASru6ze09rugKzi2yD3E57OK0xSbjDM5TI7gKnDVMo8JHweiLCntglItJ44vuNUA7Sdool83v4bmEohaZw==} + engines: {node: '>=18'} + + '@permaweb/protocol-tag-utils@0.0.2': + resolution: {integrity: sha512-2IiKu71W7pkHKIzxabCGQ5q8DSppZaE/sPcPF2hn+OWwfe04M7b5X5LHRXQNPRuxHWuioieGdPQb3F7apOlffQ==} + '@phala/dstack-sdk@0.1.7': resolution: {integrity: sha512-/+8S6XpAnN9X6pCiA7eBD+QtEWOtYhlN7Osrf9K59G6E8q6SdXUbJzuNpNBHtlZV+Pm7zm4zOhnwnpvShLD0Xg==} engines: {node: '>=18.0.0'} @@ -14442,12 +14523,26 @@ packages: '@vitest/expect@1.6.1': resolution: {integrity: sha512-jXL+9+ZNIJKruofqXuuTClf44eSpcHlgj3CiuNihUF3Ioujtmc0zIa3UJOW5RjDK1YLBJZnWBlPuqhYycLioog==} + '@vitest/expect@2.1.4': + resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} + '@vitest/expect@2.1.9': resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} '@vitest/expect@3.0.5': resolution: {integrity: sha512-nNIOqupgZ4v5jWuQx2DSlHLEs7Q4Oh/7AYwNyE+k0UQzG7tSmjPXShUikn1mpNGzYEN2jJbTvLejwShMitovBA==} + '@vitest/mocker@2.1.4': + resolution: {integrity: sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + '@vitest/mocker@2.1.9': resolution: {integrity: sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==} peerDependencies: @@ -14470,6 +14565,9 @@ packages: vite: optional: true + '@vitest/pretty-format@2.1.4': + resolution: {integrity: sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==} + '@vitest/pretty-format@2.1.9': resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} @@ -14482,6 +14580,9 @@ packages: '@vitest/runner@1.6.1': resolution: {integrity: sha512-3nSnYXkVkf3mXFfE7vVyPmi3Sazhb/2cfZGGs0JRzFsPFvAMBEcrweV1V1GsrstdXeKCTXlJbvnQwGWgEIHmOA==} + '@vitest/runner@2.1.4': + resolution: {integrity: sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==} + '@vitest/runner@2.1.9': resolution: {integrity: sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==} @@ -14494,6 +14595,9 @@ packages: '@vitest/snapshot@1.6.1': resolution: {integrity: sha512-WvidQuWAzU2p95u8GAKlRMqMyN1yOJkGHnx3M1PL9Raf7AQ1kwLKg04ADlCa3+OXUZE7BceOhVZiuWAbzCKcUQ==} + '@vitest/snapshot@2.1.4': + resolution: {integrity: sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==} + '@vitest/snapshot@2.1.9': resolution: {integrity: sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==} @@ -14506,6 +14610,9 @@ packages: '@vitest/spy@1.6.1': resolution: {integrity: sha512-MGcMmpGkZebsMZhbQKkAf9CX5zGvjkBTqf8Zx3ApYWXr3wG+QvEu2eXWfnIIWYSJExIp4V9FCKDEeygzkYrXMw==} + '@vitest/spy@2.1.4': + resolution: {integrity: sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==} + '@vitest/spy@2.1.9': resolution: {integrity: sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==} @@ -14526,6 +14633,9 @@ packages: '@vitest/utils@1.6.1': resolution: {integrity: sha512-jOrrUvXM4Av9ZWiG1EajNto0u96kWAhJ1LmPmJhXXQx/32MecEKd10pOLYgS2BQx1TgkGhloPU1ArDW2vvaY6g==} + '@vitest/utils@2.1.4': + resolution: {integrity: sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==} + '@vitest/utils@2.1.9': resolution: {integrity: sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==} @@ -19680,6 +19790,9 @@ packages: engines: {node: '>=18'} hasBin: true + hyper-async@1.1.2: + resolution: {integrity: sha512-cnpOgKa+5FZOaccTtjduac1FrZuSc38/ftCp3vYJdUMt+7c+uvGDKLDK4MTNK8D3aFjIeveVrPcSgUPvzZLopg==} + hyperliquid@1.5.8: resolution: {integrity: sha512-y3gJ8Z77UZYlJov234EQXGajTzKhFd+Vp9vL96sIogFeylkObh1ut7/hpznDlEBDgZi3ij0dIf8dYrRZ1DzW2g==} engines: {node: '>=16.0.0'} @@ -22097,6 +22210,9 @@ packages: mnemonist@0.38.5: resolution: {integrity: sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==} + mnemonist@0.39.8: + resolution: {integrity: sha512-vyWo2K3fjrUw8YeeZ1zF0fy6Mu59RHokURlld8ymdUPjMlD9EC9ov1/YPqTgqRvUN9nTr3Gqfz29LYAmu0PHPQ==} + mocha@10.8.2: resolution: {integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==} engines: {node: '>= 14.0.0'} @@ -22843,6 +22959,14 @@ packages: typescript: optional: true + ox@0.6.7: + resolution: {integrity: sha512-17Gk/eFsFRAZ80p5eKqv89a57uXjd3NgIf1CaXojATPBuujVc/fQSVhBeAU9JCRB+k7J50WQAyWTxK19T9GgbA==} + peerDependencies: + typescript: '>=5.4.0' + peerDependenciesMeta: + typescript: + optional: true + ox@0.6.9: resolution: {integrity: sha512-wi5ShvzE4eOcTwQVsIPdFr+8ycyX+5le/96iAJutaZAvCes1J0+RvpEPg5QDPDiaR0XQQAvZVl7AwqQcINuUug==} peerDependencies: @@ -24759,6 +24883,14 @@ packages: resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} engines: {node: '>=4'} + redstone-clara-sdk@0.0.21: + resolution: {integrity: sha512-BU2djdj8d/kH6SOYLpr/159n7bwgTe9/CmxO6AYBs2PjiX89zjsyiP0i+pwpYu01VXeyqR169QPG/hcB1avZQQ==} + engines: {node: '>=20'} + + redstone-clara-sdk@0.0.23: + resolution: {integrity: sha512-1d44YnUyhbJy6/UsNU4if9jwf2/cTrDjOWRdI8nC3sobAGIGENajeF2VPdnApMz9Dc8kaYMC8x6KAvM0zsn+Hg==} + engines: {node: '>=20'} + reflect-metadata@0.1.13: resolution: {integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==} @@ -27543,6 +27675,14 @@ packages: typescript: optional: true + viem@2.23.2: + resolution: {integrity: sha512-NVmW/E0c5crMOtbEAqMF0e3NmvQykFXhLOc/CkLIXOlzHSA6KXVz3CYVmaKqBF8/xtjsjHAGjdJN3Ru1kFJLaA==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + vite-node@1.4.0: resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -27553,6 +27693,11 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-node@2.1.4: + resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + vite-node@2.1.9: resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -27705,6 +27850,31 @@ packages: jsdom: optional: true + vitest@2.1.4: + resolution: {integrity: sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 2.1.4 + '@vitest/ui': 2.1.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vitest@2.1.9: resolution: {integrity: sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -27819,6 +27989,13 @@ packages: walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + warp-arbundles@1.0.4: + resolution: {integrity: sha512-KeRac/EJ7VOK+v5+PSMh2SrzpCKOAFnJICLlqZWt6qPkDCzVwcrNE5wFxOlEk5U170ewMDAB3e86UHUblevXpw==} + + warp-isomorphic@1.0.7: + resolution: {integrity: sha512-fXHbUXwdYqPm9fRPz8mjv5ndPco09aMQuTe4kXfymzOq8V6F3DLsg9cIafxvjms9/mc6eijzkLBJ63yjEENEjA==} + engines: {node: '>=16.8.0'} + wasm-feature-detect@1.8.0: resolution: {integrity: sha512-zksaLKM2fVlnB5jQQDqKXXwYHLQUVH9es+5TOOHwGOVJOCeRBCiPjwSg+3tN2AdTCzjgli4jijCH290kXb/zWQ==} @@ -30765,13 +30942,21 @@ snapshots: bs58: 5.0.0 viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) - '@bigmi/core@0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.7.3))(bs58@5.0.0)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1))': + '@bigmi/core@0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.7.3))(bs58@5.0.0)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@noble/hashes': 1.7.1 bech32: 2.0.0 bitcoinjs-lib: 7.0.0-rc.0(typescript@5.7.3) bs58: 5.0.0 - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + + '@bigmi/core@0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.7.3))(bs58@5.0.0)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1))': + dependencies: + '@noble/hashes': 1.7.1 + bech32: 2.0.0 + bitcoinjs-lib: 7.0.0-rc.0(typescript@5.7.3) + bs58: 5.0.0 + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1) '@binance/connector@3.6.1(bufferutil@4.0.9)(utf-8-validate@6.0.5)': dependencies: @@ -33773,7 +33958,7 @@ snapshots: '@anthropic-ai/sdk': 0.30.1(encoding@0.1.13) '@fal-ai/client': 1.2.0 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.24.1))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) fastembed: 1.14.1 fastestsmallesttextencoderdecoder: 1.0.22 @@ -33826,7 +34011,7 @@ snapshots: '@fal-ai/client': 1.2.0 '@tavily/core': 0.0.2 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.24.1))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) dotenv: 16.4.5 fastembed: 1.14.1 @@ -33884,7 +34069,7 @@ snapshots: '@fal-ai/client': 1.2.0 '@tavily/core': 0.0.2 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.24.1))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) dotenv: 16.4.5 fastembed: 1.14.1 @@ -33942,7 +34127,7 @@ snapshots: '@fal-ai/client': 1.2.0 '@tavily/core': 0.0.2 '@types/uuid': 10.0.0 - ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.24.1))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) + ai: 3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8) anthropic-vertex-ai: 1.0.2(encoding@0.1.13)(zod@3.23.8) dotenv: 16.4.5 fastembed: 1.14.1 @@ -35193,49 +35378,49 @@ snapshots: reflect-metadata: 0.2.2 zod: 3.23.8 - '@goat-sdk/plugin-coingecko@0.1.4(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': + '@goat-sdk/plugin-coingecko@0.1.4(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@goat-sdk/core': 0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) zod: 3.23.8 - '@goat-sdk/plugin-erc20@0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': + '@goat-sdk/plugin-erc20@0.1.7(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@goat-sdk/core': 0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) zod: 3.24.1 - '@goat-sdk/plugin-erc20@0.2.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': + '@goat-sdk/plugin-erc20@0.2.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': dependencies: '@goat-sdk/core': 0.4.6(zod@3.23.8) '@goat-sdk/wallet-evm': 0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) zod: 3.23.8 transitivePeerDependencies: - bufferutil - typescript - utf-8-validate - '@goat-sdk/plugin-kim@0.1.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': + '@goat-sdk/plugin-kim@0.1.2(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': dependencies: '@goat-sdk/core': 0.4.6(zod@3.23.8) '@goat-sdk/wallet-evm': 0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) zod: 3.23.8 transitivePeerDependencies: - bufferutil - typescript - utf-8-validate - '@goat-sdk/plugin-zilliqa@0.1.3(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-zilliqa@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5))(encoding@0.1.13)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': + '@goat-sdk/plugin-zilliqa@0.1.3(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-zilliqa@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5))(encoding@0.1.13)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': dependencies: '@goat-sdk/core': 0.4.6(zod@3.23.8) '@goat-sdk/wallet-evm': 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) - '@goat-sdk/wallet-zilliqa': 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5) + '@goat-sdk/wallet-zilliqa': 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5) '@zilliqa-js/crypto': 3.5.0 '@zilliqa-js/util': 3.5.0 '@zilliqa-js/zilliqa': 3.5.0(encoding@0.1.13) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) zod: 3.23.8 transitivePeerDependencies: - encoding @@ -35263,26 +35448,26 @@ snapshots: - typescript - utf-8-validate - '@goat-sdk/wallet-viem@0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': + '@goat-sdk/wallet-viem@0.1.3(@goat-sdk/core@0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@goat-sdk/core': 0.3.8(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@5.0.10) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) - '@goat-sdk/wallet-viem@0.2.0(@goat-sdk/wallet-evm@0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': + '@goat-sdk/wallet-viem@0.2.0(@goat-sdk/wallet-evm@0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': dependencies: '@goat-sdk/wallet-evm': 0.2.0(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) - '@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': + '@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8))': dependencies: '@goat-sdk/wallet-evm': 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) - '@goat-sdk/wallet-zilliqa@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5)': + '@goat-sdk/wallet-zilliqa@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(@goat-sdk/wallet-viem@0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)))(bufferutil@4.0.9)(encoding@0.1.13)(typescript@5.7.3)(utf-8-validate@6.0.5)': dependencies: '@goat-sdk/core': 0.4.6(zod@3.23.8) '@goat-sdk/wallet-evm': 0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5) - '@goat-sdk/wallet-viem': 0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) + '@goat-sdk/wallet-viem': 0.2.6(@goat-sdk/wallet-evm@0.2.6(@goat-sdk/core@0.4.6(zod@3.23.8))(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5))(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)) '@zilliqa-js/account': 3.5.0(encoding@0.1.13) '@zilliqa-js/zilliqa': 3.5.0(encoding@0.1.13) abitype: 1.0.8(typescript@5.7.3)(zod@3.23.8) @@ -37064,9 +37249,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.9)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.7.3)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': + '@lifi/sdk@3.4.1(@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10)))(@solana/web3.js@1.95.8(bufferutil@4.0.9)(encoding@0.1.13)(utf-8-validate@5.0.10))(typescript@5.7.3)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.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.7.3))(bs58@5.0.0)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) + '@bigmi/core': 0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.7.3))(bs58@5.0.0)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)) '@lifi/types': 16.3.0 '@noble/curves': 1.8.1 '@noble/hashes': 1.7.1 @@ -37075,7 +37260,7 @@ snapshots: bech32: 2.0.0 bitcoinjs-lib: 7.0.0-rc.0(typescript@5.7.3) bs58: 5.0.0 - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) transitivePeerDependencies: - typescript @@ -37093,9 +37278,9 @@ snapshots: transitivePeerDependencies: - typescript - '@lifi/sdk@3.4.1(@solana/wallet-adapter-base@0.9.23)(typescript@5.7.3)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1))': + '@lifi/sdk@3.4.1(@solana/wallet-adapter-base@0.9.23)(typescript@5.7.3)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1))': dependencies: - '@bigmi/core': 0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.7.3))(bs58@5.0.0)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1)) + '@bigmi/core': 0.0.4(bitcoinjs-lib@7.0.0-rc.0(typescript@5.7.3))(bs58@5.0.0)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1)) '@lifi/types': 16.3.0 '@noble/curves': 1.8.1 '@noble/hashes': 1.7.1 @@ -37103,7 +37288,7 @@ snapshots: bech32: 2.0.0 bitcoinjs-lib: 7.0.0-rc.0(typescript@5.7.3) bs58: 5.0.0 - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1) transitivePeerDependencies: - typescript @@ -41322,6 +41507,28 @@ snapshots: tslib: 2.8.1 webcrypto-core: 1.8.1 + '@permaweb/ao-scheduler-utils@0.0.25': + dependencies: + lru-cache: 10.4.3 + ramda: 0.30.1 + zod: 3.24.1 + + '@permaweb/aoconnect@0.0.62': + dependencies: + '@permaweb/ao-scheduler-utils': 0.0.25 + '@permaweb/protocol-tag-utils': 0.0.2 + buffer: 6.0.3 + debug: 4.4.0(supports-color@8.1.1) + hyper-async: 1.1.2 + mnemonist: 0.39.8 + ramda: 0.30.1 + warp-arbundles: 1.0.4 + zod: 3.24.1 + transitivePeerDependencies: + - supports-color + + '@permaweb/protocol-tag-utils@0.0.2': {} + '@phala/dstack-sdk@0.1.7(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1)': optionalDependencies: viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) @@ -43361,7 +43568,7 @@ snapshots: '@sinonjs/text-encoding@0.7.3': {} - '@skip-go/client@0.16.8(@types/react@19.0.8)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(starknet@6.18.0(encoding@0.1.13))(utf-8-validate@5.0.10)(viem@2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': + '@skip-go/client@0.16.8(@types/react@19.0.8)(bufferutil@4.0.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(starknet@6.18.0(encoding@0.1.13))(utf-8-validate@5.0.10)(viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1))': dependencies: '@cosmjs/amino': 0.32.4 '@cosmjs/cosmwasm-stargate': 0.32.4(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -43378,7 +43585,7 @@ snapshots: cosmjs-types: 0.9.0 create-hash: 1.2.0 keccak: 3.0.4 - viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) + viem: 2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1) transitivePeerDependencies: - '@types/react' - bufferutil @@ -45518,6 +45725,36 @@ snapshots: '@starknet-io/types-js@0.7.10': {} + '@story-protocol/core-sdk@1.2.0-rc.3(bufferutil@4.0.9)(typescript@5.6.3)(utf-8-validate@6.0.5)(zod@3.24.1)': + dependencies: + abitype: 0.10.3(typescript@5.6.3)(zod@3.24.1) + axios: 1.7.9 + bs58: 5.0.0 + dotenv: 16.4.7 + multiformats: 9.9.0 + viem: 2.21.58(bufferutil@4.0.9)(typescript@5.6.3)(utf-8-validate@6.0.5)(zod@3.24.1) + transitivePeerDependencies: + - bufferutil + - debug + - typescript + - utf-8-validate + - zod + + '@story-protocol/core-sdk@1.2.0-rc.3(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8)': + dependencies: + abitype: 0.10.3(typescript@5.7.3)(zod@3.23.8) + axios: 1.7.9 + bs58: 5.0.0 + dotenv: 16.4.7 + multiformats: 9.9.0 + viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + transitivePeerDependencies: + - bufferutil + - debug + - typescript + - utf-8-validate + - zod + '@story-protocol/core-sdk@1.2.0-rc.3(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1)': dependencies: abitype: 0.10.3(typescript@5.7.3)(zod@3.24.1) @@ -47404,6 +47641,13 @@ snapshots: '@vitest/utils': 1.6.1 chai: 4.5.0 + '@vitest/expect@2.1.4': + dependencies: + '@vitest/spy': 2.1.4 + '@vitest/utils': 2.1.4 + chai: 5.1.2 + tinyrainbow: 1.2.0 + '@vitest/expect@2.1.9': dependencies: '@vitest/spy': 2.1.9 @@ -47418,6 +47662,14 @@ snapshots: chai: 5.1.2 tinyrainbow: 2.0.0 + '@vitest/mocker@2.1.4(vite@5.4.12(@types/node@22.13.1)(terser@5.38.0))': + dependencies: + '@vitest/spy': 2.1.4 + estree-walker: 3.0.3 + magic-string: 0.30.17 + optionalDependencies: + vite: 5.4.12(@types/node@22.13.1)(terser@5.38.0) + '@vitest/mocker@2.1.9(vite@5.4.12(@types/node@22.13.1)(terser@5.38.0))': dependencies: '@vitest/spy': 2.1.9 @@ -47442,6 +47694,10 @@ snapshots: optionalDependencies: vite: 5.4.12(@types/node@22.13.1)(terser@5.38.0) + '@vitest/pretty-format@2.1.4': + dependencies: + tinyrainbow: 1.2.0 + '@vitest/pretty-format@2.1.9': dependencies: tinyrainbow: 1.2.0 @@ -47462,6 +47718,11 @@ snapshots: p-limit: 5.0.0 pathe: 1.1.2 + '@vitest/runner@2.1.4': + dependencies: + '@vitest/utils': 2.1.4 + pathe: 1.1.2 + '@vitest/runner@2.1.9': dependencies: '@vitest/utils': 2.1.9 @@ -47484,6 +47745,12 @@ snapshots: pathe: 1.1.2 pretty-format: 29.7.0 + '@vitest/snapshot@2.1.4': + dependencies: + '@vitest/pretty-format': 2.1.4 + magic-string: 0.30.17 + pathe: 1.1.2 + '@vitest/snapshot@2.1.9': dependencies: '@vitest/pretty-format': 2.1.9 @@ -47504,6 +47771,10 @@ snapshots: dependencies: tinyspy: 2.2.1 + '@vitest/spy@2.1.4': + dependencies: + tinyspy: 3.0.2 + '@vitest/spy@2.1.9': dependencies: tinyspy: 3.0.2 @@ -47543,6 +47814,12 @@ snapshots: loupe: 2.3.7 pretty-format: 29.7.0 + '@vitest/utils@2.1.4': + dependencies: + '@vitest/pretty-format': 2.1.4 + loupe: 3.1.3 + tinyrainbow: 1.2.0 + '@vitest/utils@2.1.9': dependencies: '@vitest/pretty-format': 2.1.9 @@ -48792,6 +49069,16 @@ snapshots: fs-extra: 10.1.0 yargs: 17.7.2 + abitype@0.10.3(typescript@5.6.3)(zod@3.24.1): + optionalDependencies: + typescript: 5.6.3 + zod: 3.24.1 + + abitype@0.10.3(typescript@5.7.3)(zod@3.23.8): + optionalDependencies: + typescript: 5.7.3 + zod: 3.23.8 + abitype@0.10.3(typescript@5.7.3)(zod@3.24.1): optionalDependencies: typescript: 5.7.3 @@ -48943,7 +49230,7 @@ snapshots: - typescript - utf-8-validate - ai@3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.24.1))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8): + ai@3.4.33(openai@4.73.0(encoding@0.1.13)(zod@3.23.8))(react@19.0.0)(sswr@2.1.0(svelte@5.19.8))(svelte@5.19.8)(vue@3.5.13(typescript@5.7.3))(zod@3.23.8): dependencies: '@ai-sdk/provider': 1.0.6 '@ai-sdk/provider-utils': 2.1.6(zod@3.23.8) @@ -49244,7 +49531,6 @@ snapshots: arconnect@0.4.2: dependencies: arweave: 1.15.5 - optional: true are-docs-informative@0.0.2: {} @@ -49364,7 +49650,6 @@ snapshots: asn1.js: 5.4.1 base64-js: 1.5.1 bignumber.js: 9.1.2 - optional: true ask-sdk-core@2.14.0(ask-sdk-model@1.86.0): dependencies: @@ -55431,6 +55716,8 @@ snapshots: husky@9.1.7: {} + hyper-async@1.1.2: {} + hyperliquid@1.5.8(bufferutil@4.0.9)(utf-8-validate@6.0.5): dependencies: '@msgpack/msgpack': 3.0.0-beta3 @@ -59126,6 +59413,10 @@ snapshots: dependencies: obliterator: 2.0.5 + mnemonist@0.39.8: + dependencies: + obliterator: 2.0.5 + mocha@10.8.2: dependencies: ansi-colors: 4.1.3 @@ -59286,7 +59577,7 @@ snapshots: array-differ: 3.0.0 array-union: 2.1.0 arrify: 2.0.1 - minimatch: 3.0.5 + minimatch: 3.1.2 multistream@4.1.0: dependencies: @@ -60177,11 +60468,11 @@ snapshots: ox@0.4.4(typescript@4.9.5)(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@4.9.5)(zod@3.24.1) + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@4.9.5)(zod@3.24.1) eventemitter3: 5.0.1 optionalDependencies: typescript: 4.9.5 @@ -60191,11 +60482,11 @@ snapshots: ox@0.4.4(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.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.6.3)(zod@3.24.1) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.6.3 @@ -60205,11 +60496,11 @@ snapshots: ox@0.4.4(typescript@5.7.3)(zod@3.23.8): 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.7.3)(zod@3.23.8) + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.23.8) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.7.3 @@ -60219,11 +60510,39 @@ snapshots: ox@0.4.4(typescript@5.7.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.7.3)(zod@3.24.1) + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.24.1) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - zod + + ox@0.6.7(typescript@5.7.3)(zod@3.23.8): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.23.8) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - zod + + ox@0.6.7(typescript@5.7.3)(zod@3.24.1): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.24.1) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.7.3 @@ -62405,6 +62724,27 @@ snapshots: dependencies: redis-errors: 1.2.0 + redstone-clara-sdk@0.0.21: + dependencies: + '@permaweb/aoconnect': 0.0.62 + arweave: 1.15.5 + exponential-backoff: 3.1.1 + transitivePeerDependencies: + - supports-color + + redstone-clara-sdk@0.0.23(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8): + dependencies: + '@permaweb/aoconnect': 0.0.62 + arweave: 1.15.5 + exponential-backoff: 3.1.1 + viem: 2.21.58(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8) + transitivePeerDependencies: + - bufferutil + - supports-color + - typescript + - utf-8-validate + - zod + reflect-metadata@0.1.13: {} reflect-metadata@0.1.14: {} @@ -66054,6 +66394,57 @@ snapshots: - utf-8-validate - zod + viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@5.0.10)(zod@3.24.1): + dependencies: + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.24.1) + isows: 1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + ox: 0.6.7(typescript@5.7.3)(zod@3.24.1) + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.23.8): + dependencies: + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.23.8) + isows: 1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + ox: 0.6.7(typescript@5.7.3)(zod@3.23.8) + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + viem@2.23.2(bufferutil@4.0.9)(typescript@5.7.3)(utf-8-validate@6.0.5)(zod@3.24.1): + dependencies: + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 + '@scure/bip32': 1.6.2 + '@scure/bip39': 1.5.4 + abitype: 1.0.8(typescript@5.7.3)(zod@3.24.1) + isows: 1.0.6(ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)) + ox: 0.6.7(typescript@5.7.3)(zod@3.24.1) + ws: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5) + optionalDependencies: + typescript: 5.7.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + vite-node@1.4.0(@types/node@22.13.1)(terser@5.38.0): dependencies: cac: 6.7.14 @@ -66090,6 +66481,23 @@ snapshots: - supports-color - terser + vite-node@2.1.4(@types/node@22.13.1)(terser@5.38.0): + dependencies: + cac: 6.7.14 + debug: 4.4.0(supports-color@8.1.1) + pathe: 1.1.2 + vite: 5.4.12(@types/node@22.13.1)(terser@5.38.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vite-node@2.1.9(@types/node@20.17.9)(terser@5.38.0): dependencies: cac: 6.7.14 @@ -66377,6 +66785,42 @@ snapshots: - supports-color - terser + vitest@2.1.4(@types/node@22.13.1)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5))(terser@5.38.0): + dependencies: + '@vitest/expect': 2.1.4 + '@vitest/mocker': 2.1.4(vite@5.4.12(@types/node@22.13.1)(terser@5.38.0)) + '@vitest/pretty-format': 2.1.9 + '@vitest/runner': 2.1.4 + '@vitest/snapshot': 2.1.4 + '@vitest/spy': 2.1.4 + '@vitest/utils': 2.1.4 + chai: 5.1.2 + debug: 4.4.0(supports-color@8.1.1) + expect-type: 1.1.0 + magic-string: 0.30.17 + pathe: 1.1.2 + std-env: 3.8.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinypool: 1.0.2 + tinyrainbow: 1.2.0 + vite: 5.4.12(@types/node@22.13.1)(terser@5.38.0) + vite-node: 2.1.4(@types/node@22.13.1)(terser@5.38.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 22.13.1 + jsdom: 25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@6.0.5) + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vitest@2.1.9(@types/node@20.17.9)(jsdom@25.0.1(bufferutil@4.0.9)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.38.0): dependencies: '@vitest/expect': 2.1.9 @@ -66885,6 +67329,18 @@ snapshots: dependencies: makeerror: 1.0.12 + warp-arbundles@1.0.4: + dependencies: + arweave: 1.15.5 + base64url: 3.0.1 + buffer: 6.0.3 + warp-isomorphic: 1.0.7 + + warp-isomorphic@1.0.7: + dependencies: + buffer: 6.0.3 + undici: 5.28.5 + wasm-feature-detect@1.8.0: {} watchpack@2.4.2: @@ -67358,8 +67814,8 @@ snapshots: webauthn-p256@0.0.10: dependencies: - '@noble/curves': 1.7.0 - '@noble/hashes': 1.6.1 + '@noble/curves': 1.8.1 + '@noble/hashes': 1.7.1 webcrypto-core@1.8.1: dependencies: diff --git a/scripts/clara/setupClaraProfile.mjs b/scripts/clara/ao/setupClaraProfile.mjs similarity index 100% rename from scripts/clara/setupClaraProfile.mjs rename to scripts/clara/ao/setupClaraProfile.mjs diff --git a/scripts/clara/transfer.mjs b/scripts/clara/ao/transfer.mjs similarity index 100% rename from scripts/clara/transfer.mjs rename to scripts/clara/ao/transfer.mjs diff --git a/scripts/clara/withdraw.mjs b/scripts/clara/ao/withdraw.mjs similarity index 100% rename from scripts/clara/withdraw.mjs rename to scripts/clara/ao/withdraw.mjs diff --git a/scripts/clara/story/generateWallet.mjs b/scripts/clara/story/generateWallet.mjs new file mode 100644 index 00000000000..35bea84ac64 --- /dev/null +++ b/scripts/clara/story/generateWallet.mjs @@ -0,0 +1,27 @@ +import fs from "node:fs"; +import { ClaraMarketStory } from "redstone-clara-sdk"; + +const DEFAULT_CLARA_STORY_CONTRACT_ID = getEnv("STORY_MARKET_ID"); + +function updateEnv(key, value) { + const file = fs.readFileSync(".env", "utf8"); + const newFile = file.replace( + new RegExp(`^${key}=.*$`, "m"), + `${key}='${value}'` + ); + fs.writeFileSync(".env", newFile); +} + +export const agentId = "amanda"; +console.log(`-- Start setting up `, agentId); + +const market = new ClaraMarketStory(DEFAULT_CLARA_STORY_CONTRACT_ID); +const { wallet, address: account } = await market.generateWallet(); +console.log(`-- Generated wallet`, account.address); + +// Update env with STORY_WALLET +updateEnv("STORY_WALLET", wallet); +updateEnv("STORY_USERNAME", agentId); +updateEnv("STORY_WALLET_ID", account.address); +updateEnv("STORY_MARKET_ID", DEFAULT_CLARA_STORY_CONTRACT_ID); +console.log(`-- env updated`); diff --git a/scripts/clara/story/registerAgent.mjs b/scripts/clara/story/registerAgent.mjs new file mode 100644 index 00000000000..63c8abfff1e --- /dev/null +++ b/scripts/clara/story/registerAgent.mjs @@ -0,0 +1,17 @@ +import { ClaraMarketStory } from "redstone-clara-sdk"; +import { getFromEnv } from "../utils.js"; +import { parseEther } from "viem"; + +const contractId = getFromEnv("STORY_MARKET_ID"); + +const market = new ClaraMarketStory(contractId); +const profile = await market.registerAgent( + getFromEnv("STORY_REQUESTING_AGENT_WALLET"), + { + metadata: { description: "ASIA_AGENTKA" }, + topic: "chat", + fee: parseEther("0.00000000001"), + agentId: "ASIA_AGENTKA", + } +); +console.dir(profile, { depth: null }); diff --git a/scripts/clara/story/registerTask.mjs b/scripts/clara/story/registerTask.mjs new file mode 100644 index 00000000000..5bb191f0585 --- /dev/null +++ b/scripts/clara/story/registerTask.mjs @@ -0,0 +1,17 @@ +import { ClaraProfileStory } from "redstone-clara-sdk"; +import { parseEther } from "viem"; +import { getFromEnv } from "../utils.js"; + +const profile = new ClaraProfileStory( + getFromEnv("STORY_REQUESTING_AGENT_WALLET"), + getFromEnv("STORY_MARKET_ID") +); + +const result = await profile.registerTask({ + topic: "tweet", + reward: parseEther("0.00000000001"), + matchingStrategy: "cheapest", + payload: "post tweet about moon", +}); + +console.dir(result, { depth: null }); diff --git a/scripts/clara/story/transfer.mjs b/scripts/clara/story/transfer.mjs new file mode 100644 index 00000000000..0d40092e445 --- /dev/null +++ b/scripts/clara/story/transfer.mjs @@ -0,0 +1,35 @@ +import { createWalletClient, defineChain, http, parseEther } from "viem"; +import { privateKeyToAccount } from "viem/accounts"; +const privateKey = ""; +const account = privateKeyToAccount(privateKey); + +const walletClient = createWalletClient({ + account, + chain: defineChain({ + id: 1315, + name: "Story Aeneid", + nativeCurrency: { + decimals: 18, + name: "IP", + symbol: "IP", + }, + rpcUrls: { + default: { http: ["https://aeneid.storyrpc.io"] }, + }, + blockExplorers: { + default: { + name: "Story Aeneid Explorer", + url: "https://aeneid.storyscan.xyz", + }, + }, + testnet: true, + }), + transport: http(), +}); + +const hash = await walletClient.sendTransaction({ + to: "0x5ae9F3C035131A8D83851b7272DD628FeD72eB5c", + value: parseEther("1"), +}); + +console.log(`hash`, hash); diff --git a/scripts/clara/utils.js b/scripts/clara/utils.js new file mode 100644 index 00000000000..0c91079173b --- /dev/null +++ b/scripts/clara/utils.js @@ -0,0 +1,11 @@ +import fs from "fs"; + +export function getFromEnv(key) { + const fileContent = fs.readFileSync(".env", "utf8"); + const regex = new RegExp(`^${key}=(.*)$`, "m"); + const match = fileContent.match(regex); + if (match) { + return match[1].replaceAll("'", ""); + } + return null; +}