Skip to content

Commit

Permalink
Merge pull request #32 from ai16z/main
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
MarcoMandar authored Nov 20, 2024
2 parents a2cfc4d + 5d86a5b commit 1b6bfa2
Show file tree
Hide file tree
Showing 100 changed files with 2,584 additions and 984 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Set status
if: failure()
run: |
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')."
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')."
71 changes: 71 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

on:
workflow_dispatch:
inputs:
release_type:
description: "Type of release (prerelease, prepatch, patch, minor, preminor, major)"
required: true
default: "patch"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Configure Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: "Setup npm for npmjs"
run: |
npm config set registry https://registry.npmjs.org/
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install Protobuf Compiler
run: sudo apt-get install -y protobuf-compiler

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm run build

- name: Tag and Publish Packages
id: tag_publish
run: |
npx lerna version ${{ github.event.inputs.release_type }} --conventional-commits --yes --no-private --force-publish
npx lerna publish from-git --yes --dist-tag ${{ github.event.inputs.release_type == 'preminor' && 'next' || 'latest' }}
- name: Get Version Tag
id: get_tag
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT

- name: Generate Release Body
id: release_body
run: |
if [ -f CHANGELOG.md ]; then
echo "body=$(cat CHANGELOG.md)" >> $GITHUB_OUTPUT
else
echo "body=No changelog provided for this release." >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
with:
tag_name: ${{ steps.get_tag.outputs.TAG }}
release_name: Release
body_path: CHANGELOG.md
draft: false
prerelease: false
213 changes: 212 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
### Edit the .env file

Copy .env.example to .env and fill in the appropriate values
Copy .env.example to .env and fill in the appropriate values.

```
cp .env.example .env
```

Note: .env is optional. If your planning to run multiple distinct agents, you can pass secrets through the character JSON

### Automatically Start Eliza

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

### Edit the character file

1. Open `packages/agent/src/character.ts` to modify the default character. Uncomment and edit.
1. Open `agent/src/character.ts` to modify the default character. Uncomment and edit.

2. To load custom characters:
- Use `pnpm start --characters="path/to/your/character.json"`
Expand Down
2 changes: 1 addition & 1 deletion README_IT.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ pnpm install --include=optional sharp

## Cronologia Stelle

[![Grafico Cronologia Stelle](https://api.star-history.com/svg?repos=ai16z/eliza&type=Date)](https://star-history.com/#ai16z/eliza&Date)
[![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.
16 changes: 5 additions & 11 deletions packages/agent/src/index.ts → agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,10 @@ export async function loadCharacters(
?.split(",")
.map((path) => path.trim())
.map((path) => {
if (path.startsWith("../characters")) {
return `../${path}`;
}
if (path.startsWith("characters")) {
return `../../${path}`;
}
if (path.startsWith("./characters")) {
return `../.${path}`;
}
return path;
if (path[0] === "/") return path; // handle absolute paths
// assume relative to the project root where pnpm is ran
return `../${path}`;
});

const loadedCharacters = [];

if (characterPaths?.length > 0) {
Expand All @@ -96,6 +88,8 @@ export async function loadCharacters(
loadedCharacters.push(character);
} catch (e) {
console.error(`Error loading character from ${path}: ${e}`);
// don't continue to load if a specified file is not found
process.exit(1);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/tsconfig.json → agent/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": ".",
Expand Down
102 changes: 102 additions & 0 deletions docs/docs/community/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,108 @@ By internalizing the OODA Loop, you can quickly identify areas where you can mak
- Leverage AI assistants to help with tasks like code generation, document summarization, and content creation.
- Collaborate with other community members to divide and conquer larger initiatives.

---

## Contributing Guidelines

We value structured and clear contributions to ensure the project evolves efficiently. Below are the guidelines for submitting your contributions:

### Pull Request (PR) Title Format

Use the following format for PR titles to maintain consistency and clarity:

```
feat|fix|docs|style|refactor|test|chore: title
```

### Pull Request Description Template

When submitting a PR, use this template to ensure all relevant details are included:

```markdown
<!-- Use this template by filling in information and copy and pasting relevant items out of the html comments. -->

# Relates to:

<!-- LINK TO ISSUE OR TICKET -->

<!-- This risks section is to be filled out before final review and merge. -->

# Risks

<!--
Low, medium, large. List what kind of risks, and what could be affected.
-->

# Background

## What does this PR do?

## What kind of change is this?

<!--
Bug fixes (non-breaking change which fixes an issue)
Improvements (misc. changes to existing features)
Features (non-breaking change which adds functionality)
Updates (new versions of included code)
-->

<!-- 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. -->
<!--
## Why are we doing this? Any context or related work?
-->

# Documentation changes needed?

<!--
My changes do not require a change to the project documentation.
My changes require a change to the project documentation.
If a docs change is needed: I have updated the documentation accordingly.
-->

<!-- 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. -->

# Testing

## Where should a reviewer start?

## Detailed testing steps

<!--
None, automated tests are fine.
-->

<!--
- As [anon/admin], go to [link]
- [do action]
- verify [result]
-->

<!-- 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. -->
<!--
## Screenshots
### Before
### After
-->

<!-- If there is anything about the deploy, please make a note. -->
<!--
# Deploy Notes
-->

<!-- Copy and paste command-line output. -->
<!--
## Database changes
-->

<!-- If there is something more than the automated steps, please specify deploy instructions. -->
<!--
## Deployment instructions
-->
```

---

## Recognition and Rewards

We believe in recognizing and rewarding contributors who go above and beyond to drive the project forward. Stand-out contributions may be eligible for:
Expand Down
1 change: 1 addition & 0 deletions docs/docs/core/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ await memoryManager.createMemory({
roomId,
});
```

---

## Further Reading
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/evaluators.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_position: 5

## Overview

Evaluators enable agents to:
Evaluators enable agents to:

- Build long-term memory
- Track goal progress
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/packages/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const character = {
Create a new plugin by implementing the Plugin interface:

```typescript
import { Plugin, Action, Evaluator, Provider } from "@ai16z/eliza/src/types";
import { Plugin, Action, Evaluator, Provider } from "@ai16z/eliza";

const myCustomPlugin: Plugin = {
name: "my-custom-plugin",
Expand Down
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "0.1.3-alpha.2",
"packages": ["packages/*"],
"npmClient": "pnpm"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint": "pnpm --dir packages/core lint && pnpm --dir packages/agent lint",
"prettier-check": "npx prettier --check .",
"prettier": "npx prettier --write .",
"release": "pnpm build && pnpm prettier && npx lerna publish --no-private --force-publish",
"clean": "bash ./scripts/clean.sh",
"docker:build": "bash ./scripts/docker.sh build",
"docker:run": "bash ./scripts/docker.sh run",
Expand Down
6 changes: 6 additions & 0 deletions packages/adapter-postgres/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
4 changes: 2 additions & 2 deletions packages/adapter-postgres/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ai16z/adapter-postgres",
"version": "0.0.1",
"main": "src/index.ts",
"version": "0.1.3-alpha.2",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-postgres/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src"
"rootDir": "src"
},
"include": ["src"]
"include": ["src/**/*.ts"]
}
6 changes: 6 additions & 0 deletions packages/adapter-sqlite/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
8 changes: 4 additions & 4 deletions packages/adapter-sqlite/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@ai16z/adapter-sqlite",
"version": "0.0.1",
"main": "src/index.ts",
"version": "0.1.3-alpha.2",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@ai16z/eliza": "workspace:*",
"@types/better-sqlite3": "7.6.11",
"sqlite-vec": "0.1.4-alpha.2",
"better-sqlite3": "11.5.0"
"better-sqlite3": "11.5.0",
"sqlite-vec": "0.1.4-alpha.2"
},
"devDependencies": {
"tsup": "^8.3.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-sqlite/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src"
"rootDir": "src"
},
"include": ["src"]
"include": ["src/**/*.ts"]
}
6 changes: 6 additions & 0 deletions packages/adapter-sqljs/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
6 changes: 3 additions & 3 deletions packages/adapter-sqljs/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@ai16z/adapter-sqljs",
"version": "0.0.1",
"version": "0.1.3-alpha.2",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@ai16z/eliza": "workspace:*",
"@types/sql.js": "1.4.9",
"uuid": "11.0.2",
"sql.js": "1.12.0"
"sql.js": "1.12.0",
"uuid": "11.0.2"
},
"devDependencies": {
"tsup": "^8.3.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-sqljs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src"
"rootDir": "src"
},
"include": ["src"]
"include": ["src/**/*.ts"]
}
Loading

0 comments on commit 1b6bfa2

Please sign in to comment.