Skip to content

Commit a50c24f

Browse files
committed
Merge remote-tracking branch 'origin/develop' into mistral-text-generation
2 parents 5d07f28 + c9d4411 commit a50c24f

File tree

119 files changed

+12709
-4998
lines changed

Some content is hidden

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

119 files changed

+12709
-4998
lines changed

.env.example

+60-1
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,12 @@ TOGETHER_API_KEY= # Together API Key
263263
#### Crypto Plugin Configurations ####
264264
######################################
265265

266-
# COIN DATA SOURCES
266+
# CoinMarketCap / CMC
267267
COINMARKETCAP_API_KEY=
268+
269+
# CoinGecko
268270
COINGECKO_API_KEY=
271+
COINGECKO_PRO_API_KEY=
269272

270273
# EVM
271274
EVM_PRIVATE_KEY=
@@ -309,6 +312,10 @@ STARKNET_ADDRESS=
309312
STARKNET_PRIVATE_KEY=
310313
STARKNET_RPC_URL=
311314

315+
# Lens Network Configuration
316+
LENS_ADDRESS=
317+
LENS_PRIVATE_KEY=
318+
312319
# Coinbase
313320
COINBASE_COMMERCE_KEY= # From Coinbase developer portal
314321
COINBASE_API_KEY= # From Coinbase developer portal
@@ -444,6 +451,8 @@ GIPHY_API_KEY=
444451
# OpenWeather
445452
OPEN_WEATHER_API_KEY= # OpenWeather API key
446453

454+
455+
447456
# EchoChambers Configuration
448457
ECHOCHAMBERS_API_URL=http://127.0.0.1:3333
449458
ECHOCHAMBERS_API_KEY=testingkey0011
@@ -477,3 +486,53 @@ TAVILY_API_KEY=
477486
# Verifiable Inference Configuration
478487
VERIFIABLE_INFERENCE_ENABLED=false # Set to false to disable verifiable inference
479488
VERIFIABLE_INFERENCE_PROVIDER=opacity # Options: opacity
489+
490+
491+
# Autonome Configuration
492+
AUTONOME_JWT_TOKEN=
493+
AUTONOME_RPC=https://wizard-bff-rpc.alt.technology/v1/bff/aaa/apps
494+
495+
####################################
496+
#### Akash Network Configuration ####
497+
####################################
498+
AKASH_ENV=mainnet
499+
AKASH_NET=https://raw.githubusercontent.com/ovrclk/net/master/mainnet
500+
RPC_ENDPOINT=https://rpc.akashnet.net:443
501+
AKASH_GAS_PRICES=0.025uakt
502+
AKASH_GAS_ADJUSTMENT=1.5
503+
AKASH_KEYRING_BACKEND=os
504+
AKASH_FROM=default
505+
AKASH_FEES=20000uakt
506+
AKASH_DEPOSIT=500000uakt
507+
AKASH_MNEMONIC=
508+
AKASH_WALLET_ADDRESS=
509+
# Akash Pricing API
510+
AKASH_PRICING_API_URL=https://console-api.akash.network/v1/pricing
511+
# Default values # 1 CPU = 1000 1GB = 1000000000 1GB = 1000000000
512+
AKASH_DEFAULT_CPU=1000
513+
AKASH_DEFAULT_MEMORY=1000000000
514+
AKASH_DEFAULT_STORAGE=1000000000
515+
AKASH_SDL=example.sdl.yml
516+
# Close deployment
517+
# Close all deployments = closeAll
518+
# Close a single deployment = dseq and add the value in AKASH_CLOSE_DSEQ
519+
AKASH_CLOSE_DEP=closeAll
520+
AKASH_CLOSE_DSEQ=19729929
521+
# Provider Info we added one to check you will have to pass this into the action
522+
AKASH_PROVIDER_INFO=akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz
523+
# Deployment Status
524+
# AKASH_DEP_STATUS = dseq or param_passed when you are building you wil pass the dseq dinamically to test you
525+
# you can pass the dseq using AKASH_DEP_DSEQ 19729929 is an example of a dseq we test while build.
526+
AKASH_DEP_STATUS=dseq
527+
AKASH_DEP_DSEQ=19729929
528+
# Gas Estimation Options: close, create, or update
529+
# qseq is required when operation is "close" 19729929 is an example of a dseq we test while build.
530+
AKASH_GAS_OPERATION=close
531+
AKASH_GAS_DSEQ=19729929
532+
# Manifest
533+
# Values: "auto" | "manual" | "validate_only" Default: "auto"
534+
AKASH_MANIFEST_MODE=auto
535+
# Default: Will use the SDL directory
536+
AKASH_MANIFEST_PATH=
537+
# Values: "strict" | "lenient" | "none" - Default: "strict"
538+
AKASH_MANIFEST_VALIDATION_LEVEL=strict

.github/workflows/integrationTests.yaml

+6-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- "*"
6-
pull_request_target:
6+
pull_request:
77
branches:
88
- "*"
99

@@ -33,12 +33,9 @@ jobs:
3333
- name: Build packages
3434
run: pnpm build
3535

36-
- name: Check for API key
37-
run: |
38-
if [ -z "$OPENAI_API_KEY" ]; then
39-
echo "Error: OPENAI_API_KEY is not set."
40-
exit 1
41-
fi
42-
4336
- name: Run integration tests
44-
run: pnpm run integrationTests
37+
env:
38+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
39+
COINBASE_COMMERCE_KEY: ${{ secrets.COINBASE_COMMERCE_KEY }}
40+
run: |
41+
pnpm run integrationTests

.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

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
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:*",
3839
"@elizaos/plugin-coingecko": "workspace:*",
3940
"@elizaos/plugin-binance": "workspace:*",
@@ -49,13 +50,15 @@
4950
"@elizaos/plugin-gitbook": "workspace:*",
5051
"@elizaos/plugin-story": "workspace:*",
5152
"@elizaos/plugin-goat": "workspace:*",
53+
"@elizaos/plugin-lensNetwork": "workspace:*",
5254
"@elizaos/plugin-icp": "workspace:*",
5355
"@elizaos/plugin-image-generation": "workspace:*",
5456
"@elizaos/plugin-movement": "workspace:*",
5557
"@elizaos/plugin-nft-generation": "workspace:*",
5658
"@elizaos/plugin-node": "workspace:*",
5759
"@elizaos/plugin-solana": "workspace:*",
5860
"@elizaos/plugin-solana-agentkit": "workspace:*",
61+
"@elizaos/plugin-autonome": "workspace:*",
5962
"@elizaos/plugin-starknet": "workspace:*",
6063
"@elizaos/plugin-stargaze": "workspace:*",
6164
"@elizaos/plugin-giphy": "workspace:*",
@@ -73,6 +76,7 @@
7376
"@elizaos/plugin-3d-generation": "workspace:*",
7477
"@elizaos/plugin-fuel": "workspace:*",
7578
"@elizaos/plugin-avalanche": "workspace:*",
79+
"@elizaos/plugin-video-generation": "workspace:*",
7680
"@elizaos/plugin-web-search": "workspace:*",
7781
"@elizaos/plugin-letzai": "workspace:*",
7882
"@elizaos/plugin-thirdweb": "workspace:*",
@@ -83,6 +87,7 @@
8387
"@elizaos/plugin-arthera": "workspace:*",
8488
"@elizaos/plugin-allora": "workspace:*",
8589
"@elizaos/plugin-opacity": "workspace:*",
90+
"@elizaos/plugin-akash": "workspace:*",
8691
"readline": "1.3.0",
8792
"ws": "8.18.0",
8893
"yargs": "17.7.2"
@@ -94,4 +99,4 @@
9499
"ts-node": "10.9.2",
95100
"tsup": "8.3.5"
96101
}
97-
}
102+
}

agent/src/index.ts

+55-17
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,25 @@ import { flowPlugin } from "@elizaos/plugin-flow";
6363
import { fuelPlugin } from "@elizaos/plugin-fuel";
6464
import { genLayerPlugin } from "@elizaos/plugin-genlayer";
6565
import { imageGenerationPlugin } from "@elizaos/plugin-image-generation";
66+
import { lensPlugin } from "@elizaos/plugin-lensNetwork";
6667
import { multiversxPlugin } from "@elizaos/plugin-multiversx";
6768
import { nearPlugin } from "@elizaos/plugin-near";
6869
import { nftGenerationPlugin } from "@elizaos/plugin-nft-generation";
6970
import { createNodePlugin } from "@elizaos/plugin-node";
7071
import { obsidianPlugin } from "@elizaos/plugin-obsidian";
72+
import { sgxPlugin } from "@elizaos/plugin-sgx";
7173
import { solanaPlugin } from "@elizaos/plugin-solana";
7274
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit";
75+
import { autonomePlugin } from "@elizaos/plugin-autonome";
7376
import { storyPlugin } from "@elizaos/plugin-story";
7477
import { suiPlugin } from "@elizaos/plugin-sui";
75-
import { sgxPlugin } from "@elizaos/plugin-sgx";
7678
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
7779
import { teeLogPlugin } from "@elizaos/plugin-tee-log";
7880
import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin";
7981
import { tonPlugin } from "@elizaos/plugin-ton";
8082
import { webSearchPlugin } from "@elizaos/plugin-web-search";
8183

84+
import { coingeckoPlugin } from "@elizaos/plugin-coingecko";
8285
import { giphyPlugin } from "@elizaos/plugin-giphy";
8386
import { letzAIPlugin } from "@elizaos/plugin-letzai";
8487
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
@@ -88,6 +91,7 @@ import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
8891
import { OpacityAdapter } from "@elizaos/plugin-opacity";
8992
import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
9093
import { stargazePlugin } from "@elizaos/plugin-stargaze";
94+
import { akashPlugin } from "@elizaos/plugin-akash";
9195
import Database from "better-sqlite3";
9296
import fs from "fs";
9397
import net from "net";
@@ -141,10 +145,6 @@ function tryLoadFile(filePath: string): string | null {
141145
}
142146
}
143147

144-
function isAllStrings(arr: unknown[]): boolean {
145-
return Array.isArray(arr) && arr.every((item) => typeof item === "string");
146-
}
147-
148148
export async function loadCharacters(
149149
charactersArg: string
150150
): Promise<Character[]> {
@@ -230,16 +230,9 @@ export async function loadCharacters(
230230
}
231231

232232
// 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-
}
233+
character.plugins = await handlePluginImporting(
234+
character.plugins
235+
);
243236

244237
loadedCharacters.push(character);
245238
elizaLogger.info(
@@ -262,6 +255,36 @@ export async function loadCharacters(
262255
return loadedCharacters;
263256
}
264257

258+
async function handlePluginImporting(plugins: string[]) {
259+
if (plugins.length > 0) {
260+
elizaLogger.info("Plugins are: ", plugins);
261+
const importedPlugins = await Promise.all(
262+
plugins.map(async (plugin) => {
263+
try {
264+
const importedPlugin = await import(plugin);
265+
const functionName =
266+
plugin
267+
.replace("@elizaos/plugin-", "")
268+
.replace(/-./g, (x) => x[1].toUpperCase()) +
269+
"Plugin"; // Assumes plugin function is camelCased with Plugin suffix
270+
return (
271+
importedPlugin.default || importedPlugin[functionName]
272+
);
273+
} catch (importError) {
274+
elizaLogger.error(
275+
`Failed to import plugin: ${plugin}`,
276+
importError
277+
);
278+
return []; // Return null for failed imports
279+
}
280+
})
281+
);
282+
return importedPlugins;
283+
} else {
284+
return [];
285+
}
286+
}
287+
265288
export function getTokenForProvider(
266289
provider: ModelProviderName,
267290
character: Character
@@ -622,6 +645,7 @@ export async function createAgent(
622645
getSecret(character, "SOLANA_PRIVATE_KEY")
623646
? solanaAgentkitPlguin
624647
: null,
648+
getSecret(character, "AUTONOME_JWT_TOKEN") ? autonomePlugin : null,
625649
(getSecret(character, "NEAR_ADDRESS") ||
626650
getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
627651
getSecret(character, "NEAR_WALLET_SECRET_KEY")
@@ -683,7 +707,10 @@ export async function createAgent(
683707
? webhookPlugin
684708
: null,
685709
goatPlugin,
686-
getSecret(character, "COINGECKO_API_KEY") ? coingeckoPlugin : null,
710+
getSecret(character, "COINGECKO_API_KEY") ||
711+
getSecret(character, "COINGECKO_PRO_API_KEY")
712+
? coingeckoPlugin
713+
: null,
687714
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
688715
getSecret(character, "ABSTRACT_PRIVATE_KEY")
689716
? abstractPlugin
@@ -696,6 +723,10 @@ export async function createAgent(
696723
getSecret(character, "FLOW_PRIVATE_KEY")
697724
? flowPlugin
698725
: null,
726+
getSecret(character, "LENS_ADDRESS") &&
727+
getSecret(character, "LENS_PRIVATE_KEY")
728+
? lensPlugin
729+
: null,
699730
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
700731
getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
701732
getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
@@ -733,6 +764,10 @@ export async function createAgent(
733764
? artheraPlugin
734765
: null,
735766
getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
767+
getSecret(character, "AKASH_MNEMONIC") &&
768+
getSecret(character, "AKASH_WALLET_ADDRESS")
769+
? akashPlugin
770+
: null,
736771
].filter(Boolean),
737772
providers: [],
738773
actions: [],
@@ -922,7 +957,10 @@ const startAgents = async () => {
922957
}
923958

924959
// upload some agent functionality into directClient
925-
directClient.startAgent = async (character: Character) => {
960+
directClient.startAgent = async (character) => {
961+
// Handle plugins
962+
character.plugins = await handlePluginImporting(character.plugins);
963+
926964
// wrap it so we don't have to inject directClient later
927965
return startAgent(character, directClient);
928966
};

0 commit comments

Comments
 (0)