Skip to content

Commit

Permalink
Merge pull request #1 from Stride-Labs/kier/init
Browse files Browse the repository at this point in the history
Setup Echos Registry
  • Loading branch information
srph authored Nov 27, 2024
2 parents 077979a + b29f393 commit 492b9a4
Show file tree
Hide file tree
Showing 17 changed files with 3,164 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Echos Registry Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: v20.17.0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: pnpm install

- name: Schema validation
run: pnpm run build:validate

- name: Prettier check
run: pnpm run build:prettier

- name: Typecheck
run: pnpm run build:typecheck
41 changes: 41 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Auto Codegen

on:
push:
paths:
- "src/agents/**"

jobs:
codegen:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: v20.17.0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: pnpm install

- name: Run codegen
run: pnpm codegen

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore: regenerate entry file"
title: "Regenerate entry file"
body: "Auto-generated PR after changes in src/agents directory"
branch: "chore/auto-codegen"
base: main
delete-branch: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.DS_Store
**/.DS_Store
.vercel
dist
.vercel
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# echo-registry

This is the official Echo Agent Registry for the Echos ecosystem.

## Accessing Echo Agents

To access the Echo Agents, you can use the following URL:

```
https://registry.echos.fun/api/echos
```

## Register an Echo Agent

To register an Echo Agent, you need to create a new unique directory under `src` and add a new `echo.json` file. Feel free to use any of the existing `echo.json` files as a template.

When you're done, submit a PR to add your Echo Agent to the registry. When your PR is merged, your Echo Agent will be published in a few minutes after the background job completes.

## Publishing an Echo Agent

If you're not a maintainer, this section is not relevant to you.

We have a GitHub workflow that automatically regenerates the entry file and publishes that includes the newly added Echo Agent.

As long as this workflow is committed, Vercel will automatically update our serverless function to include the new Echo Agent.

## Maintenance

If you're not a maintainer, this section is not relevant to you.

This project requires node `v20` and `pnpm`. To install dependencies, run:

```
pnpm install
```

You can run the following commands to validate, format, and typecheck, and codegen the project:

```
pnpm build:validate
pnpm build:prettier
pnpm build:typecheck
pnpm build:codegen
```

To run the serverless function locally, run:

```
pnpm start
```
6 changes: 6 additions & 0 deletions api/echos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { VercelRequest, VercelResponse } from "@vercel/node";
import { echos } from "../src/echos";

export default function (_request: VercelRequest, response: VercelResponse) {
response.json({ echos });
}
Empty file added deploy
Empty file.
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "echo-registry",
"private": true,
"engine": "20.17",
"scripts": {
"build:codegen": "tsx src/codegen.ts",
"build:prettier": "pretty-quick --check --pattern 'src/**/*.{js,json,ts}'",
"build:typecheck": "tsc --noEmit",
"build:validate": "tsx scripts/schema.ts",
"build": "pnpm build:validate && pnpm run build:prettier && pnpm run build:validate && pnpm run build:typecheck && pnpm run build:codegen",
"start": "vercel dev --listen 4000",
"clean": "sh ./scripts/clean.sh"
},
"keywords": [],
"author": "Kier Borromeo <[email protected]>",
"dependencies": {
"@vercel/node": "^3.2.27",
"tiny-invariant": "^1.3.3",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"vercel": "^39.1.2"
},
"devDependencies": {
"@types/node": "^22.10.0",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"glob": "^11.0.0",
"pretty-quick": "^4.0.0",
"prettier": "^3.4.1"
}
}
Loading

0 comments on commit 492b9a4

Please sign in to comment.