diff --git a/agent/package.json b/agent/package.json index a0a5192ec5..9c91dda971 100644 --- a/agent/package.json +++ b/agent/package.json @@ -22,6 +22,7 @@ "@elizaos/adapter-redis": "workspace:*", "@elizaos/adapter-sqlite": "workspace:*", "@elizaos/client-auto": "workspace:*", + "@elizaos/client-common": "workspace:*", "@elizaos/client-direct": "workspace:*", "@elizaos/client-discord": "workspace:*", "@elizaos/client-farcaster": "workspace:*", diff --git a/packages/client-common/src/index.ts b/packages/client-common/src/index.ts index 4aa842a6a8..65bc1057c7 100644 --- a/packages/client-common/src/index.ts +++ b/packages/client-common/src/index.ts @@ -1,7 +1,7 @@ import { Character, elizaLogger, IAgentRuntime, Client } from "@elizaos/core"; import { validateCommonConfig } from "./environment.ts"; import express, { Request, Response, NextFunction } from "express"; -import { CommonApiClient } from "@commonxyz/api-client"; +import {CommonApiClient, CommonApiEnvironment} from "@commonxyz/api-client"; import { z } from "zod"; import type { Server } from "http"; import {AgentMentionedSchema, AugmentedAgentMentionedSchema, CommonEnvSchema} from "./schemas.ts"; @@ -28,6 +28,7 @@ export class CommonClient { this.config = validateCommonConfig(this.runtime); this.commonApiClient = new CommonApiClient({ + environment: this.config.COMMON_API_URL || CommonApiEnvironment.Default, apiKey: this.config.COMMON_API_KEY, address: this.config.COMMON_WALLET_ADDRESS, }); @@ -40,7 +41,7 @@ export class CommonClient { // TODO: fetch user once Common Api Client is published with the new route // const user = await this.commonApiClient.User.getUser(); - const user = { id: 121273, profile: { name: "temp" } }; + const user = { id: 161400, profile: { name: "Eliza Dev 1" } }; this.commonUserId = user.id; this.messageManager = new MessageManager(this.commonApiClient, this.runtime, this.commonUserId); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1fdcb77c86..6a16ea83cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,6 +111,9 @@ importers: '@elizaos/client-auto': specifier: workspace:* version: link:../packages/client-auto + '@elizaos/client-common': + specifier: workspace:* + version: link:../packages/client-common '@elizaos/client-direct': specifier: workspace:* version: link:../packages/client-direct