Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPENAI_API_KEY=
USE_OPENAI_EMBEDDING=true
37 changes: 0 additions & 37 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,6 @@
],
"@typescript-eslint/no-useless-constructor": ["error"],
"@typescript-eslint/no-non-null-assertion": "error",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "lodash",
"importNames": ["isNull"],
"message": "Please use isNull from @tribes/core instead."
},
{
"name": "ethers",
"importNames": ["logger"],
"message": "Please use logger from @tribes/core instead."
},
{
"name": "console",
"importNames": ["assert"],
"message": "Please use assert from 'assert' instead."
},
{
"name": "aws-sdk",
"importNames": ["DynamoDB"],
"message": "Please import AWS and use as AWS.DynamoDB instead."
},
{
"name": "@wagmi/core",
"importNames": ["getPublicClient"],
"message": "Do not use getPublicClient directly. Use basePublicClient instead."
},
{
"name": "@reown/appkit/networks",
"importNames": ["base", "mainnet"],
"message": "Do not use base directly. Use supported_chains instead."
}
]
}
],
"prettier/prettier": "error",
"no-async-promise-executor": "off",
"space-before-function-paren": "off",
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches:
- '**'
pull_request:
types: [opened, edited]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Build project
run: bun run build

- name: Run linting
run: bun run lint
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ dist
node_modules
dist/
built
data/
data/knowledgeFiles
data/agent-keypair.json
data/sqlite.db
db.sqlite
.idea
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# Agent- ayaos Template

## Setup

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

```bash
bun install
```

## Run

```bash
bun dev
```
Binary file modified bun.lockb
Binary file not shown.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
"scripts": {
"build": "tsup src/index.ts --format esm --dts",
"lint": "eslint src/**/*.ts",
"dev": "tsx src/index.ts",
"dev": "tsx watch src/index.ts",
"start": "NODE_ENV=production tsx dist/index.js",
"agent": "dotenv --e /root/.agentcoin-fun/env.production -- tsx dist/index.js"
"agent": "tsx dist/index.js"
},
"dependencies": {
"@elizaos/core": "0.1.9",
"@tribesxyz/ayaos": "0.0.33"
"@tribesxyz/ayaos": "0.0.34",
"zod": "3.24.2"
},
"engines": {
"node": ">=22"
},
"resolutions": {
"onnxruntime-node": "1.20.0"
"onnxruntime-node": "1.20.0",
"zod": "3.24.2"
},
"devDependencies": {
"@changesets/cli": "2.28.1",
Expand Down
16 changes: 8 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { elizaLogger } from '@elizaos/core'
import { Agent } from '@tribesxyz/ayaos'
import { Agent, ayaLogger } from '@tribesxyz/ayaos'

async function main(): Promise<void> {
try {
const agent = new Agent()
const agent = new Agent({
dataDir: 'data'
})

agent.on('pre:llm', async (context) => {
console.log('llm:pre', context.memory)
ayaLogger.info('llm:pre', context.memory)
return true
})

agent.on('post:llm', async (context) => {
console.log('llm:post', context.memory)
ayaLogger.info('llm:post', context.memory)
return true
})

await agent.start()

elizaLogger.success('sdk initialized', agent.agentId)
ayaLogger.success('sdk initialized', agent.agentId)
} catch {
process.exit(1)
}
}

console.log('hello, agent!')
main().catch(elizaLogger.error)
main().catch(ayaLogger.error)