@@ -34,19 +34,17 @@ import {
34
34
stringToUuid ,
35
35
validateCharacterConfig ,
36
36
} from "@elizaos/core" ;
37
- import { TrustScoreDatabase } from "@elizaos/plugin-trustdb" ;
38
- // import { zgPlugin } from "@elizaos/plugin-0g";
39
37
import { zgPlugin } from "@elizaos/plugin-0g" ;
40
38
41
39
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap" ;
42
40
import createGoatPlugin from "@elizaos/plugin-goat" ;
43
41
// import { intifacePlugin } from "@elizaos/plugin-intiface";
44
- import { DirectClient } from "@elizaos/client-direct" ;
45
42
import { ThreeDGenerationPlugin } from "@elizaos/plugin-3d-generation" ;
46
43
import { abstractPlugin } from "@elizaos/plugin-abstract" ;
47
44
import { alloraPlugin } from "@elizaos/plugin-allora" ;
48
45
import { aptosPlugin } from "@elizaos/plugin-aptos" ;
49
46
import { artheraPlugin } from "@elizaos/plugin-arthera" ;
47
+ import { autonomePlugin } from "@elizaos/plugin-autonome" ;
50
48
import { availPlugin } from "@elizaos/plugin-avail" ;
51
49
import { avalanchePlugin } from "@elizaos/plugin-avalanche" ;
52
50
import { binancePlugin } from "@elizaos/plugin-binance" ;
@@ -58,8 +56,8 @@ import {
58
56
tradePlugin ,
59
57
webhookPlugin ,
60
58
} from "@elizaos/plugin-coinbase" ;
61
- import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap" ;
62
59
import { coingeckoPlugin } from "@elizaos/plugin-coingecko" ;
60
+ import { coinmarketcapPlugin } from "@elizaos/plugin-coinmarketcap" ;
63
61
import { confluxPlugin } from "@elizaos/plugin-conflux" ;
64
62
import { createCosmosPlugin } from "@elizaos/plugin-cosmos" ;
65
63
import { cronosZkEVMPlugin } from "@elizaos/plugin-cronoszkevm" ;
@@ -78,7 +76,6 @@ import { obsidianPlugin } from "@elizaos/plugin-obsidian";
78
76
import { sgxPlugin } from "@elizaos/plugin-sgx" ;
79
77
import { solanaPlugin } from "@elizaos/plugin-solana" ;
80
78
import { solanaAgentkitPlguin } from "@elizaos/plugin-solana-agentkit" ;
81
- import { autonomePlugin } from "@elizaos/plugin-autonome" ;
82
79
import { storyPlugin } from "@elizaos/plugin-story" ;
83
80
import { suiPlugin } from "@elizaos/plugin-sui" ;
84
81
import { TEEMode , teePlugin } from "@elizaos/plugin-tee" ;
@@ -88,23 +85,22 @@ import { tonPlugin } from "@elizaos/plugin-ton";
88
85
import { webSearchPlugin } from "@elizaos/plugin-web-search" ;
89
86
90
87
import { giphyPlugin } from "@elizaos/plugin-giphy" ;
88
+ import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid" ;
91
89
import { letzAIPlugin } from "@elizaos/plugin-letzai" ;
92
90
import { thirdwebPlugin } from "@elizaos/plugin-thirdweb" ;
93
- import { hyperliquidPlugin } from "@elizaos/plugin-hyperliquid" ;
94
91
import { zksyncEraPlugin } from "@elizaos/plugin-zksync-era" ;
95
92
93
+ import { akashPlugin } from "@elizaos/plugin-akash" ;
96
94
import { OpacityAdapter } from "@elizaos/plugin-opacity" ;
97
95
import { openWeatherPlugin } from "@elizaos/plugin-open-weather" ;
98
- import { stargazePlugin } from "@elizaos/plugin-stargaze" ;
99
- import { akashPlugin } from "@elizaos/plugin-akash" ;
100
96
import { quaiPlugin } from "@elizaos/plugin-quai" ;
97
+ import { stargazePlugin } from "@elizaos/plugin-stargaze" ;
101
98
import Database from "better-sqlite3" ;
102
99
import fs from "fs" ;
103
100
import net from "net" ;
104
101
import path from "path" ;
105
102
import { fileURLToPath } from "url" ;
106
103
import yargs from "yargs" ;
107
- import { dominosPlugin } from "@elizaos/plugin-dominos" ;
108
104
109
105
const __filename = fileURLToPath ( import . meta. url ) ; // get the resolved path to the file
110
106
const __dirname = path . dirname ( __filename ) ; // get the name of the directory
@@ -626,8 +622,7 @@ export async function createAgent(
626
622
character : Character ,
627
623
db : IDatabaseAdapter ,
628
624
cache : ICacheManager ,
629
- token : string ,
630
- trustDb : TrustScoreDatabase
625
+ token : string
631
626
) : Promise < AgentRuntime > {
632
627
elizaLogger . log ( `Creating runtime for character ${ character . name } ` ) ;
633
628
@@ -707,15 +702,15 @@ export async function createAgent(
707
702
databaseAdapter : db ,
708
703
token,
709
704
modelProvider : character . modelProvider ,
705
+ evaluators : [ ] ,
710
706
character,
711
707
// character.plugins are handled when clients are added
712
708
plugins : [
713
709
bootstrapPlugin ,
714
- twitterPlugin ,
715
- // getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
716
- // ? confluxPlugin
717
- // : null,
718
- // nodePlugin,
710
+ getSecret ( character , "CONFLUX_CORE_PRIVATE_KEY" )
711
+ ? confluxPlugin
712
+ : null ,
713
+ nodePlugin ,
719
714
getSecret ( character , "TAVILY_API_KEY" ) ? webSearchPlugin : null ,
720
715
getSecret ( character , "SOLANA_PUBLIC_KEY" ) ||
721
716
( getSecret ( character , "WALLET_PUBLIC_KEY" ) &&
@@ -726,11 +721,11 @@ export async function createAgent(
726
721
? solanaAgentkitPlguin
727
722
: null ,
728
723
getSecret ( character , "AUTONOME_JWT_TOKEN" ) ? autonomePlugin : null ,
729
- // (getSecret(character, "NEAR_ADDRESS") ||
730
- // getSecret(character, "NEAR_WALLET_PUBLIC_KEY")) &&
731
- // getSecret(character, "NEAR_WALLET_SECRET_KEY")
732
- // ? nearPlugin
733
- // : null,
724
+ ( getSecret ( character , "NEAR_ADDRESS" ) ||
725
+ getSecret ( character , "NEAR_WALLET_PUBLIC_KEY" ) ) &&
726
+ getSecret ( character , "NEAR_WALLET_SECRET_KEY" )
727
+ ? nearPlugin
728
+ : null ,
734
729
getSecret ( character , "EVM_PUBLIC_KEY" ) ||
735
730
( getSecret ( character , "WALLET_PUBLIC_KEY" ) &&
736
731
getSecret ( character , "WALLET_PUBLIC_KEY" ) ?. startsWith ( "0x" ) )
@@ -749,7 +744,7 @@ export async function createAgent(
749
744
getSecret ( character , "SOLANA_ADMIN_PRIVATE_KEY" )
750
745
? nftGenerationPlugin
751
746
: null ,
752
- // getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
747
+ getSecret ( character , "ZEROG_PRIVATE_KEY" ) ? zgPlugin : null ,
753
748
getSecret ( character , "COINMARKETCAP_API_KEY" )
754
749
? coinmarketcapPlugin
755
750
: null ,
@@ -764,7 +759,7 @@ export async function createAgent(
764
759
getSecret ( character , "LIVEPEER_GATEWAY_URL" )
765
760
? imageGenerationPlugin
766
761
: null ,
767
- // getSecret(character, "FAL_API_KEY") ? ThreeDGenerationPlugin : null,
762
+ getSecret ( character , "FAL_API_KEY" ) ? ThreeDGenerationPlugin : null ,
768
763
...( getSecret ( character , "COINBASE_API_KEY" ) &&
769
764
getSecret ( character , "COINBASE_PRIVATE_KEY" )
770
765
? [
@@ -858,8 +853,7 @@ export async function createAgent(
858
853
? quaiPlugin
859
854
: null ,
860
855
] . filter ( Boolean ) ,
861
- evaluators : [ whaleDataEvaluator , trustScoreEvaluator ] ,
862
- providers : [ whaleDataProvider , trustScoreProvider ] ,
856
+ providers : [ ] ,
863
857
actions : [ ] ,
864
858
services : [ ] ,
865
859
managers : [ ] ,
@@ -944,9 +938,7 @@ async function startAgent(
944
938
character : Character ,
945
939
directClient : DirectClient
946
940
) : Promise < AgentRuntime > {
947
- let dbAdapter : IDatabaseAdapter & IDatabaseCacheAdapter ;
948
- let trustDb : TrustScoreDatabase ;
949
-
941
+ let db : IDatabaseAdapter & IDatabaseCacheAdapter ;
950
942
try {
951
943
character . id ??= stringToUuid ( character . name ) ;
952
944
character . username ??= character . name ;
@@ -958,25 +950,22 @@ async function startAgent(
958
950
fs . mkdirSync ( dataDir , { recursive : true } ) ;
959
951
}
960
952
961
- const { db, trustDb : tdb } = initializeDatabase ( dataDir ) as any ;
962
- dbAdapter = db ;
963
- trustDb = tdb ;
953
+ db = initializeDatabase ( dataDir ) as IDatabaseAdapter &
954
+ IDatabaseCacheAdapter ;
964
955
965
- await dbAdapter . init ( ) ;
956
+ await db . init ( ) ;
966
957
967
958
const cache = initializeCache (
968
959
process . env . CACHE_STORE ?? CacheStore . DATABASE ,
969
960
character ,
970
961
"" ,
971
- dbAdapter
972
- ) ;
973
-
962
+ db
963
+ ) ; // "" should be replaced with dir for file system caching. THOUGHTS: might probably make this into an env
974
964
const runtime : AgentRuntime = await createAgent (
975
965
character ,
976
- dbAdapter ,
966
+ db ,
977
967
cache ,
978
- token ,
979
- trustDb
968
+ token
980
969
) ;
981
970
982
971
// start services/plugins/process knowledge
@@ -998,8 +987,8 @@ async function startAgent(
998
987
error
999
988
) ;
1000
989
elizaLogger . error ( error ) ;
1001
- if ( dbAdapter ) {
1002
- await dbAdapter . close ( ) ;
990
+ if ( db ) {
991
+ await db . close ( ) ;
1003
992
}
1004
993
throw error ;
1005
994
}
@@ -1074,4 +1063,4 @@ const startAgents = async () => {
1074
1063
startAgents ( ) . catch ( ( error ) => {
1075
1064
elizaLogger . error ( "Unhandled error in startAgents:" , error ) ;
1076
1065
process . exit ( 1 ) ;
1077
- } ) ;
1066
+ } ) ;
0 commit comments