Skip to content

Commit 5ac2333

Browse files
authored
Merge branch 'develop' into main
2 parents 812c9b6 + 49793e2 commit 5ac2333

File tree

147 files changed

+14379
-6751
lines changed

Some content is hidden

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

147 files changed

+14379
-6751
lines changed

.env.example

+69
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=
@@ -299,6 +306,10 @@ STARKNET_ADDRESS=
299306
STARKNET_PRIVATE_KEY=
300307
STARKNET_RPC_URL=
301308

309+
# Lens Network Configuration
310+
LENS_ADDRESS=
311+
LENS_PRIVATE_KEY=
312+
302313
# Coinbase
303314
COINBASE_COMMERCE_KEY= # From Coinbase developer portal
304315
COINBASE_API_KEY= # From Coinbase developer portal
@@ -352,6 +363,12 @@ FLOW_ENDPOINT_URL= # Default: https://mainnet.onflow.org
352363
INTERNET_COMPUTER_PRIVATE_KEY=
353364
INTERNET_COMPUTER_ADDRESS=
354365

366+
367+
#Cloudflare AI Gateway
368+
CLOUDFLARE_GW_ENABLED= # Set to true to enable Cloudflare AI Gateway
369+
CLOUDFLARE_AI_ACCOUNT_ID= # Cloudflare AI Account ID - found in the Cloudflare Dashboard under AI Gateway
370+
CLOUDFLARE_AI_GATEWAY_ID= # Cloudflare AI Gateway ID - found in the Cloudflare Dashboard under AI Gateway
371+
355372
# Aptos
356373
APTOS_PRIVATE_KEY= # Aptos private key
357374
APTOS_NETWORK= # Must be one of mainnet, testnet
@@ -434,6 +451,8 @@ GIPHY_API_KEY=
434451
# OpenWeather
435452
OPEN_WEATHER_API_KEY= # OpenWeather API key
436453

454+
455+
437456
# EchoChambers Configuration
438457
ECHOCHAMBERS_API_URL=http://127.0.0.1:3333
439458
ECHOCHAMBERS_API_KEY=testingkey0011
@@ -467,3 +486,53 @@ TAVILY_API_KEY=
467486
# Verifiable Inference Configuration
468487
VERIFIABLE_INFERENCE_ENABLED=false # Set to false to disable verifiable inference
469488
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

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,31 @@
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:*",
4849
"@elizaos/plugin-flow": "workspace:*",
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

+58-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";
@@ -63,16 +63,18 @@ 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";
@@ -88,6 +90,7 @@ import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
8890
import { OpacityAdapter } from "@elizaos/plugin-opacity";
8991
import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
9092
import { stargazePlugin } from "@elizaos/plugin-stargaze";
93+
import { akashPlugin } from "@elizaos/plugin-akash";
9194
import Database from "better-sqlite3";
9295
import fs from "fs";
9396
import net from "net";
@@ -141,10 +144,6 @@ function tryLoadFile(filePath: string): string | null {
141144
}
142145
}
143146

144-
function isAllStrings(arr: unknown[]): boolean {
145-
return Array.isArray(arr) && arr.every((item) => typeof item === "string");
146-
}
147-
148147
export async function loadCharacters(
149148
charactersArg: string
150149
): Promise<Character[]> {
@@ -230,16 +229,9 @@ export async function loadCharacters(
230229
}
231230

232231
// 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-
}
232+
character.plugins = await handlePluginImporting(
233+
character.plugins
234+
);
243235

244236
loadedCharacters.push(character);
245237
elizaLogger.info(
@@ -262,6 +254,36 @@ export async function loadCharacters(
262254
return loadedCharacters;
263255
}
264256

257+
async function handlePluginImporting(plugins: string[]) {
258+
if (plugins.length > 0) {
259+
elizaLogger.info("Plugins are: ", plugins);
260+
const importedPlugins = await Promise.all(
261+
plugins.map(async (plugin) => {
262+
try {
263+
const importedPlugin = await import(plugin);
264+
const functionName =
265+
plugin
266+
.replace("@elizaos/plugin-", "")
267+
.replace(/-./g, (x) => x[1].toUpperCase()) +
268+
"Plugin"; // Assumes plugin function is camelCased with Plugin suffix
269+
return (
270+
importedPlugin.default || importedPlugin[functionName]
271+
);
272+
} catch (importError) {
273+
elizaLogger.error(
274+
`Failed to import plugin: ${plugin}`,
275+
importError
276+
);
277+
return []; // Return null for failed imports
278+
}
279+
})
280+
);
281+
return importedPlugins;
282+
} else {
283+
return [];
284+
}
285+
}
286+
265287
export function getTokenForProvider(
266288
provider: ModelProviderName,
267289
character: Character
@@ -608,7 +630,6 @@ export async function createAgent(
608630
? confluxPlugin
609631
: null,
610632
nodePlugin,
611-
coinPricePlugin,
612633
getSecret(character, "TAVILY_API_KEY") ? webSearchPlugin : null,
613634
getSecret(character, "SOLANA_PUBLIC_KEY") ||
614635
(getSecret(character, "WALLET_PUBLIC_KEY") &&
@@ -618,6 +639,7 @@ export async function createAgent(
618639
getSecret(character, "SOLANA_PRIVATE_KEY")
619640
? solanaAgentkitPlguin
620641
: null,
642+
getSecret(character, "AUTONOME_JWT_TOKEN") ? autonomePlugin : null,
621643
(getSecret(character, "NEAR_ADDRESS") ||
622644
getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
623645
getSecret(character, "NEAR_WALLET_SECRET_KEY")
@@ -668,9 +690,9 @@ export async function createAgent(
668690
: []),
669691
...(teeMode !== TEEMode.OFF && walletSecretSalt ? [teePlugin] : []),
670692
getSecret(character, "SGX") ? sgxPlugin : null,
671-
(getSecret(character, "ENABLE_TEE_LOG") &&
672-
((teeMode !== TEEMode.OFF && walletSecretSalt) ||
673-
getSecret(character, "SGX")))
693+
getSecret(character, "ENABLE_TEE_LOG") &&
694+
((teeMode !== TEEMode.OFF && walletSecretSalt) ||
695+
getSecret(character, "SGX"))
674696
? teeLogPlugin
675697
: null,
676698
getSecret(character, "COINBASE_API_KEY") &&
@@ -679,7 +701,10 @@ export async function createAgent(
679701
? webhookPlugin
680702
: null,
681703
goatPlugin,
682-
getSecret(character, "COINGECKO_API_KEY") ? coingeckoPlugin : null,
704+
getSecret(character, "COINGECKO_API_KEY") ||
705+
getSecret(character, "COINGECKO_PRO_API_KEY")
706+
? coingeckoPlugin
707+
: null,
683708
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
684709
getSecret(character, "ABSTRACT_PRIVATE_KEY")
685710
? abstractPlugin
@@ -692,6 +717,10 @@ export async function createAgent(
692717
getSecret(character, "FLOW_PRIVATE_KEY")
693718
? flowPlugin
694719
: null,
720+
getSecret(character, "LENS_ADDRESS") &&
721+
getSecret(character, "LENS_PRIVATE_KEY")
722+
? lensPlugin
723+
: null,
695724
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
696725
getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
697726
getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
@@ -729,6 +758,10 @@ export async function createAgent(
729758
? artheraPlugin
730759
: null,
731760
getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
761+
getSecret(character, "AKASH_MNEMONIC") &&
762+
getSecret(character, "AKASH_WALLET_ADDRESS")
763+
? akashPlugin
764+
: null,
732765
].filter(Boolean),
733766
providers: [],
734767
actions: [],
@@ -918,7 +951,10 @@ const startAgents = async () => {
918951
}
919952

920953
// upload some agent functionality into directClient
921-
directClient.startAgent = async (character: Character) => {
954+
directClient.startAgent = async (character) => {
955+
// Handle plugins
956+
character.plugins = await handlePluginImporting(character.plugins);
957+
922958
// wrap it so we don't have to inject directClient later
923959
return startAgent(character, directClient);
924960
};

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ To create new tests, add a `.test.ts` file adjacent to the code you're testing.
176176

177177
## Docs Updates
178178

179-
Please make sure to vetify if the documentation provided is correct. In order to do so, please run the docs service.
179+
Please make sure to verify if the documentation provided is correct. In order to do so, please run the docs service.
180180

181181
```console
182182
docker compose -f docker-compose-docs.yaml up --build

0 commit comments

Comments
 (0)