Skip to content

Commit 160f78b

Browse files
authored
Merge branch 'develop' into supabase-updates
2 parents f2c6ae0 + edcdc83 commit 160f78b

File tree

111 files changed

+9773
-821
lines changed

Some content is hidden

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

111 files changed

+9773
-821
lines changed

.env.example

+54
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ STARKNET_ADDRESS=
306306
STARKNET_PRIVATE_KEY=
307307
STARKNET_RPC_URL=
308308

309+
# Lens Network Configuration
310+
LENS_ADDRESS=
311+
LENS_PRIVATE_KEY=
312+
309313
# Coinbase
310314
COINBASE_COMMERCE_KEY= # From Coinbase developer portal
311315
COINBASE_API_KEY= # From Coinbase developer portal
@@ -476,3 +480,53 @@ TAVILY_API_KEY=
476480
# Verifiable Inference Configuration
477481
VERIFIABLE_INFERENCE_ENABLED=false # Set to false to disable verifiable inference
478482
VERIFIABLE_INFERENCE_PROVIDER=opacity # Options: opacity
483+
484+
485+
# Autonome Configuration
486+
AUTONOME_JWT_TOKEN=
487+
AUTONOME_RPC=https://wizard-bff-rpc.alt.technology/v1/bff/aaa/apps
488+
489+
####################################
490+
#### Akash Network Configuration ####
491+
####################################
492+
AKASH_ENV=mainnet
493+
AKASH_NET=https://raw.githubusercontent.com/ovrclk/net/master/mainnet
494+
RPC_ENDPOINT=https://rpc.akashnet.net:443
495+
AKASH_GAS_PRICES=0.025uakt
496+
AKASH_GAS_ADJUSTMENT=1.5
497+
AKASH_KEYRING_BACKEND=os
498+
AKASH_FROM=default
499+
AKASH_FEES=20000uakt
500+
AKASH_DEPOSIT=500000uakt
501+
AKASH_MNEMONIC=
502+
AKASH_WALLET_ADDRESS=
503+
# Akash Pricing API
504+
AKASH_PRICING_API_URL=https://console-api.akash.network/v1/pricing
505+
# Default values # 1 CPU = 1000 1GB = 1000000000 1GB = 1000000000
506+
AKASH_DEFAULT_CPU=1000
507+
AKASH_DEFAULT_MEMORY=1000000000
508+
AKASH_DEFAULT_STORAGE=1000000000
509+
AKASH_SDL=example.sdl.yml
510+
# Close deployment
511+
# Close all deployments = closeAll
512+
# Close a single deployment = dseq and add the value in AKASH_CLOSE_DSEQ
513+
AKASH_CLOSE_DEP=closeAll
514+
AKASH_CLOSE_DSEQ=19729929
515+
# Provider Info we added one to check you will have to pass this into the action
516+
AKASH_PROVIDER_INFO=akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz
517+
# Deployment Status
518+
# AKASH_DEP_STATUS = dseq or param_passed when you are building you wil pass the dseq dinamically to test you
519+
# you can pass the dseq using AKASH_DEP_DSEQ 19729929 is an example of a dseq we test while build.
520+
AKASH_DEP_STATUS=dseq
521+
AKASH_DEP_DSEQ=19729929
522+
# Gas Estimation Options: close, create, or update
523+
# qseq is required when operation is "close" 19729929 is an example of a dseq we test while build.
524+
AKASH_GAS_OPERATION=close
525+
AKASH_GAS_DSEQ=19729929
526+
# Manifest
527+
# Values: "auto" | "manual" | "validate_only" Default: "auto"
528+
AKASH_MANIFEST_MODE=auto
529+
# Default: Will use the SDL directory
530+
AKASH_MANIFEST_PATH=
531+
# Values: "strict" | "lenient" | "none" - Default: "strict"
532+
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

+4
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@
5050
"@elizaos/plugin-gitbook": "workspace:*",
5151
"@elizaos/plugin-story": "workspace:*",
5252
"@elizaos/plugin-goat": "workspace:*",
53+
"@elizaos/plugin-lensNetwork": "workspace:*",
5354
"@elizaos/plugin-icp": "workspace:*",
5455
"@elizaos/plugin-image-generation": "workspace:*",
5556
"@elizaos/plugin-movement": "workspace:*",
5657
"@elizaos/plugin-nft-generation": "workspace:*",
5758
"@elizaos/plugin-node": "workspace:*",
5859
"@elizaos/plugin-solana": "workspace:*",
5960
"@elizaos/plugin-solana-agentkit": "workspace:*",
61+
"@elizaos/plugin-autonome": "workspace:*",
6062
"@elizaos/plugin-starknet": "workspace:*",
6163
"@elizaos/plugin-stargaze": "workspace:*",
6264
"@elizaos/plugin-giphy": "workspace:*",
@@ -74,6 +76,7 @@
7476
"@elizaos/plugin-3d-generation": "workspace:*",
7577
"@elizaos/plugin-fuel": "workspace:*",
7678
"@elizaos/plugin-avalanche": "workspace:*",
79+
"@elizaos/plugin-video-generation": "workspace:*",
7780
"@elizaos/plugin-web-search": "workspace:*",
7881
"@elizaos/plugin-letzai": "workspace:*",
7982
"@elizaos/plugin-thirdweb": "workspace:*",
@@ -84,6 +87,7 @@
8487
"@elizaos/plugin-arthera": "workspace:*",
8588
"@elizaos/plugin-allora": "workspace:*",
8689
"@elizaos/plugin-opacity": "workspace:*",
90+
"@elizaos/plugin-akash": "workspace:*",
8791
"readline": "1.3.0",
8892
"ws": "8.18.0",
8993
"yargs": "17.7.2"

agent/src/index.ts

+51-18
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ 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";
@@ -71,6 +72,7 @@ import { obsidianPlugin } from "@elizaos/plugin-obsidian";
7172
import { sgxPlugin } from "@elizaos/plugin-sgx";
7273
import { solanaPlugin } from "@elizaos/plugin-solana";
7374
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit";
75+
import { autonomePlugin } from "@elizaos/plugin-autonome";
7476
import { storyPlugin } from "@elizaos/plugin-story";
7577
import { suiPlugin } from "@elizaos/plugin-sui";
7678
import { TEEMode, teePlugin } from "@elizaos/plugin-tee";
@@ -79,7 +81,6 @@ import { teeMarlinPlugin } from "@elizaos/plugin-tee-marlin";
7981
import { tonPlugin } from "@elizaos/plugin-ton";
8082
import { webSearchPlugin } from "@elizaos/plugin-web-search";
8183

82-
import { coingeckoPlugin } from "@elizaos/plugin-coingecko";
8384
import { giphyPlugin } from "@elizaos/plugin-giphy";
8485
import { letzAIPlugin } from "@elizaos/plugin-letzai";
8586
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb";
@@ -89,6 +90,7 @@ import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era";
8990
import { OpacityAdapter } from "@elizaos/plugin-opacity";
9091
import { openWeatherPlugin } from "@elizaos/plugin-open-weather";
9192
import { stargazePlugin } from "@elizaos/plugin-stargaze";
93+
import { akashPlugin } from "@elizaos/plugin-akash";
9294
import Database from "better-sqlite3";
9395
import fs from "fs";
9496
import net from "net";
@@ -142,10 +144,6 @@ function tryLoadFile(filePath: string): string | null {
142144
}
143145
}
144146

145-
function isAllStrings(arr: unknown[]): boolean {
146-
return Array.isArray(arr) && arr.every((item) => typeof item === "string");
147-
}
148-
149147
export async function loadCharacters(
150148
charactersArg: string
151149
): Promise<Character[]> {
@@ -231,16 +229,9 @@ export async function loadCharacters(
231229
}
232230

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

245236
loadedCharacters.push(character);
246237
elizaLogger.info(
@@ -263,6 +254,36 @@ export async function loadCharacters(
263254
return loadedCharacters;
264255
}
265256

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+
266287
export function getTokenForProvider(
267288
provider: ModelProviderName,
268289
character: Character
@@ -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")
@@ -681,8 +703,8 @@ export async function createAgent(
681703
goatPlugin,
682704
getSecret(character, "COINGECKO_API_KEY") ||
683705
getSecret(character, "COINGECKO_PRO_API_KEY")
684-
? coingeckoPlugin
685-
: null,
706+
? coingeckoPlugin
707+
: null,
686708
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
687709
getSecret(character, "ABSTRACT_PRIVATE_KEY")
688710
? abstractPlugin
@@ -695,6 +717,10 @@ export async function createAgent(
695717
getSecret(character, "FLOW_PRIVATE_KEY")
696718
? flowPlugin
697719
: null,
720+
getSecret(character, "LENS_ADDRESS") &&
721+
getSecret(character, "LENS_PRIVATE_KEY")
722+
? lensPlugin
723+
: null,
698724
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
699725
getSecret(character, "MVX_PRIVATE_KEY") ? multiversxPlugin : null,
700726
getSecret(character, "ZKSYNC_PRIVATE_KEY") ? zksyncEraPlugin : null,
@@ -732,6 +758,10 @@ export async function createAgent(
732758
? artheraPlugin
733759
: null,
734760
getSecret(character, "ALLORA_API_KEY") ? alloraPlugin : null,
761+
getSecret(character, "AKASH_MNEMONIC") &&
762+
getSecret(character, "AKASH_WALLET_ADDRESS")
763+
? akashPlugin
764+
: null,
735765
].filter(Boolean),
736766
providers: [],
737767
actions: [],
@@ -921,7 +951,10 @@ const startAgents = async () => {
921951
}
922952

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

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

docs/api/classes/DatabaseAdapter.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Retrieves memories based on the specified parameters.
194194

195195
**params**
196196

197-
An object containing parameters for the memory retrieval.
197+
An object containing parameters for memory retrieval.
198198

199199
**params.agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`
200200

@@ -300,7 +300,7 @@ An object containing parameters for the embedding retrieval.
300300

301301
`Promise`\<`object`[]\>
302302

303-
A Promise that resolves to an array of objects containing embeddings and levenshtein scores.
303+
A Promise that resolves to an array of objects containing embeddings and Levenshtein scores.
304304

305305
#### Implementation of
306306

docs/api/functions/composeContext.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The parameters for composing the context.
2020

2121
**params.state**: [`State`](../interfaces/State.md)
2222

23-
The state object containing values to replace the placeholders in the template.
23+
The state object contains values to replace the placeholders in the template.
2424

2525
**params.template**: `string` | `Function`
2626

docs/api/functions/configureSettings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Configures environment settings for browser usage
1010

1111
**settings**: `Settings`
1212

13-
Object containing environment variables
13+
The object containing environment variables
1414

1515
## Returns
1616

docs/api/functions/splitChunks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Number of characters to overlap between chunks (default: 100)
2424

2525
`Promise`\<`string`[]\>
2626

27-
Promise resolving to array of text chunks with bleed sections
27+
Promise resolving to an array of text chunks with bleed sections
2828

2929
## Defined in
3030

docs/api/interfaces/ActionExample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Interface: ActionExample
44

5-
Example content with associated user for demonstration purposes
5+
Example content with the associated user for demonstration purposes
66

77
## Properties
88

docs/api/interfaces/ConversationExample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Example conversation content with user ID
1010

1111
> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`
1212
13-
UUID of user in conversation
13+
UUID of the user in conversation
1414

1515
#### Defined in
1616

0 commit comments

Comments
 (0)