Skip to content

Commit fd065d2

Browse files
authored
Merge branch 'develop' into bug-1270-incorrect-fallback
2 parents 1d5c86a + 4d04b8b commit fd065d2

File tree

50 files changed

+1334
-1298
lines changed

Some content is hidden

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

50 files changed

+1334
-1298
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')"

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

+36-5
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
@@ -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
});

client/package.json

+45-45
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
{
2-
"name": "eliza-client",
3-
"private": true,
4-
"version": "0.1.7-alpha.1",
5-
"type": "module",
6-
"scripts": {
7-
"dev": "vite",
8-
"build": "vite build",
9-
"check-types": "tsc --noEmit",
10-
"lint": "eslint .",
11-
"preview": "vite preview"
12-
},
13-
"dependencies": {
14-
"@elizaos/core": "workspace:*",
15-
"@radix-ui/react-dialog": "1.1.2",
16-
"@radix-ui/react-separator": "1.1.0",
17-
"@radix-ui/react-slot": "1.1.0",
18-
"@radix-ui/react-tooltip": "1.1.4",
19-
"@tanstack/react-query": "5.61.0",
20-
"class-variance-authority": "0.7.1",
21-
"clsx": "2.1.1",
22-
"lucide-react": "0.460.0",
23-
"react": "18.3.1",
24-
"react-dom": "18.3.1",
25-
"react-router-dom": "6.22.1",
26-
"tailwind-merge": "2.5.5",
27-
"tailwindcss-animate": "1.0.7",
28-
"vite-plugin-top-level-await": "1.4.4",
29-
"vite-plugin-wasm": "3.3.0"
30-
},
31-
"devDependencies": {
32-
"@eslint/js": "9.16.0",
33-
"@types/node": "22.8.4",
34-
"@types/react": "18.3.12",
35-
"@types/react-dom": "18.3.1",
36-
"@vitejs/plugin-react": "4.3.3",
37-
"autoprefixer": "10.4.20",
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",
43-
"typescript": "5.6.3",
44-
"typescript-eslint": "8.11.0",
45-
"vite": "link:@tanstack/router-plugin/vite"
46-
}
2+
"name": "eliza-client",
3+
"private": true,
4+
"version": "0.1.7-alpha.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"check-types": "tsc --noEmit",
10+
"lint": "eslint .",
11+
"preview": "vite preview"
12+
},
13+
"dependencies": {
14+
"@elizaos/core": "workspace:*",
15+
"@radix-ui/react-dialog": "1.1.2",
16+
"@radix-ui/react-separator": "1.1.0",
17+
"@radix-ui/react-slot": "1.1.0",
18+
"@radix-ui/react-tooltip": "1.1.4",
19+
"@tanstack/react-query": "5.61.0",
20+
"class-variance-authority": "0.7.1",
21+
"clsx": "2.1.1",
22+
"lucide-react": "0.460.0",
23+
"react": "18.3.1",
24+
"react-dom": "18.3.1",
25+
"react-router-dom": "6.22.1",
26+
"tailwind-merge": "2.5.5",
27+
"tailwindcss-animate": "1.0.7",
28+
"vite-plugin-top-level-await": "1.4.4",
29+
"vite-plugin-wasm": "3.3.0"
30+
},
31+
"devDependencies": {
32+
"@eslint/js": "9.16.0",
33+
"@types/node": "22.8.4",
34+
"@types/react": "18.3.12",
35+
"@types/react-dom": "18.3.1",
36+
"@vitejs/plugin-react": "4.3.3",
37+
"autoprefixer": "10.4.20",
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",
43+
"typescript": "5.6.3",
44+
"typescript-eslint": "8.11.0",
45+
"vite": "link:@tanstack/router-plugin/vite"
46+
}
4747
}

0 commit comments

Comments
 (0)