Skip to content

Commit 1b6bfa2

Browse files
authored
Merge pull request #32 from ai16z/main
merge from main
2 parents a2cfc4d + 5d86a5b commit 1b6bfa2

File tree

100 files changed

+2584
-984
lines changed

Some content is hidden

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

100 files changed

+2584
-984
lines changed

.github/workflows/pr.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
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: add new feature')."
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')."

.github/workflows/release.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_type:
7+
description: "Type of release (prerelease, prepatch, patch, minor, preminor, major)"
8+
required: true
9+
default: "patch"
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: pnpm/action-setup@v3
20+
with:
21+
version: 8
22+
23+
- name: Configure Git
24+
run: |
25+
git config user.name "${{ github.actor }}"
26+
git config user.email "${{ github.actor }}@users.noreply.github.com"
27+
28+
- name: "Setup npm for npmjs"
29+
run: |
30+
npm config set registry https://registry.npmjs.org/
31+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
32+
33+
- name: Install Protobuf Compiler
34+
run: sudo apt-get install -y protobuf-compiler
35+
36+
- name: Install dependencies
37+
run: pnpm install
38+
39+
- name: Build packages
40+
run: pnpm run build
41+
42+
- name: Tag and Publish Packages
43+
id: tag_publish
44+
run: |
45+
npx lerna version ${{ github.event.inputs.release_type }} --conventional-commits --yes --no-private --force-publish
46+
npx lerna publish from-git --yes --dist-tag ${{ github.event.inputs.release_type == 'preminor' && 'next' || 'latest' }}
47+
48+
- name: Get Version Tag
49+
id: get_tag
50+
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
51+
52+
- name: Generate Release Body
53+
id: release_body
54+
run: |
55+
if [ -f CHANGELOG.md ]; then
56+
echo "body=$(cat CHANGELOG.md)" >> $GITHUB_OUTPUT
57+
else
58+
echo "body=No changelog provided for this release." >> $GITHUB_OUTPUT
59+
fi
60+
61+
- name: Create GitHub Release
62+
uses: actions/create-release@v1
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
66+
with:
67+
tag_name: ${{ steps.get_tag.outputs.TAG }}
68+
release_name: Release
69+
body_path: CHANGELOG.md
70+
draft: false
71+
prerelease: false

CHANGELOG.md

+212-1
Large diffs are not rendered by default.

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@
4545
4646
### Edit the .env file
4747

48-
Copy .env.example to .env and fill in the appropriate values
48+
Copy .env.example to .env and fill in the appropriate values.
4949

5050
```
5151
cp .env.example .env
5252
```
5353

54+
Note: .env is optional. If your planning to run multiple distinct agents, you can pass secrets through the character JSON
55+
5456
### Automatically Start Eliza
5557

5658
This will run everything to setup the project and start the bot with the default character.
@@ -61,7 +63,7 @@ sh scripts/start.sh
6163

6264
### Edit the character file
6365

64-
1. Open `packages/agent/src/character.ts` to modify the default character. Uncomment and edit.
66+
1. Open `agent/src/character.ts` to modify the default character. Uncomment and edit.
6567

6668
2. To load custom characters:
6769
- Use `pnpm start --characters="path/to/your/character.json"`

README_IT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ pnpm install --include=optional sharp
8989

9090
## Cronologia Stelle
9191

92-
[![Grafico Cronologia Stelle](https://api.star-history.com/svg?repos=ai16z/eliza&type=Date)](https://star-history.com/#ai16z/eliza&Date)
92+
[![Grafico Cronologia Stelle](https://api.star-history.com/svg?repos=ai16z/eliza&type=Date)](https://star-history.com/#ai16z/eliza&Date)
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/agent/src/index.ts agent/src/index.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,10 @@ export async function loadCharacters(
5858
?.split(",")
5959
.map((path) => path.trim())
6060
.map((path) => {
61-
if (path.startsWith("../characters")) {
62-
return `../${path}`;
63-
}
64-
if (path.startsWith("characters")) {
65-
return `../../${path}`;
66-
}
67-
if (path.startsWith("./characters")) {
68-
return `../.${path}`;
69-
}
70-
return path;
61+
if (path[0] === "/") return path; // handle absolute paths
62+
// assume relative to the project root where pnpm is ran
63+
return `../${path}`;
7164
});
72-
7365
const loadedCharacters = [];
7466

7567
if (characterPaths?.length > 0) {
@@ -96,6 +88,8 @@ export async function loadCharacters(
9688
loadedCharacters.push(character);
9789
} catch (e) {
9890
console.error(`Error loading character from ${path}: ${e}`);
91+
// don't continue to load if a specified file is not found
92+
process.exit(1);
9993
}
10094
}
10195
}

packages/agent/tsconfig.json agent/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
55
"rootDir": ".",

docs/docs/community/contributing.md

+102
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,108 @@ By internalizing the OODA Loop, you can quickly identify areas where you can mak
7878
- Leverage AI assistants to help with tasks like code generation, document summarization, and content creation.
7979
- Collaborate with other community members to divide and conquer larger initiatives.
8080

81+
---
82+
83+
## Contributing Guidelines
84+
85+
We value structured and clear contributions to ensure the project evolves efficiently. Below are the guidelines for submitting your contributions:
86+
87+
### Pull Request (PR) Title Format
88+
89+
Use the following format for PR titles to maintain consistency and clarity:
90+
91+
```
92+
feat|fix|docs|style|refactor|test|chore: title
93+
```
94+
95+
### Pull Request Description Template
96+
97+
When submitting a PR, use this template to ensure all relevant details are included:
98+
99+
```markdown
100+
<!-- Use this template by filling in information and copy and pasting relevant items out of the html comments. -->
101+
102+
# Relates to:
103+
104+
<!-- LINK TO ISSUE OR TICKET -->
105+
106+
<!-- This risks section is to be filled out before final review and merge. -->
107+
108+
# Risks
109+
110+
<!--
111+
Low, medium, large. List what kind of risks, and what could be affected.
112+
-->
113+
114+
# Background
115+
116+
## What does this PR do?
117+
118+
## What kind of change is this?
119+
120+
<!--
121+
Bug fixes (non-breaking change which fixes an issue)
122+
Improvements (misc. changes to existing features)
123+
Features (non-breaking change which adds functionality)
124+
Updates (new versions of included code)
125+
-->
126+
127+
<!-- This "Why" section is most relevant if there is no linked issue explaining why. If there is a related issue it might make sense to skip this why section. -->
128+
<!--
129+
## Why are we doing this? Any context or related work?
130+
-->
131+
132+
# Documentation changes needed?
133+
134+
<!--
135+
My changes do not require a change to the project documentation.
136+
My changes require a change to the project documentation.
137+
If a docs change is needed: I have updated the documentation accordingly.
138+
-->
139+
140+
<!-- Please show how you tested the PR. This will really help if the PR needs to be retested, and probably help the PR get merged quicker. -->
141+
142+
# Testing
143+
144+
## Where should a reviewer start?
145+
146+
## Detailed testing steps
147+
148+
<!--
149+
None, automated tests are fine.
150+
-->
151+
152+
<!--
153+
- As [anon/admin], go to [link]
154+
- [do action]
155+
- verify [result]
156+
-->
157+
158+
<!-- If there is a UI change, please include before and after screenshots or videos. This will speed up PRs being merged. It is extra nice to annotate screenshots with arrows or boxes pointing out the differences. -->
159+
<!--
160+
## Screenshots
161+
### Before
162+
### After
163+
-->
164+
165+
<!-- If there is anything about the deploy, please make a note. -->
166+
<!--
167+
# Deploy Notes
168+
-->
169+
170+
<!-- Copy and paste command-line output. -->
171+
<!--
172+
## Database changes
173+
-->
174+
175+
<!-- If there is something more than the automated steps, please specify deploy instructions. -->
176+
<!--
177+
## Deployment instructions
178+
-->
179+
```
180+
181+
---
182+
81183
## Recognition and Rewards
82184

83185
We believe in recognizing and rewarding contributors who go above and beyond to drive the project forward. Stand-out contributions may be eligible for:

docs/docs/core/agents.md

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ await memoryManager.createMemory({
252252
roomId,
253253
});
254254
```
255+
255256
---
256257

257258
## Further Reading

docs/docs/core/evaluators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 5
1010

1111
## Overview
1212

13-
Evaluators enable agents to:
13+
Evaluators enable agents to:
1414

1515
- Build long-term memory
1616
- Track goal progress

docs/docs/packages/plugins.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const character = {
111111
Create a new plugin by implementing the Plugin interface:
112112

113113
```typescript
114-
import { Plugin, Action, Evaluator, Provider } from "@ai16z/eliza/src/types";
114+
import { Plugin, Action, Evaluator, Provider } from "@ai16z/eliza";
115115

116116
const myCustomPlugin: Plugin = {
117117
name: "my-custom-plugin",

lerna.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": "0.1.3-alpha.2",
3+
"packages": ["packages/*"],
4+
"npmClient": "pnpm"
5+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"lint": "pnpm --dir packages/core lint && pnpm --dir packages/agent lint",
1414
"prettier-check": "npx prettier --check .",
1515
"prettier": "npx prettier --write .",
16+
"release": "pnpm build && pnpm prettier && npx lerna publish --no-private --force-publish",
1617
"clean": "bash ./scripts/clean.sh",
1718
"docker:build": "bash ./scripts/docker.sh build",
1819
"docker:run": "bash ./scripts/docker.sh run",

packages/adapter-postgres/.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!tsup.config.ts

packages/adapter-postgres/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ai16z/adapter-postgres",
3-
"version": "0.0.1",
4-
"main": "src/index.ts",
3+
"version": "0.1.3-alpha.2",
4+
"main": "dist/index.js",
55
"type": "module",
66
"types": "dist/index.d.ts",
77
"dependencies": {

packages/adapter-postgres/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "./src"
5+
"rootDir": "src"
66
},
7-
"include": ["src"]
7+
"include": ["src/**/*.ts"]
88
}

packages/adapter-sqlite/.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!tsup.config.ts

packages/adapter-sqlite/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@ai16z/adapter-sqlite",
3-
"version": "0.0.1",
4-
"main": "src/index.ts",
3+
"version": "0.1.3-alpha.2",
4+
"main": "dist/index.js",
55
"type": "module",
66
"types": "dist/index.d.ts",
77
"dependencies": {
88
"@ai16z/eliza": "workspace:*",
99
"@types/better-sqlite3": "7.6.11",
10-
"sqlite-vec": "0.1.4-alpha.2",
11-
"better-sqlite3": "11.5.0"
10+
"better-sqlite3": "11.5.0",
11+
"sqlite-vec": "0.1.4-alpha.2"
1212
},
1313
"devDependencies": {
1414
"tsup": "^8.3.5"

packages/adapter-sqlite/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "./src"
5+
"rootDir": "src"
66
},
7-
"include": ["src"]
7+
"include": ["src/**/*.ts"]
88
}

packages/adapter-sqljs/.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
3+
!dist/**
4+
!package.json
5+
!readme.md
6+
!tsup.config.ts

packages/adapter-sqljs/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@ai16z/adapter-sqljs",
3-
"version": "0.0.1",
3+
"version": "0.1.3-alpha.2",
44
"main": "dist/index.js",
55
"type": "module",
66
"types": "dist/index.d.ts",
77
"dependencies": {
88
"@ai16z/eliza": "workspace:*",
99
"@types/sql.js": "1.4.9",
10-
"uuid": "11.0.2",
11-
"sql.js": "1.12.0"
10+
"sql.js": "1.12.0",
11+
"uuid": "11.0.2"
1212
},
1313
"devDependencies": {
1414
"tsup": "^8.3.5"

packages/adapter-sqljs/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "./src"
5+
"rootDir": "src"
66
},
7-
"include": ["src"]
7+
"include": ["src/**/*.ts"]
88
}

0 commit comments

Comments
 (0)