Skip to content

Commit d7bda2e

Browse files
committed
Merge branch 'main' of https://github.com/MarcoMandar/Eliza
2 parents dd3d4a6 + 03ebf68 commit d7bda2e

File tree

184 files changed

+32099
-29643
lines changed

Some content is hidden

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

184 files changed

+32099
-29643
lines changed

.bashrc

Whitespace-only changes.

.github/workflows/ci.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v3
15+
with:
16+
version: 9.4.0
17+
18+
- name: Install dependencies
19+
run: pnpm i
20+
21+
- name: Run Prettier
22+
run: pnpm run prettier --check .
23+
24+
- name: Build packages
25+
run: pnpm run build

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/node_modules
1+
node_modules
22
/out
33

44
.env
@@ -25,6 +25,7 @@ logs/
2525
test-report.json
2626
content_cache/
2727
test_data/
28+
tokencache/
2829
tweetcache/
2930
twitter_cookies.json
3031
timeline_cache.json

.prettierignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**/*/target
2+
**/*/dist
3+
packages/torii-client/wasm
4+
packages/torii-client/pkg
5+
packages/torii-wasm/pkg/
6+
packages/utils-wasm/pkg/
7+
8+
worlds/dojo-starter
9+
10+
# ignore lock files
11+
**/*-lock.yaml
12+
package-lock.json
13+
dev-dist
14+
15+
**/CHANGELOG.md

README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Eliza
22

3-
<img src="./docs/eliza_banner.jpg" alt="Eliza Banner" width="100%">
3+
<img src="./docs/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
44

55
*As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)*
66

@@ -20,6 +20,10 @@
2020
## Install Node.js
2121
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
2222

23+
## Using pnpm
24+
We use pnpm to manage our dependencies. It is faster and more efficient than npm, and it supports workspaces.
25+
https://pnpm.io/installation
26+
2327
## Edit the .env file
2428
- Copy .env.example to .env and fill in the appropriate values
2529
- Edit the TWITTER environment variables to add your bot's username and password
@@ -28,12 +32,6 @@ https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
2832
- Check out the file `src/core/defaultCharacter.ts` - you can modify this
2933
- You can also load characters with the `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` and run multiple bots at the same time.
3034

31-
### Linux Installation
32-
You might need these
33-
```
34-
npm install --include=optional sharp
35-
```
36-
3735
### Run with Llama
3836
You can run Llama 70B or 405B models by setting the `XAI_MODEL` environment variable to `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` or `meta-llama/Meta-Llama-3.1-405B-Instruct`
3937

@@ -49,7 +47,7 @@ If you are getting strange issues when starting up, make sure you're using Node
4947
## Additional Requirements
5048
You may need to install Sharp. If you see an error when starting up, try installing it with the following command:
5149
```
52-
npm install --include=optional sharp
50+
pnpm install --include=optional sharp
5351
```
5452

5553
# Environment Setup
@@ -74,7 +72,7 @@ TWITTER_COOKIES= # Account cookies
7472

7573
If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically.
7674
```
77-
npm install
75+
pnpm install
7876
npx --no node-llama-cpp source download --gpu cuda
7977
```
8078

characters/tate.character.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"name": "tate",
3-
"clients": ["discord", "direct, telegram"],
3+
"clients": ["discord", "twitter", "telegram"],
44
"settings": {
5-
"model": "gpt-4o-mini",
6-
"embeddingModel": "text-embedding-3-small",
75
"secrets": {},
86
"voice": {
97
"model": "en_US-male-medium"

characters/trump.character.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"name": "trump",
3-
"clients": ["discord", "direct", "telegram"],
3+
"clients": ["discord", "twitter", "telegram"],
44
"settings": {
5-
"model": "gpt-4o-mini",
6-
"embeddingModel": "text-embedding-3-small",
75
"secrets": {},
86
"voice": {
97
"model": "en_US-male-medium"

.env.example core/.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ HELIUS_API_KEY=
4141

4242
## Telegram
4343
TELEGRAM_BOT_TOKEN=
44+
45+
TOGETHER_API_KEY=

core/.eslintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/node_modules/*
2+
**/coverage/*
3+
**/dist/*
4+
**/types/*
5+
**/scripts/concatenated-output.ts
6+
rollup.config.js
7+
jest.config.js
8+
docs/

core/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

core/eslint.config.mjs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import typescript from '@typescript-eslint/parser';
4+
import prettier from 'eslint-config-prettier';
5+
6+
export default [
7+
// JavaScript and TypeScript files
8+
{
9+
files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"],
10+
languageOptions: {
11+
parser: typescript,
12+
parserOptions: {
13+
ecmaVersion: 'latest',
14+
sourceType: 'module',
15+
project: './tsconfig.json' // Make sure your tsconfig includes @types/node
16+
},
17+
globals: {
18+
// Add Node.js globals
19+
NodeJS: 'readonly',
20+
console: 'readonly',
21+
process: 'readonly',
22+
Buffer: 'readonly',
23+
__dirname: 'readonly',
24+
__filename: 'readonly',
25+
module: 'readonly',
26+
require: 'readonly'
27+
}
28+
},
29+
plugins: {
30+
'@typescript-eslint': tseslint
31+
},
32+
rules: {
33+
...eslint.configs.recommended.rules,
34+
...tseslint.configs.recommended.rules,
35+
"prefer-const": "warn",
36+
"no-constant-binary-expression": "error",
37+
38+
// Disable no-undef as TypeScript handles this better
39+
"no-undef": "off",
40+
41+
// Customize TypeScript rules
42+
"@typescript-eslint/no-explicit-any": "warn", // Changed from error to warn
43+
"@typescript-eslint/no-unused-vars": ["error", {
44+
"argsIgnorePattern": "^_",
45+
"varsIgnorePattern": "^_",
46+
"ignoreRestSiblings": true
47+
}]
48+
}
49+
},
50+
// Add prettier as the last config to override other formatting rules
51+
prettier
52+
];

jest.config.js core/jest.config.js

File renamed without changes.

nodemon.json core/nodemon.json

File renamed without changes.

core/package.json

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"name": "eliza",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "dist/index.js",
6+
"type": "module",
7+
"types": "dist/index.d.ts",
8+
"scripts": {
9+
"build": "tsc",
10+
"lint": "eslint . --fix",
11+
"start": "node --loader ts-node/esm src/index.ts",
12+
"start:arok": "node --loader ts-node/esm src/index.ts --characters=\"characters/arok.character.json\"",
13+
"start:service:ruby": "pm2 start npm --name=\"ruby\" --restart-delay=3000 --max-restarts=10 -- run start:ruby",
14+
"stop:service:ruby": "pm2 stop ruby",
15+
"start:ruby": "node --loader ts-node/esm src/index.ts --characters=\"characters/ruby.character.json\"",
16+
"start:service:trump": "pm2 start npm --name=\"trump\" --restart-delay=3000 --max-restarts=10 -- run start:trump",
17+
"stop:service:trump": "pm2 stop trump",
18+
"start:service:degen": "pm2 start npm --name=\"degen\" --restart-delay=3000 --max-restarts=10 -- run start:degen",
19+
"stop:service:degen": "pm2 stop degen",
20+
"start:degen": "node --loader ts-node/esm src/index.ts --characters=\"characters/degenspartan.json\"",
21+
"start:service:all": "pm2 start npm --name=\"all\" --restart-delay=3000 --max-restarts=10 -- run start:degen",
22+
"stop:service:all": "pm2 stop all",
23+
"start:all": "node --loader ts-node/esm src/index.ts --characters=\"characters/degenspartan.json\",\"characters/ruby.character.json\"",
24+
"start:trump": "node --loader ts-node/esm src/index.ts --characters=\"characters/trump.character.json\"",
25+
"start:service:tate": "pm2 start npm --name=\"tate\" --restart-delay=3000 --max-restarts=10 -- run start:tate",
26+
"stop:service:tate": "pm2 stop tate",
27+
"start:tate": "node --loader ts-node/esm src/index.ts --characters=\"characters/tate.character.json\"",
28+
"watch": "tsc --watch",
29+
"dev": "tsc && nodemon",
30+
"build:docs": "cd docs && npm run build",
31+
"postinstall": "npx playwright install-deps && npx playwright install",
32+
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --runInBand --watch -f",
33+
"test:sqlite": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" TEST_DATABASE_CLIENT=sqlite jest --runInBand --watch -f",
34+
"test:sqljs": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" TEST_DATABASE_CLIENT=sqljs jest --runInBand --watch -f"
35+
},
36+
"author": "",
37+
"license": "MIT",
38+
"devDependencies": {
39+
"@eslint/js": "^9.13.0",
40+
"@rollup/plugin-commonjs": "25.0.8",
41+
"@rollup/plugin-json": "6.1.0",
42+
"@rollup/plugin-node-resolve": "15.3.0",
43+
"@rollup/plugin-replace": "5.0.7",
44+
"@rollup/plugin-terser": "0.1.0",
45+
"@rollup/plugin-typescript": "11.1.6",
46+
"@types/better-sqlite3": "7.6.11",
47+
"@types/fluent-ffmpeg": "2.1.27",
48+
"@types/jest": "29.5.14",
49+
"@types/node": "22.8.4",
50+
"@types/sql.js": "1.4.9",
51+
"@types/tar": "6.1.13",
52+
"@types/wav-encoder": "1.3.3",
53+
"@typescript-eslint/eslint-plugin": "8.12.2",
54+
"@typescript-eslint/parser": "8.12.2",
55+
"dotenv": "16.4.5",
56+
"eslint": "9.13.0",
57+
"eslint-config-prettier": "9.1.0",
58+
"eslint-plugin-prettier": "5.2.1",
59+
"itty-router": "5.0.18",
60+
"jest": "29.7.0",
61+
"lint-staged": "15.2.10",
62+
"npm-run-all2": "7.0.1",
63+
"prettier": "3.3.3",
64+
"rimraf": "6.0.1",
65+
"rollup": "2.79.2",
66+
"ts-jest": "29.2.5",
67+
"ts-node": "10.9.2",
68+
"tslib": "2.8.0",
69+
"typescript": "5.6.3",
70+
"wrangler": "3.84.0"
71+
},
72+
"dependencies": {
73+
"@ai-sdk/anthropic": "^0.0.53",
74+
"@ai-sdk/google": "^0.0.55",
75+
"@ai-sdk/google-vertex": "^0.0.42",
76+
"@ai-sdk/groq": "^0.0.3",
77+
"@ai-sdk/openai": "^0.0.70",
78+
"@anthropic-ai/sdk": "^0.30.1",
79+
"@cliqz/adblocker-playwright": "1.34.0",
80+
"@coral-xyz/anchor": "^0.30.1",
81+
"@discordjs/opus": "github:discordjs/opus",
82+
"@discordjs/rest": "2.4.0",
83+
"@discordjs/voice": "0.17.0",
84+
"@echogarden/espeak-ng-emscripten": "0.3.0",
85+
"@echogarden/kissfft-wasm": "0.2.0",
86+
"@echogarden/speex-resampler-wasm": "0.2.1",
87+
"@huggingface/transformers": "3.0.1",
88+
"@opendocsg/pdf2md": "0.1.31",
89+
"@solana/spl-token": "0.4.9",
90+
"@solana/web3.js": "1.95.4",
91+
"@supabase/supabase-js": "2.46.1",
92+
"@telegraf/types": "7.1.0",
93+
"@types/body-parser": "1.19.5",
94+
"@types/cors": "2.8.17",
95+
"@types/express": "5.0.0",
96+
"agent-twitter-client": "0.0.13",
97+
"ai": "^3.4.23",
98+
"alawmulaw": "6.0.0",
99+
"ansi-colors": "4.1.3",
100+
"anthropic-vertex-ai": "^1.0.0",
101+
"better-sqlite3": "11.5.0",
102+
"bignumber": "1.1.0",
103+
"bignumber.js": "9.1.2",
104+
"body-parser": "1.20.3",
105+
"capsolver-npm": "2.0.2",
106+
"cldr-segmentation": "2.2.1",
107+
"command-exists": "1.2.9",
108+
"commander": "12.1.0",
109+
"cors": "2.8.5",
110+
"cross-fetch": "4.0.0",
111+
"csv-writer": "1.6.0",
112+
"discord.js": "14.16.3",
113+
"espeak-ng": "1.0.2",
114+
"express": "4.21.1",
115+
"ffmpeg-static": "5.2.0",
116+
"figlet": "1.8.0",
117+
"fluent-ffmpeg": "2.1.3",
118+
"formdata-node": "6.0.3",
119+
"fs-extra": "11.2.0",
120+
"gaxios": "6.7.1",
121+
"gif-frames": "^0.4.1",
122+
"glob": "11.0.0",
123+
"graceful-fs": "4.2.11",
124+
"html-escaper": "3.0.3",
125+
"html-to-text": "9.0.5",
126+
"import-meta-resolve": "4.1.0",
127+
"jieba-wasm": "2.2.0",
128+
"js-sha1": "0.7.0",
129+
"json5": "2.2.3",
130+
"kuromoji": "0.1.2",
131+
"libsodium-wrappers": "0.7.15",
132+
"multer": "1.4.5-lts.1",
133+
"node-cache": "5.1.2",
134+
"node-llama-cpp": "3.1.1",
135+
"node-wav": "0.0.2",
136+
"nodejs-whisper": "0.1.18",
137+
"nodemon": "3.1.7",
138+
"onnxruntime-node": "1.20.0",
139+
"openai": "4.69.0",
140+
"pdfjs-dist": "4.7.76",
141+
"pg": "^8.13.1",
142+
"playwright": "1.48.2",
143+
"pm2": "5.4.2",
144+
"prism-media": "1.3.5",
145+
"pumpdotfun-sdk": "1.3.2",
146+
"puppeteer-extra": "3.3.6",
147+
"puppeteer-extra-plugin-capsolver": "2.0.1",
148+
"sql.js": "1.12.0",
149+
"sqlite-vec": "0.1.4-alpha.2",
150+
"srt": "0.0.3",
151+
"systeminformation": "5.23.5",
152+
"tar": "7.4.3",
153+
"telegraf": "4.16.3",
154+
"tiktoken": "1.0.17",
155+
"tinyld": "1.3.4",
156+
"together-ai": "^0.7.0",
157+
"unique-names-generator": "4.7.1",
158+
"uuid": "11.0.2",
159+
"uuidv4": "6.2.13",
160+
"wav": "1.0.2",
161+
"wav-encoder": "1.3.0",
162+
"wavefile": "11.0.0",
163+
"whisper-turbo": "0.11.0",
164+
"ws": "8.18.0",
165+
"yargs": "17.7.2",
166+
"youtube-dl-exec": "3.0.10"
167+
},
168+
"trustedDependencies": {
169+
"onnxruntime-node": "1.19.0",
170+
"@discordjs/opus": "github:discordjs/opus",
171+
"sharp": "^0.33.5"
172+
},
173+
"optionalDependencies": {
174+
"sharp": "0.33.5",
175+
"sqlite-vss-darwin-arm64": "0.1.2",
176+
"sqlite-vss-darwin-x64": "0.1.2",
177+
"sqlite-vss-linux-arm64": "^0.1.2",
178+
"sqlite-vss-linux-x64": "0.1.2",
179+
"sqlite-vss-win32-arm64": "^0.1.2",
180+
"sqlite-vss-win32-x64": "^0.1.2"
181+
}
182+
}

renovate.json core/renovate.json

File renamed without changes.

0 commit comments

Comments
 (0)