Skip to content

Commit

Permalink
edit plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ileana-pr committed Dec 19, 2024
1 parent a3d93ef commit 059160b
Show file tree
Hide file tree
Showing 21 changed files with 879 additions and 1,460 deletions.
80 changes: 0 additions & 80 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,8 @@ import {
stringToUuid,
validateCharacterConfig,
} from "@ai16z/eliza";
import { zgPlugin } from "@ai16z/plugin-0g";
import createGoatPlugin from "@ai16z/plugin-goat";
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
// import { intifacePlugin } from "@ai16z/plugin-intiface";
import {
coinbaseCommercePlugin,
coinbaseMassPaymentsPlugin,
tradePlugin,
tokenContractPlugin,
webhookPlugin,
advancedTradePlugin,
} from "@ai16z/plugin-coinbase";
import { confluxPlugin } from "@ai16z/plugin-conflux";
import { imageGenerationPlugin } from "@ai16z/plugin-image-generation";
import { evmPlugin } from "@ai16z/plugin-evm";
import { createNodePlugin } from "@ai16z/plugin-node";
import { solanaPlugin } from "@ai16z/plugin-solana";
import { teePlugin, TEEMode } from "@ai16z/plugin-tee";
import { aptosPlugin, TransferAptosToken } from "@ai16z/plugin-aptos";
import { flowPlugin } from "@ai16z/plugin-flow";
import Database from "better-sqlite3";
import fs from "fs";
import path from "path";
Expand Down Expand Up @@ -417,23 +399,6 @@ export async function createAgent(

nodePlugin ??= createNodePlugin();

const teeMode = getSecret(character, "TEE_MODE") || "OFF";
const walletSecretSalt = getSecret(character, "WALLET_SECRET_SALT");

// Validate TEE configuration
if (teeMode !== TEEMode.OFF && !walletSecretSalt) {
elizaLogger.error(
"WALLET_SECRET_SALT required when TEE_MODE is enabled"
);
throw new Error("Invalid TEE configuration");
}

let goatPlugin: any | undefined;
if (getSecret(character, "ALCHEMY_API_KEY")) {
goatPlugin = await createGoatPlugin((secret) =>
getSecret(character, secret)
);
}

return new AgentRuntime({
databaseAdapter: db,
Expand All @@ -444,52 +409,7 @@ export async function createAgent(
// character.plugins are handled when clients are added
plugins: [
bootstrapPlugin,
getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
? confluxPlugin
: null,
nodePlugin,
getSecret(character, "SOLANA_PUBLIC_KEY") ||
(getSecret(character, "WALLET_PUBLIC_KEY") &&
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
? solanaPlugin
: null,
getSecret(character, "EVM_PRIVATE_KEY") ||
(getSecret(character, "WALLET_PUBLIC_KEY") &&
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
? evmPlugin
: null,
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
getSecret(character, "COINBASE_COMMERCE_KEY")
? coinbaseCommercePlugin
: null,
getSecret(character, "FAL_API_KEY") ||
getSecret(character, "OPENAI_API_KEY") ||
getSecret(character, "HEURIST_API_KEY")
? imageGenerationPlugin
: null,
...(getSecret(character, "COINBASE_API_KEY") &&
getSecret(character, "COINBASE_PRIVATE_KEY")
? [
coinbaseMassPaymentsPlugin,
tradePlugin,
tokenContractPlugin,
advancedTradePlugin,
]
: []),
...(teeMode !== TEEMode.OFF && walletSecretSalt
? [teePlugin, solanaPlugin]
: []),
getSecret(character, "COINBASE_API_KEY") &&
getSecret(character, "COINBASE_PRIVATE_KEY") &&
getSecret(character, "COINBASE_NOTIFICATION_URI")
? webhookPlugin
: null,
getSecret(character, "ALCHEMY_API_KEY") ? goatPlugin : null,
getSecret(character, "FLOW_ADDRESS") &&
getSecret(character, "FLOW_PRIVATE_KEY")
? flowPlugin
: null,
getSecret(character, "APTOS_PRIVATE_KEY") ? aptosPlugin : null,
].filter(Boolean),
providers: [],
actions: [],
Expand Down
6 changes: 0 additions & 6 deletions packages/plugin-helloworld/.npmignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/plugin-helloworld/eslint.config.mjs

This file was deleted.

19 changes: 0 additions & 19 deletions packages/plugin-helloworld/package.json

This file was deleted.

127 changes: 0 additions & 127 deletions packages/plugin-helloworld/src/actions/helloworld.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/plugin-helloworld/src/actions/index.ts

This file was deleted.

Loading

0 comments on commit 059160b

Please sign in to comment.