Skip to content

Commit 24dbabe

Browse files
authored
Merge branch 'develop' into realitySpiral/codescanning
2 parents 4a75972 + d187801 commit 24dbabe

File tree

61 files changed

+1567
-1335
lines changed

Some content is hidden

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

61 files changed

+1567
-1335
lines changed

.github/workflows/pr.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ jobs:
1010

1111
steps:
1212
- name: Check out the repository
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414

1515
- name: Validate PR title
1616
id: validate
1717
run: |
1818
PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
1919
echo "PR Title: $PR_TITLE"
20-
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore):\ .+ ]]; then
20+
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore)(\([a-zA-Z0-9-]+\))?:\ .+ ]]; then
2121
echo "PR title does not match the required pattern."
2222
exit 1
2323
fi
2424
2525
- name: Set status
2626
if: failure()
2727
run: |
28-
gh pr comment ${{ github.event.pull_request.number }} --body "❌ PR title does not match the required pattern. Please use the format: 'type: description' (e.g., 'feat|fix|docs|style|refactor|test|chore: title')."
28+
gh pr comment ${{ github.event.pull_request.number }} --body "❌ PR title does not match the required pattern. Please use one of these formats:
29+
- 'type: description' (e.g., 'feat: add new feature')
30+
- 'type(scope): description' (e.g., 'chore(core): update dependencies')"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## 🌍 README Translations
1414

15-
[中文说明](./README_CN.md) | [日本語の説明](./README_JA.md) | [한국어 설명](./README_KOR.md) | [Français](./README_FR.md) | [Português](./README_PTBR.md) | [Türkçe](./README_TR.md) | [Русский](./README_RU.md) | [Español](./README_ES.md) | [Italiano](./README_IT.md) | [ไทย](./README_TH.md) | [Deutsch](./README_DE.md) | [Tiếng Việt](./README_VI.md) | [עִברִית](https://github.com/elizaos/Elisa/blob/main/README_HE.md)
15+
[中文说明](./README_CN.md) | [日本語の説明](./README_JA.md) | [한국어 설명](./README_KOR.md) | [Français](./README_FR.md) | [Português](./README_PTBR.md) | [Türkçe](./README_TR.md) | [Русский](./README_RU.md) | [Español](./README_ES.md) | [Italiano](./README_IT.md) | [ไทย](./README_TH.md) | [Deutsch](./README_DE.md) | [Tiếng Việt](./README_VI.md) | [עִברִית](https://github.com/elizaos/Elisa/blob/main/README_HE.md) | [Tagalog](./README_TG.md)
1616

1717
## ✨ Features
1818

README_TG.md

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
2+
# Eliza 🤖
3+
4+
<div align="center">
5+
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
6+
</div>
7+
8+
<div align="center">
9+
10+
📖 [Dokumentasyon](https://elizaos.github.io/eliza/) | 🎯 [Mga Halimbawa](https://github.com/thejoven/awesome-eliza)
11+
12+
</div>
13+
14+
## ✨ Mga Tampok
15+
16+
- 🛠️ Kumpletong suporta sa [Discord](https://discord.com/), [Twitter](https://twitter.com/), at [Telegram](https://telegram.org/)
17+
- 🔗 Suporta para sa bawat modelo (Llama, Grok, OpenAI, Anthropic, atbp.)
18+
- 👥 Suporta para sa multi-agent at kuwarto
19+
- 📚 Madaling mag-load at makipag-ugnayan sa iyong mga dokumento
20+
- 💾 Naaakses na memorya at imbakan ng dokumento
21+
- 🚀 Napakabisa - maaaring gumawa ng sarili mong mga aksyon at kliyente
22+
- ☁️ Sinusuportahan ang maraming modelo (lokal na Llama, OpenAI, Anthropic, Groq, atbp.)
23+
- 📦 Madaling gamitin!
24+
25+
## Mga Tutorial sa Bidyo
26+
27+
[AI Agent Dev School](https://www.youtube.com/watch?v=ArptLpQiKfI&list=PLx5pnFXdPTRzWla0RaOxALTSTnVq53fKL)
28+
29+
## 🎯 Gamit ito para sa
30+
31+
- 🤖 [Mga Chatbot](https://en.wikipedia.org/wiki/Chatbot)
32+
- 🕵️ Mga Awtonomikong Ahente
33+
- 📈 Pagproseso ng Negosyo
34+
- 🎮 [Mga NPC sa mga Larong Kompyuter](https://en.wikipedia.org/wiki/Non-player_character)
35+
- 🧠 Pangangalakal
36+
37+
## 🚀 Pangkalahatang-ideya
38+
39+
### Mga Kinakailangan
40+
41+
- [Python 2.7+](https://www.python.org/downloads/)
42+
- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
43+
- [pnpm](https://pnpm.io/installation)
44+
45+
> **Paalala para sa mga Gumagamit ng Windows:** Kailangan ang [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install-manual).
46+
47+
### Gamitin ang Starter (Inirerekomenda)
48+
49+
```bash
50+
git clone https://github.com/elizaos/eliza-starter.git
51+
cd eliza-starter
52+
cp .env.example .env
53+
pnpm i && pnpm build && pnpm start
54+
```
55+
56+
Basahin ang [Dokumentasyon](https://elizaos.github.io/eliza/) upang matutunan kung paano ipasadya ang Eliza.
57+
58+
### Manwal na Pag-simula ng Eliza (Inirerekomenda lamang kung alam mo ang ginagawa mo)
59+
60+
```bash
61+
# Clone the repository
62+
git clone https://github.com/elizaos/eliza.git
63+
64+
# Checkout the latest release
65+
git checkout $(git describe --tags --abbrev=0)
66+
```
67+
68+
### Simulan ang Eliza gamit ang Gitpod
69+
70+
[![Buksan sa Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/elizaos/eliza/tree/main)
71+
72+
### Ipasadya ang .env File
73+
74+
Kopyahin ang `.env.example` sa `.env` at punan ang tamang mga halaga.
75+
76+
```bash
77+
cp .env.example .env
78+
```
79+
80+
### Awtomatikong Simulan ang Eliza
81+
82+
Ito ay magse-setup ng proyekto at sisimulan ang bot gamit ang kusang mapagpipilian na karakter.
83+
84+
```bash
85+
sh scripts/start.sh
86+
```
87+
88+
### Ipasadya ang Karakter File
89+
90+
1. Buksan ang `packages/core/src/defaultCharacter.ts` para baguhin ang kusang mapagpipilian na karakter.
91+
2. Mag-load ng pasadya na mga karakter:
92+
- Gamitin ang `pnpm start --characters="landas/sa/inyong/character.json"`
93+
- Puwedeng mag-load ng maraming karakter file sabay-sabay.
94+
3. Ikonekta ang Twitter (X):
95+
- Baguhin ang `"clients": []` sa `"clients": ["twitter"]` sa karakter file upang ikonekta ang Twitter.
96+
97+
### Manwal na Pag-simula ng Eliza
98+
99+
```bash
100+
pnpm i
101+
pnpm build
102+
pnpm start
103+
104+
# Linisin ang proyekto kung bumalik ka dito matapos ang mahabang panahon
105+
pnpm clean
106+
```
107+
108+
#### Karagdagang Mga Kinakailangan
109+
110+
Puwede mong kailangang mag-install ng [Sharp](https://sharp.pixelplumbing.com/). Kung may pagkakamali, subukang i-install ito gamit ang:
111+
112+
```bash
113+
pnpm install --include=optional sharp
114+
```
115+
116+
### Komunidad at Kontak
117+
118+
- [Mga Isyu sa GitHub](https://github.com/elizaos/eliza/issues): Para sa mga bug at mungkahi sa tampok.
119+
- [Discord](https://discord.gg/ai16z): Para sa pagbabahagi ng aplikasyon at pakikihalubilo sa komunidad.
120+
121+
## Mga Kontribyutor
122+
123+
<a href="https://github.com/elizaos/eliza/graphs/contributors">
124+
<img src="https://contrib.rocks/image?repo=elizaos/eliza" />
125+
</a>
126+
127+
## Kasaysayan ng mga Bituin
128+
129+
[![Tsart ng Kasaysayan ng mga Bituin](https://api.star-history.com/svg?repos=elizaos/eliza&type=Date)](https://star-history.com/#elizaos/eliza&Date)

agent/package.json

+60-60
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
{
2-
"name": "@elizaos/agent",
3-
"version": "0.1.7-alpha.1",
4-
"main": "src/index.ts",
5-
"type": "module",
6-
"scripts": {
7-
"start": "node --loader ts-node/esm src/index.ts",
8-
"dev": "node --loader ts-node/esm src/index.ts",
9-
"check-types": "tsc --noEmit"
10-
},
11-
"nodemonConfig": {
12-
"watch": [
13-
"src",
14-
"../core/dist"
15-
],
16-
"ext": "ts,json",
17-
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
18-
},
19-
"dependencies": {
20-
"@elizaos/adapter-postgres": "workspace:*",
21-
"@elizaos/adapter-redis": "workspace:*",
22-
"@elizaos/adapter-sqlite": "workspace:*",
23-
"@elizaos/client-auto": "workspace:*",
24-
"@elizaos/client-direct": "workspace:*",
25-
"@elizaos/client-discord": "workspace:*",
26-
"@elizaos/client-farcaster": "workspace:*",
27-
"@elizaos/client-lens": "workspace:*",
28-
"@elizaos/client-telegram": "workspace:*",
29-
"@elizaos/client-twitter": "workspace:*",
30-
"@elizaos/client-slack": "workspace:*",
31-
"@elizaos/core": "workspace:*",
32-
"@elizaos/plugin-0g": "workspace:*",
33-
"@elizaos/plugin-aptos": "workspace:*",
34-
"@elizaos/plugin-bootstrap": "workspace:*",
35-
"@elizaos/plugin-intiface": "workspace:*",
36-
"@elizaos/plugin-coinbase": "workspace:*",
37-
"@elizaos/plugin-conflux": "workspace:*",
38-
"@elizaos/plugin-evm": "workspace:*",
39-
"@elizaos/plugin-flow": "workspace:*",
40-
"@elizaos/plugin-story": "workspace:*",
41-
"@elizaos/plugin-goat": "workspace:*",
42-
"@elizaos/plugin-icp": "workspace:*",
43-
"@elizaos/plugin-image-generation": "workspace:*",
44-
"@elizaos/plugin-nft-generation": "workspace:*",
45-
"@elizaos/plugin-node": "workspace:*",
46-
"@elizaos/plugin-solana": "workspace:*",
47-
"@elizaos/plugin-starknet": "workspace:*",
48-
"@elizaos/plugin-ton": "workspace:*",
49-
"@elizaos/plugin-sui": "workspace:*",
50-
"@elizaos/plugin-tee": "workspace:*",
51-
"@elizaos/plugin-multiversx": "workspace:*",
52-
"@elizaos/plugin-near": "workspace:*",
53-
"@elizaos/plugin-zksync-era": "workspace:*",
54-
"readline": "1.3.0",
55-
"ws": "8.18.0",
56-
"yargs": "17.7.2"
57-
},
58-
"devDependencies": {
59-
"ts-node": "10.9.2",
60-
"tsup": "8.3.5"
61-
}
2+
"name": "@elizaos/agent",
3+
"version": "0.1.7-alpha.1",
4+
"main": "src/index.ts",
5+
"type": "module",
6+
"scripts": {
7+
"start": "node --loader ts-node/esm src/index.ts",
8+
"dev": "node --loader ts-node/esm src/index.ts",
9+
"check-types": "tsc --noEmit"
10+
},
11+
"nodemonConfig": {
12+
"watch": [
13+
"src",
14+
"../core/dist"
15+
],
16+
"ext": "ts,json",
17+
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
18+
},
19+
"dependencies": {
20+
"@elizaos/adapter-postgres": "workspace:*",
21+
"@elizaos/adapter-redis": "workspace:*",
22+
"@elizaos/adapter-sqlite": "workspace:*",
23+
"@elizaos/client-auto": "workspace:*",
24+
"@elizaos/client-direct": "workspace:*",
25+
"@elizaos/client-discord": "workspace:*",
26+
"@elizaos/client-farcaster": "workspace:*",
27+
"@elizaos/client-lens": "workspace:*",
28+
"@elizaos/client-telegram": "workspace:*",
29+
"@elizaos/client-twitter": "workspace:*",
30+
"@elizaos/client-slack": "workspace:*",
31+
"@elizaos/core": "workspace:*",
32+
"@elizaos/plugin-0g": "workspace:*",
33+
"@elizaos/plugin-aptos": "workspace:*",
34+
"@elizaos/plugin-bootstrap": "workspace:*",
35+
"@elizaos/plugin-intiface": "workspace:*",
36+
"@elizaos/plugin-coinbase": "workspace:*",
37+
"@elizaos/plugin-conflux": "workspace:*",
38+
"@elizaos/plugin-evm": "workspace:*",
39+
"@elizaos/plugin-flow": "workspace:*",
40+
"@elizaos/plugin-story": "workspace:*",
41+
"@elizaos/plugin-goat": "workspace:*",
42+
"@elizaos/plugin-icp": "workspace:*",
43+
"@elizaos/plugin-image-generation": "workspace:*",
44+
"@elizaos/plugin-nft-generation": "workspace:*",
45+
"@elizaos/plugin-node": "workspace:*",
46+
"@elizaos/plugin-solana": "workspace:*",
47+
"@elizaos/plugin-starknet": "workspace:*",
48+
"@elizaos/plugin-ton": "workspace:*",
49+
"@elizaos/plugin-sui": "workspace:*",
50+
"@elizaos/plugin-tee": "workspace:*",
51+
"@elizaos/plugin-multiversx": "workspace:*",
52+
"@elizaos/plugin-near": "workspace:*",
53+
"@elizaos/plugin-zksync-era": "workspace:*",
54+
"readline": "1.3.0",
55+
"ws": "8.18.0",
56+
"yargs": "17.7.2"
57+
},
58+
"devDependencies": {
59+
"ts-node": "10.9.2",
60+
"tsup": "8.3.5"
61+
}
6262
}

agent/src/index.ts

+38-7
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import fs from "fs";
6060
import path from "path";
6161
import { fileURLToPath } from "url";
6262
import yargs from "yargs";
63+
import net from "net";
6364

6465
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
6566
const __dirname = path.dirname(__filename); // get the name of the directory
@@ -489,7 +490,7 @@ export async function createAgent(
489490
}
490491

491492
let goatPlugin: any | undefined;
492-
if (getSecret(character, "ALCHEMY_API_KEY")) {
493+
if (getSecret(character, "EVM_PROVIDER_URL")) {
493494
goatPlugin = await createGoatPlugin((secret) =>
494495
getSecret(character, secret)
495496
);
@@ -560,7 +561,7 @@ export async function createAgent(
560561
getSecret(character, "COINBASE_NOTIFICATION_URI")
561562
? webhookPlugin
562563
: null,
563-
getSecret(character, "ALCHEMY_API_KEY") ? goatPlugin : null,
564+
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
564565
getSecret(character, "FLOW_ADDRESS") &&
565566
getSecret(character, "FLOW_PRIVATE_KEY")
566567
? flowPlugin
@@ -692,13 +693,30 @@ async function startAgent(
692693
}
693694
}
694695

696+
const checkPortAvailable = (port: number): Promise<boolean> => {
697+
return new Promise((resolve) => {
698+
const server = net.createServer();
699+
700+
server.once("error", (err: NodeJS.ErrnoException) => {
701+
if (err.code === "EADDRINUSE") {
702+
resolve(false);
703+
}
704+
});
705+
706+
server.once("listening", () => {
707+
server.close();
708+
resolve(true);
709+
});
710+
711+
server.listen(port);
712+
});
713+
};
714+
695715
const startAgents = async () => {
696716
const directClient = new DirectClient();
697-
const serverPort = parseInt(settings.SERVER_PORT || "3000");
717+
let serverPort = parseInt(settings.SERVER_PORT || "3000");
698718
const args = parseArguments();
699-
700719
let charactersArg = args.characters || args.character;
701-
702720
let characters = [defaultCharacter];
703721

704722
if (charactersArg) {
@@ -713,19 +731,32 @@ const startAgents = async () => {
713731
elizaLogger.error("Error starting agents:", error);
714732
}
715733

734+
// Find available port
735+
while (!(await checkPortAvailable(serverPort))) {
736+
elizaLogger.warn(
737+
`Port ${serverPort} is in use, trying ${serverPort + 1}`
738+
);
739+
serverPort++;
740+
}
741+
716742
// upload some agent functionality into directClient
717743
directClient.startAgent = async (character: Character) => {
718744
// wrap it so we don't have to inject directClient later
719745
return startAgent(character, directClient);
720746
};
747+
721748
directClient.start(serverPort);
722749

750+
if (serverPort !== parseInt(settings.SERVER_PORT || "3000")) {
751+
elizaLogger.log(`Server started on alternate port ${serverPort}`);
752+
}
753+
723754
elizaLogger.log(
724-
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents"
755+
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents. When running multiple agents, use client with different port `SERVER_PORT=3001 pnpm start:client`"
725756
);
726757
};
727758

728759
startAgents().catch((error) => {
729760
elizaLogger.error("Unhandled error in startAgents:", error);
730-
process.exit(1); // Exit the process after logging
761+
process.exit(1);
731762
});

0 commit comments

Comments
 (0)