Skip to content

Commit 72dc145

Browse files
authored
Merge branch 'main' into resolve-conflicts
2 parents 4882fb9 + 0ffa45c commit 72dc145

File tree

203 files changed

+7563
-2607
lines changed

Some content is hidden

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

203 files changed

+7563
-2607
lines changed

.env.example

+7-2
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,10 @@ STARKNET_ADDRESS=
9191
STARKNET_PRIVATE_KEY=
9292
STARKNET_RPC_URL=
9393

94-
# Coinbase Commerce
95-
COINBASE_COMMERCE_KEY=
94+
# Coinbase
95+
COINBASE_COMMERCE_KEY= # from coinbase developer portal
96+
COINBASE_API_KEY= # from coinbase developer portal
97+
COINBASE_PRIVATE_KEY= # from coinbase developer portal
98+
# 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
99+
COINBASE_GENERATED_WALLET_ID= # not your address but the wallet id from generating a wallet through the plugin
100+
COINBASE_GENERATED_WALLET_HEX_SEED= # not your address but the wallet hex seed from generating a wallet through the plugin and calling export

.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

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
"@ai16z/plugin-solana": "workspace:*",
2727
"@ai16z/plugin-starknet": "workspace:*",
2828
"@ai16z/plugin-coinbase": "workspace:*",
29-
"readline": "^1.3.0",
30-
"ws": "^8.18.0",
29+
"readline": "1.3.0",
30+
"ws": "8.18.0",
3131
"yargs": "17.7.2"
3232
},
3333
"devDependencies": {
3434
"ts-node": "10.9.2",
35-
"tsup": "^8.3.5"
35+
"tsup": "8.3.5"
3636
}
3737
}

agent/src/index.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ import {
2525
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
2626
import { solanaPlugin } from "@ai16z/plugin-solana";
2727
import { nodePlugin } from "@ai16z/plugin-node";
28-
import { coinbaseCommercePlugin } from "@ai16z/plugin-coinbase";
28+
import {
29+
coinbaseCommercePlugin,
30+
coinbaseMassPaymentsPlugin,
31+
} from "@ai16z/plugin-coinbase";
2932
import Database from "better-sqlite3";
3033
import fs from "fs";
3134
import readline from "readline";
@@ -178,6 +181,7 @@ function initializeDatabase(dataDir: string) {
178181
if (process.env.POSTGRES_URL) {
179182
const db = new PostgresDatabaseAdapter({
180183
connectionString: process.env.POSTGRES_URL,
184+
parseInputs: true,
181185
});
182186
return db;
183187
} else {
@@ -254,6 +258,12 @@ export function createAgent(
254258
process.env.COINBASE_COMMERCE_KEY
255259
? coinbaseCommercePlugin
256260
: null,
261+
(character.settings.secrets?.COINBASE_API_KEY ||
262+
process.env.COINBASE_API_KEY) &&
263+
(character.settings.secrets?.COINBASE_PRIVATE_KEY ||
264+
process.env.COINBASE_PRIVATE_KEY)
265+
? coinbaseMassPaymentsPlugin
266+
: null,
257267
].filter(Boolean),
258268
providers: [],
259269
actions: [],
@@ -275,7 +285,7 @@ function intializeDbCache(character: Character, db: IDatabaseCacheAdapter) {
275285
return cache;
276286
}
277287

278-
async function startAgent(character: Character, directClient: DirectClient) {
288+
async function startAgent(character: Character, directClient: any) {
279289
try {
280290
character.id ??= stringToUuid(character.name);
281291
character.username ??= character.name;
@@ -325,7 +335,7 @@ const startAgents = async () => {
325335

326336
try {
327337
for (const character of characters) {
328-
await startAgent(character, directClient as DirectClient);
338+
await startAgent(character, directClient as any);
329339
}
330340
} catch (error) {
331341
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

client/src/App.tsx

+2-63
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,10 @@
1-
import { useState } from "react";
2-
import { Input } from "@/components/ui/input";
3-
import { Button } from "@/components/ui/button";
41
import "./App.css";
5-
import { stringToUuid } from "@ai16z/eliza";
6-
7-
type TextResponse = {
8-
text: string;
9-
user: string;
10-
};
2+
import Agents from "./Agents";
113

124
function App() {
13-
const [input, setInput] = useState("");
14-
const [response, setResponse] = useState<TextResponse[]>([]);
15-
const [loading, setLoading] = useState(false);
16-
17-
const handleSubmit = async (e: React.FormEvent) => {
18-
e.preventDefault();
19-
setLoading(true);
20-
21-
try {
22-
const res = await fetch(`/api/${stringToUuid("Eliza")}/message`, {
23-
method: "POST",
24-
headers: {
25-
"Content-Type": "application/json",
26-
},
27-
body: JSON.stringify({
28-
text: input,
29-
userId: "user",
30-
roomId: `default-room-${stringToUuid("Eliza")}`,
31-
}),
32-
});
33-
34-
const data: TextResponse[] = await res.json();
35-
36-
console.log(data);
37-
setResponse(data);
38-
setInput("");
39-
} catch (error) {
40-
console.error("Error:", error);
41-
setResponse([{ text: "An error occurred", user: "system" }]);
42-
} finally {
43-
setLoading(false);
44-
}
45-
};
46-
475
return (
486
<div className="min-h-screen flex flex-col items-center justify-center p-4">
49-
<h1 className="text-2xl font-bold mb-4">Chat with Eliza</h1>
50-
<form onSubmit={handleSubmit} className="w-full max-w-md space-y-4">
51-
<Input
52-
value={input}
53-
onChange={(e) => setInput(e.target.value)}
54-
placeholder="Enter your message..."
55-
className="w-full"
56-
/>
57-
<Button type="submit" className="w-full" disabled={loading}>
58-
{loading ? "Sending..." : "Send"}
59-
</Button>
60-
</form>
61-
62-
{(loading || response) && (
63-
<div className="mt-8 p-4 w-full max-w-md bg-gray-100 rounded-lg">
64-
{response.map((r) => (
65-
<p key={r.text}>{r.text}</p>
66-
))}
67-
</div>
68-
)}
7+
<Agents />
698
</div>
709
);
7110
}

client/src/Character.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Character() {
2+
return (
3+
<div className="min-h-screen w-full flex flex-col items-center justify-center p-4">
4+
<p className="text-lg text-gray-600">WIP</p>
5+
</div>
6+
);
7+
}

0 commit comments

Comments
 (0)