Skip to content

Commit 47b9251

Browse files
authored
Merge branch 'develop' into develop
2 parents f6c7202 + 024cc73 commit 47b9251

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3642
-949
lines changed

.env.example

+20-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ TWITTER_TARGET_USERS= # Comma separated list of Twitter user names to
8888
TWITTER_RETRY_LIMIT= # Maximum retry attempts for Twitter login
8989
TWITTER_SPACES_ENABLE=false # Enable or disable Twitter Spaces logic
9090

91+
# CONFIGURATION FOR APPROVING TWEETS BEFORE IT GETS POSTED
92+
TWITTER_APPROVAL_DISCORD_CHANNEL_ID= # Channel ID for the Discord bot to listen and send approval messages
93+
TWITTER_APPROVAL_DISCORD_BOT_TOKEN= # Discord bot token (this could be a different bot token from DISCORD_API_TOKEN)
94+
TWITTER_APPROVAL_ENABLED= # Enable or disable Twitter approval logic #Default is false
95+
TWITTER_APPROVAL_CHECK_INTERVAL=60000 # Default: 60 seconds
96+
9197
# Post Interval Settings (in minutes)
9298
POST_INTERVAL_MIN= # Default: 90
9399
POST_INTERVAL_MAX= # Default: 180
@@ -357,7 +363,7 @@ MVX_NETWORK= # must be one of mainnet, devnet, testnet
357363
NEAR_WALLET_SECRET_KEY=
358364
NEAR_WALLET_PUBLIC_KEY=
359365
NEAR_ADDRESS=
360-
SLIPPAGE=1
366+
NEAR_SLIPPAGE=1
361367
NEAR_RPC_URL=https://rpc.testnet.near.org
362368
NEAR_NETWORK=testnet # or mainnet
363369

@@ -422,6 +428,9 @@ SPHERON_WALLET_ADDRESS=
422428
# Stargaze NFT marketplace from Cosmos (You can use https://graphql.mainnet.stargaze-apis.com/graphql)
423429
STARGAZE_ENDPOINT=
424430

431+
# API key for giphy from https://developers.giphy.com/dashboard/
432+
GIPHY_API_KEY=
433+
425434
# GenLayer
426435
GENLAYER_PRIVATE_KEY= # Private key of the GenLayer account to use for the agent in this format (0x0000000000000000000000000000000000000000000000000000000000000000)
427436

@@ -430,4 +439,13 @@ OPEN_WEATHER_API_KEY= # OpenWeather API key
430439

431440
# Allora
432441
ALLORA_API_KEY= # Allora API key, format: UP-f8db7d6558ab432ca0d92716
433-
ALLORA_CHAIN_SLUG= # must be one of mainnet, testnet. If not specified, it will use testnet by default
442+
ALLORA_CHAIN_SLUG= # must be one of mainnet, testnet. If not specified, it will use testnet by default
443+
444+
# Opacity zkTLS
445+
OPACITY_TEAM_ID=f309ac8ae8a9a14a7e62cd1a521b1c5f
446+
OPACITY_CLOUDFLARE_NAME=eigen-test
447+
OPACITY_PROVER_URL=https://opacity-ai-zktls-demo.vercel.app
448+
449+
# Verifiable Inference Configuration
450+
VERIFIABLE_INFERENCE_ENABLED=false # Set to false to disable verifiable inference
451+
VERIFIABLE_INFERENCE_PROVIDER=opacity # Options: opacity

agent/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"@elizaos/plugin-solana-agentkit": "workspace:*",
5858
"@elizaos/plugin-starknet": "workspace:*",
5959
"@elizaos/plugin-stargaze": "workspace:*",
60+
"@elizaos/plugin-giphy": "workspace:*",
6061
"@elizaos/plugin-ton": "workspace:*",
6162
"@elizaos/plugin-sui": "workspace:*",
6263
"@elizaos/plugin-tee": "workspace:*",
@@ -72,10 +73,12 @@
7273
"@elizaos/plugin-web-search": "workspace:*",
7374
"@elizaos/plugin-thirdweb": "workspace:*",
7475
"@elizaos/plugin-genlayer": "workspace:*",
76+
"@elizaos/plugin-depin": "workspace:*",
7577
"@elizaos/plugin-open-weather": "workspace:*",
7678
"@elizaos/plugin-obsidian": "workspace:*",
7779
"@elizaos/plugin-arthera": "workspace:*",
7880
"@elizaos/plugin-allora": "workspace:*",
81+
"@elizaos/plugin-opacity": "workspace:*",
7982
"readline": "1.3.0",
8083
"ws": "8.18.0",
8184
"yargs": "17.7.2"

agent/src/index.ts

+26-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
7171
import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin";
7272
import { tonPlugin } from "@elizaos/plugin-ton";
7373
import { webSearchPlugin } from "@elizaos/plugin-web-search";
74+
import { giphyPlugin } from "@elizaos/plugin-giphy";
7475
import { echoChamberPlugin } from "@elizaos/plugin-echochambers";
7576
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
7677
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
@@ -85,6 +86,7 @@ import net from "net";
8586
import path from "path";
8687
import { fileURLToPath } from "url";
8788
import yargs from "yargs";
89+
import { OpacityAdapter } from "@elizaos/plugin-opacity";
8890

8991
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
9092
const __dirname = path.dirname(__filename); // get the name of the directory
@@ -553,6 +555,28 @@ export async function createAgent(
553555
// });
554556
// elizaLogger.log("Verifiable inference adapter initialized");
555557
// }
558+
// Initialize Opacity adapter if environment variables are present
559+
let verifiableInferenceAdapter;
560+
if (
561+
process.env.OPACITY_TEAM_ID &&
562+
process.env.OPACITY_CLOUDFLARE_NAME &&
563+
process.env.OPACITY_PROVER_URL &&
564+
process.env.VERIFIABLE_INFERENCE_ENABLED === "true"
565+
) {
566+
verifiableInferenceAdapter = new OpacityAdapter({
567+
teamId: process.env.OPACITY_TEAM_ID,
568+
teamName: process.env.OPACITY_CLOUDFLARE_NAME,
569+
opacityProverUrl: process.env.OPACITY_PROVER_URL,
570+
modelProvider: character.modelProvider,
571+
token: token,
572+
});
573+
elizaLogger.log("Verifiable inference adapter initialized");
574+
elizaLogger.log("teamId", process.env.OPACITY_TEAM_ID);
575+
elizaLogger.log("teamName", process.env.OPACITY_CLOUDFLARE_NAME);
576+
elizaLogger.log("opacityProverUrl", process.env.OPACITY_PROVER_URL);
577+
elizaLogger.log("modelProvider", character.modelProvider);
578+
elizaLogger.log("token", token);
579+
}
556580

557581
return new AgentRuntime({
558582
databaseAdapter: db,
@@ -659,6 +683,7 @@ export async function createAgent(
659683
? echoChambersPlugin
660684
: null,
661685
getSecret(character, "STARGAZE_ENDPOINT") ? stargazePlugin : null,
686+
getSecret(character, "GIPHY_API_KEY") ? giphyPlugin : null,
662687
getSecret(character, "GENLAYER_PRIVATE_KEY")
663688
? genLayerPlugin
664689
: null,
@@ -681,7 +706,7 @@ export async function createAgent(
681706
managers: [],
682707
cacheManager: cache,
683708
fetch: logFetch,
684-
// verifiableInferenceAdapter,
709+
verifiableInferenceAdapter,
685710
});
686711
}
687712

packages/adapter-postgres/schema.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ BEGIN
148148
"originalId" UUID REFERENCES knowledge("id"),
149149
"chunkIndex" INTEGER,
150150
"isShared" BOOLEAN DEFAULT FALSE,
151-
CHECK((isShared = true AND "agentId" IS NULL) OR (isShared = false AND "agentId" IS NOT NULL))
151+
CHECK(("isShared" = true AND "agentId" IS NULL) OR ("isShared" = false AND "agentId" IS NOT NULL))
152152
)', vector_dim);
153153
END $$;
154154

packages/client-telegram/src/messageManager.ts

+41-2
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,11 @@ export class MessageManager {
678678
): Promise<Message.TextMessage[]> {
679679
if (content.attachments && content.attachments.length > 0) {
680680
content.attachments.map(async (attachment: Media) => {
681-
if (attachment.contentType.startsWith("image")) {
682-
this.sendImage(ctx, attachment.url, attachment.description);
681+
if (attachment.contentType === "image/gif") {
682+
// Handle GIFs specifically
683+
await this.sendAnimation(ctx, attachment.url, attachment.description);
684+
} else if (attachment.contentType.startsWith("image")) {
685+
await this.sendImage(ctx, attachment.url, attachment.description);
683686
}
684687
});
685688
} else {
@@ -743,6 +746,42 @@ export class MessageManager {
743746
}
744747
}
745748

749+
private async sendAnimation(
750+
ctx: Context,
751+
animationPath: string,
752+
caption?: string
753+
): Promise<void> {
754+
try {
755+
if (/^(http|https):\/\//.test(animationPath)) {
756+
// Handle HTTP URLs
757+
await ctx.telegram.sendAnimation(ctx.chat.id, animationPath, {
758+
caption,
759+
});
760+
} else {
761+
// Handle local file paths
762+
if (!fs.existsSync(animationPath)) {
763+
throw new Error(`File not found: ${animationPath}`);
764+
}
765+
766+
const fileStream = fs.createReadStream(animationPath);
767+
768+
await ctx.telegram.sendAnimation(
769+
ctx.chat.id,
770+
{
771+
source: fileStream,
772+
},
773+
{
774+
caption,
775+
}
776+
);
777+
}
778+
779+
elizaLogger.info(`Animation sent successfully: ${animationPath}`);
780+
} catch (error) {
781+
elizaLogger.error("Error sending animation:", error);
782+
}
783+
}
784+
746785
// Split message into smaller parts
747786
private splitMessage(text: string): string[] {
748787
const chunks: string[] = [];

packages/client-twitter/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"@elizaos/core": "workspace:*",
2323
"agent-twitter-client": "0.0.18",
2424
"glob": "11.0.0",
25-
"zod": "3.23.8"
25+
"zod": "3.23.8",
26+
"discord.js": "14.16.3"
2627
},
2728
"devDependencies": {
2829
"tsup": "8.3.5",

0 commit comments

Comments
 (0)