Skip to content

Commit acef89a

Browse files
authored
Merge branch 'develop' into develop
2 parents c2cb6e3 + b3b6ebb commit acef89a

Some content is hidden

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

59 files changed

+4458
-6065
lines changed

.env.example

+9
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ TOGETHER_API_KEY= # Together API Key
257257
#### Crypto Plugin Configurations ####
258258
######################################
259259

260+
# CoinMarketCap / CMC
261+
COINMARKETCAP_API_KEY=
262+
263+
# CoinGecko
264+
COINGECKO_API_KEY=
265+
COINGECKO_PRO_API_KEY=
266+
260267
# EVM
261268
EVM_PRIVATE_KEY=
262269
EVM_PROVIDER_URL=
@@ -434,6 +441,8 @@ GIPHY_API_KEY=
434441
# OpenWeather
435442
OPEN_WEATHER_API_KEY= # OpenWeather API key
436443

444+
445+
437446
# EchoChambers Configuration
438447
ECHOCHAMBERS_API_URL=http://127.0.0.1:3333
439448
ECHOCHAMBERS_API_KEY=testingkey0011

.github/workflows/pnpm-lockfile-check.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Pnpm Lockfile Check
22

33
on:
44
pull_request:
5-
branches: ["*"]
5+
branches: [main]
66

77
jobs:
88
check-lockfile:
@@ -38,4 +38,4 @@ jobs:
3838
owner: context.repo.owner,
3939
repo: context.repo.repo,
4040
body: '❌ The pnpm-lockfile is out of date. Please run `pnpm install --no-frozen-lockfile` and commit the updated pnpm-lock.yaml file.'
41-
})
41+
})

agent/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@
3434
"@elizaos/plugin-0g": "workspace:*",
3535
"@elizaos/plugin-abstract": "workspace:*",
3636
"@elizaos/plugin-aptos": "workspace:*",
37+
"@elizaos/plugin-coingecko": "workspace:*",
3738
"@elizaos/plugin-coinmarketcap": "workspace:*",
39+
"@elizaos/plugin-coingecko": "workspace:*",
3840
"@elizaos/plugin-binance": "workspace:*",
3941
"@elizaos/plugin-avail": "workspace:*",
4042
"@elizaos/plugin-bootstrap": "workspace:*",
4143
"@elizaos/plugin-cosmos": "workspace:*",
4244
"@elizaos/plugin-intiface": "workspace:*",
4345
"@elizaos/plugin-coinbase": "workspace:*",
44-
"@elizaos/plugin-coinprice": "workspace:*",
4546
"@elizaos/plugin-conflux": "workspace:*",
4647
"@elizaos/plugin-evm": "workspace:*",
4748
"@elizaos/plugin-echochambers": "workspace:*",
@@ -73,6 +74,7 @@
7374
"@elizaos/plugin-3d-generation": "workspace:*",
7475
"@elizaos/plugin-fuel": "workspace:*",
7576
"@elizaos/plugin-avalanche": "workspace:*",
77+
"@elizaos/plugin-video-generation": "workspace:*",
7678
"@elizaos/plugin-web-search": "workspace:*",
7779
"@elizaos/plugin-letzai": "workspace:*",
7880
"@elizaos/plugin-thirdweb": "workspace:*",
@@ -94,4 +96,4 @@
9496
"ts-node": "10.9.2",
9597
"tsup": "8.3.5"
9698
}
97-
}
99+
}

agent/src/index.ts

+47-22
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import {
5353
webhookPlugin,
5454
} from "@elizaos/plugin-coinbase";
5555
import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap";
56-
import { coinPricePlugin } from "@elizaos/plugin-coinprice";
56+
import { coingeckoPlugin } from "@elizaos/plugin-coingecko";
5757
import { confluxPlugin } from "@elizaos/plugin-conflux";
5858
import { createCosmosPlugin } from "@elizaos/plugin-cosmos";
5959
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm";
@@ -68,17 +68,18 @@ import { nearPlugin } from "@elizaos/plugin-near";
6868
import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
6969
import { createNodePlugin } from "@elizaos/plugin-node";
7070
import { obsidianPlugin } from "@elizaos/plugin-obsidian";
71+
import { sgxPlugin } from "@elizaos/plugin-sgx";
7172
import { solanaPlugin } from "@elizaos/plugin-solana";
7273
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit";
7374
import { storyPlugin } from "@elizaos/plugin-story";
7475
import { suiPlugin } from "@elizaos/plugin-sui";
75-
import { sgxPlugin } from "@elizaos/plugin-sgx";
7676
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
7777
import { teeLogPlugin } from "@elizaos/plugin-tee-log";
7878
import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin";
7979
import { tonPlugin } from "@elizaos/plugin-ton";
8080
import { webSearchPlugin } from "@elizaos/plugin-web-search";
8181

82+
import { coingeckoPlugin } from "@elizaos/plugin-coingecko";
8283
import { giphyPlugin } from "@elizaos/plugin-giphy";
8384
import { letzAIPlugin } from "@elizaos/plugin-letzai";
8485
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
@@ -141,10 +142,6 @@ function tryLoadFile(filePath: string): string | null {
141142
}
142143
}
143144

144-
function isAllStrings(arr: unknown[]): boolean {
145-
return Array.isArray(arr) && arr.every((item) => typeof item === "string");
146-
}
147-
148145
export async function loadCharacters(
149146
charactersArg: string
150147
): Promise<Character[]> {
@@ -230,16 +227,9 @@ export async function loadCharacters(
230227
}
231228

232229
// Handle plugins
233-
if (isAllStrings(character.plugins)) {
234-
elizaLogger.info("Plugins are: ", character.plugins);
235-
const importedPlugins = await Promise.all(
236-
character.plugins.map(async (plugin) => {
237-
const importedPlugin = await import(plugin);
238-
return importedPlugin.default;
239-
})
240-
);
241-
character.plugins = importedPlugins;
242-
}
230+
character.plugins = await handlePluginImporting(
231+
character.plugins
232+
);
243233

244234
loadedCharacters.push(character);
245235
elizaLogger.info(
@@ -262,6 +252,36 @@ export async function loadCharacters(
262252
return loadedCharacters;
263253
}
264254

255+
async function handlePluginImporting(plugins: string[]) {
256+
if (plugins.length > 0) {
257+
elizaLogger.info("Plugins are: ", plugins);
258+
const importedPlugins = await Promise.all(
259+
plugins.map(async (plugin) => {
260+
try {
261+
const importedPlugin = await import(plugin);
262+
const functionName =
263+
plugin
264+
.replace("@elizaos/plugin-", "")
265+
.replace(/-./g, (x) => x[1].toUpperCase()) +
266+
"Plugin"; // Assumes plugin function is camelCased with Plugin suffix
267+
return (
268+
importedPlugin.default || importedPlugin[functionName]
269+
);
270+
} catch (importError) {
271+
elizaLogger.error(
272+
`Failed to import plugin: ${plugin}`,
273+
importError
274+
);
275+
return []; // Return null for failed imports
276+
}
277+
})
278+
);
279+
return importedPlugins;
280+
} else {
281+
return [];
282+
}
283+
}
284+
265285
export function getTokenForProvider(
266286
provider: ModelProviderName,
267287
character: Character
@@ -608,7 +628,6 @@ export async function createAgent(
608628
? confluxPlugin
609629
: null,
610630
nodePlugin,
611-
coinPricePlugin,
612631
getSecret(character, "TAVILY_API_KEY") ? webSearchPlugin : null,
613632
getSecret(character, "SOLANA_PUBLIC_KEY") ||
614633
(getSecret(character, "WALLET_PUBLIC_KEY") &&
@@ -668,9 +687,9 @@ export async function createAgent(
668687
: []),
669688
...(teeMode !== TEEMode.OFF && walletSecretSalt ? [teePlugin] : []),
670689
getSecret(character, "SGX") ? sgxPlugin : null,
671-
(getSecret(character, "ENABLE_TEE_LOG") &&
672-
((teeMode !== TEEMode.OFF && walletSecretSalt) ||
673-
getSecret(character, "SGX")))
690+
getSecret(character, "ENABLE_TEE_LOG") &&
691+
((teeMode !== TEEMode.OFF && walletSecretSalt) ||
692+
getSecret(character, "SGX"))
674693
? teeLogPlugin
675694
: null,
676695
getSecret(character, "COINBASE_API_KEY") &&
@@ -679,7 +698,10 @@ export async function createAgent(
679698
? webhookPlugin
680699
: null,
681700
goatPlugin,
682-
getSecret(character, "COINGECKO_API_KEY") ? coingeckoPlugin : null,
701+
getSecret(character, "COINGECKO_API_KEY") ||
702+
getSecret(character, "COINGECKO_PRO_API_KEY")
703+
? coingeckoPlugin
704+
: null,
683705
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
684706
getSecret(character, "ABSTRACT_PRIVATE_KEY")
685707
? abstractPlugin
@@ -918,7 +940,10 @@ const startAgents = async () => {
918940
}
919941

920942
// upload some agent functionality into directClient
921-
directClient.startAgent = async (character: Character) => {
943+
directClient.startAgent = async (character) => {
944+
// Handle plugins
945+
character.plugins = await handlePluginImporting(character.plugins);
946+
922947
// wrap it so we don't have to inject directClient later
923948
return startAgent(character, directClient);
924949
};

packages/client-telegram/src/messageManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export class MessageManager {
507507

508508
// Check if team member has direct interest first
509509
if (
510-
this.runtime.character.clientConfig?.discord?.isPartOfTeam &&
510+
this.runtime.character.clientConfig?.telegram?.isPartOfTeam &&
511511
!this._isTeamLeader() &&
512512
this._isRelevantToTeamMember(messageText, chatId)
513513
) {

packages/client-twitter/src/plugins/SttTtsSpacesPlugin.ts

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ interface PluginConfig {
2828
* - On speaker mute -> flush STT -> GPT -> TTS -> push to Janus
2929
*/
3030
export class SttTtsPlugin implements Plugin {
31+
name = "SttTtsPlugin";
32+
description = "Speech-to-text (OpenAI) + conversation + TTS (ElevenLabs)";
33+
3134
private space?: Space;
3235
private janus?: JanusClient;
3336

0 commit comments

Comments
 (0)