Skip to content

Commit 6db8eac

Browse files
authored
Merge branch 'main' into client-farcaster
2 parents 973a735 + 3fbad4b commit 6db8eac

File tree

230 files changed

+20296
-2848
lines changed

Some content is hidden

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

230 files changed

+20296
-2848
lines changed

.env.example

+25-1
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,34 @@ STARKNET_ADDRESS=
9191
STARKNET_PRIVATE_KEY=
9292
STARKNET_RPC_URL=
9393

94+
9495
# Farcaster
95-
FARCASTER_HUB_URL=hub.pinata.cloud
96+
FARCASTER_HUB_URL=
9697
FARCASTER_FID=
9798
FARCASTER_PRIVATE_KEY=
9899

100+
# Coinbase
101+
COINBASE_COMMERCE_KEY= # from coinbase developer portal
102+
COINBASE_API_KEY= # from coinbase developer portal
103+
COINBASE_PRIVATE_KEY= # from coinbase developer portal
104+
# if not configured it will be generated and written to runtime.character.settings.secrets.COINBASE_GENERATED_WALLET_ID and runtime.character.settings.secrets.COINBASE_GENERATED_WALLET_HEX_SEED
105+
COINBASE_GENERATED_WALLET_ID= # not your address but the wallet id from generating a wallet through the plugin
106+
COINBASE_GENERATED_WALLET_HEX_SEED= # not your address but the wallet hex seed from generating a wallet through the plugin and calling export
107+
108+
# Conflux Configuration
109+
CONFLUX_CORE_PRIVATE_KEY=
110+
CONFLUX_CORE_SPACE_RPC_URL=
111+
CONFLUX_ESPACE_PRIVATE_KEY=
112+
CONFLUX_ESPACE_RPC_URL=
113+
CONFLUX_MEME_CONTRACT_ADDRESS=
114+
115+
#ZeroG
116+
ZEROG_INDEXER_RPC=
117+
ZEROG_EVM_RPC=
118+
ZEROG_PRIVATE_KEY=
119+
ZEROG_FLOW_ADDRESS=
120+
121+
99122
# Coinbase Commerce
100123
COINBASE_COMMERCE_KEY=
124+

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
echo "TEST_DATABASE_CLIENT=sqlite" > packages/core/.env.test
3434
echo "NODE_ENV=test" >> packages/core/.env.test
3535
36-
# - name: Run tests
37-
# run: cd packages/core && pnpm test // YOLO FOR NOW
36+
- name: Run tests
37+
run: cd packages/core && pnpm test
3838

3939
- name: Build packages
4040
run: pnpm run build

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ characters/
4040
packages/core/src/providers/cache
4141
packages/core/src/providers/cache/*
4242
cache/*
43+
packages/plugin-coinbase/src/plugins/transactions.csv
44+
packages/plugin-coinbase/package-lock.json

.husky/commit-msg

-12
This file was deleted.

.husky/pre-commit

-2
This file was deleted.

agent/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@
2121
"@ai16z/client-twitter": "workspace:*",
2222
"@ai16z/eliza": "workspace:*",
2323
"@ai16z/plugin-bootstrap": "workspace:*",
24+
"@ai16z/plugin-conflux": "workspace:*",
2425
"@ai16z/plugin-image-generation": "workspace:*",
2526
"@ai16z/plugin-node": "workspace:*",
2627
"@ai16z/plugin-solana": "workspace:*",
28+
"@ai16z/plugin-0g": "workspace:*",
2729
"@ai16z/plugin-starknet": "workspace:*",
2830
"@ai16z/plugin-coinbase": "workspace:*",
29-
"readline": "^1.3.0",
30-
"ws": "^8.18.0",
31+
"readline": "1.3.0",
32+
"ws": "8.18.0",
3133
"yargs": "17.7.2"
3234
},
3335
"devDependencies": {
3436
"ts-node": "10.9.2",
35-
"tsup": "^8.3.5"
37+
"tsup": "8.3.5"
3638
}
3739
}

agent/src/index.ts

+23-6
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ import {
2323
validateCharacterConfig,
2424
} from "@ai16z/eliza";
2525
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
26+
import { confluxPlugin } from "@ai16z/plugin-conflux";
2627
import { solanaPlugin } from "@ai16z/plugin-solana";
28+
import { zgPlugin } from "@ai16z/plugin-0g";
2729
import { nodePlugin } from "@ai16z/plugin-node";
28-
import { coinbaseCommercePlugin } from "@ai16z/plugin-coinbase";
30+
import {
31+
coinbaseCommercePlugin,
32+
coinbaseMassPaymentsPlugin,
33+
} from "@ai16z/plugin-coinbase";
2934
import Database from "better-sqlite3";
3035
import fs from "fs";
3136
import readline from "readline";
@@ -178,6 +183,7 @@ function initializeDatabase(dataDir: string) {
178183
if (process.env.POSTGRES_URL) {
179184
const db = new PostgresDatabaseAdapter({
180185
connectionString: process.env.POSTGRES_URL,
186+
parseInputs: true,
181187
});
182188
return db;
183189
} else {
@@ -229,6 +235,10 @@ export async function initializeClients(
229235
return clients;
230236
}
231237

238+
function getSecret(character: Character, secret: string) {
239+
return character.settings.secrets?.[secret] || process.env[secret];
240+
}
241+
232242
export function createAgent(
233243
character: Character,
234244
db: IDatabaseAdapter,
@@ -248,12 +258,19 @@ export function createAgent(
248258
character,
249259
plugins: [
250260
bootstrapPlugin,
261+
getSecret(character, "CONFLUX_CORE_PRIVATE_KEY")
262+
? confluxPlugin
263+
: null,
251264
nodePlugin,
252-
character.settings.secrets?.WALLET_PUBLIC_KEY ? solanaPlugin : null,
253-
character.settings.secrets?.COINBASE_COMMERCE_KEY ||
254-
process.env.COINBASE_COMMERCE_KEY
265+
getSecret(character, "WALLET_PUBLIC_KEY") ? solanaPlugin : null,
266+
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
267+
getSecret(character, "COINBASE_COMMERCE_KEY")
255268
? coinbaseCommercePlugin
256269
: null,
270+
getSecret(character, "COINBASE_API_KEY") &&
271+
getSecret(character, "COINBASE_PRIVATE_KEY")
272+
? coinbaseMassPaymentsPlugin
273+
: null,
257274
].filter(Boolean),
258275
providers: [],
259276
actions: [],
@@ -275,7 +292,7 @@ function intializeDbCache(character: Character, db: IDatabaseCacheAdapter) {
275292
return cache;
276293
}
277294

278-
async function startAgent(character: Character, directClient: DirectClient) {
295+
async function startAgent(character: Character, directClient: any) {
279296
try {
280297
character.id ??= stringToUuid(character.name);
281298
character.username ??= character.name;
@@ -325,7 +342,7 @@ const startAgents = async () => {
325342

326343
try {
327344
for (const character of characters) {
328-
await startAgent(character, directClient as DirectClient);
345+
await startAgent(character, directClient as any);
329346
}
330347
} catch (error) {
331348
elizaLogger.error("Error starting agents:", error);

client/README.md

-50
This file was deleted.

client/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
7+
<title>Eliza</title>
88
</head>
99
<body>
1010
<div id="root"></div>

client/package.json

+26-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "eliza",
2+
"name": "eliza-client",
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
@@ -11,32 +11,37 @@
1111
},
1212
"dependencies": {
1313
"@ai16z/eliza": "workspace:*",
14-
"@radix-ui/react-slot": "^1.1.0",
15-
"class-variance-authority": "^0.7.0",
14+
"@radix-ui/react-dialog": "1.1.2",
15+
"@radix-ui/react-separator": "1.1.0",
16+
"@radix-ui/react-slot": "1.1.0",
17+
"@radix-ui/react-tooltip": "1.1.4",
18+
"@tanstack/react-query": "5.61.0",
19+
"class-variance-authority": "0.7.0",
1620
"clsx": "2.1.0",
17-
"lucide-react": "^0.460.0",
18-
"react": "^18.3.1",
19-
"react-dom": "^18.3.1",
20-
"tailwind-merge": "^2.5.4",
21-
"tailwindcss-animate": "^1.0.7",
22-
"vite-plugin-top-level-await": "^1.4.4",
23-
"vite-plugin-wasm": "^3.3.0"
21+
"lucide-react": "0.460.0",
22+
"react": "18.3.1",
23+
"react-dom": "18.3.1",
24+
"react-router-dom": "6.22.1",
25+
"tailwind-merge": "2.5.4",
26+
"tailwindcss-animate": "1.0.7",
27+
"vite-plugin-top-level-await": "1.4.4",
28+
"vite-plugin-wasm": "3.3.0"
2429
},
2530
"devDependencies": {
26-
"@eslint/js": "^9.13.0",
31+
"@eslint/js": "9.15.0",
2732
"@types/node": "22.8.4",
2833
"@types/react": "18.3.12",
2934
"@types/react-dom": "18.3.1",
30-
"@vitejs/plugin-react": "^4.3.3",
31-
"autoprefixer": "^10.4.20",
32-
"eslint": "^9.13.0",
33-
"eslint-plugin-react-hooks": "^5.0.0",
34-
"eslint-plugin-react-refresh": "^0.4.14",
35-
"globals": "^15.11.0",
36-
"postcss": "^8.4.49",
37-
"tailwindcss": "^3.4.15",
35+
"@vitejs/plugin-react": "4.3.3",
36+
"autoprefixer": "10.4.20",
37+
"eslint": "9.13.0",
38+
"eslint-plugin-react-hooks": "5.0.0",
39+
"eslint-plugin-react-refresh": "0.4.14",
40+
"globals": "15.11.0",
41+
"postcss": "8.4.49",
42+
"tailwindcss": "3.4.15",
3843
"typescript": "~5.6.2",
39-
"typescript-eslint": "^8.11.0",
40-
"vite": "^5.4.10"
44+
"typescript-eslint": "8.11.0",
45+
"vite": "link:@tanstack/router-plugin/vite"
4146
}
4247
}

client/src/Agent.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default function Agent() {
2+
return (
3+
<div className="min-h-screen flex flex-col items-center justify-center p-4">
4+
<p className="text-lg text-gray-600">
5+
Select an option from the sidebar to configure, view, or chat
6+
with your ELIZA agent
7+
</p>
8+
</div>
9+
);
10+
}

client/src/Agents.tsx

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { useQuery } from "@tanstack/react-query";
2+
import { Button } from "@/components/ui/button";
3+
import { useNavigate } from "react-router-dom";
4+
import "./App.css";
5+
6+
type Agent = {
7+
id: string;
8+
name: string;
9+
};
10+
11+
function Agents() {
12+
const navigate = useNavigate();
13+
const { data: agents, isLoading } = useQuery({
14+
queryKey: ["agents"],
15+
queryFn: async () => {
16+
const res = await fetch("/api/agents");
17+
const data = await res.json();
18+
return data.agents as Agent[];
19+
},
20+
});
21+
22+
return (
23+
<div className="min-h-screen flex flex-col items-center justify-center p-4">
24+
<h1 className="text-2xl font-bold mb-8">Select your agent:</h1>
25+
26+
{isLoading ? (
27+
<div>Loading agents...</div>
28+
) : (
29+
<div className="grid gap-4 w-full max-w-md">
30+
{agents?.map((agent) => (
31+
<Button
32+
key={agent.id}
33+
className="w-full text-lg py-6"
34+
onClick={() => {
35+
navigate(`/${agent.id}`);
36+
}}
37+
>
38+
{agent.name}
39+
</Button>
40+
))}
41+
</div>
42+
)}
43+
</div>
44+
);
45+
}
46+
47+
export default Agents;

client/src/App.css

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#root {
22
max-width: 1280px;
33
margin: 0 auto;
4-
padding: 2rem;
54
text-align: center;
65
}
76

0 commit comments

Comments
 (0)