Agent Resources is a web application for managing Enclave characters, finding games, and more!
This project uses Bun as its runtime and package manager. Install Bun first if you don't already have it:
curl -fsSL https://bun.sh/install | bashThen:
-
Clone the repository:
git clone https://github.com/david-torres/agent-resources.git cd agent-resources -
Install the dependencies:
bun install
-
Create a
.envfile based on.env.distand fill in the required environment variables (Supabase credentials, OpenAI API key, and optional system message settings). -
Set up the database — see Database Setup below.
This project uses Supabase (hosted Postgres) for
storage and auth. Point SUPABASE_URL, SUPABASE_ANON_KEY, and
SUPABASE_SERVICE_ROLE_KEY in .env at your Supabase project before applying
any SQL.
schema.sql at the repo root contains the full baseline schema (profiles,
characters, classes, missions, conduits, pages, etc.). Apply it once against
a fresh database:
- In the Supabase dashboard: open the SQL editor, paste the contents of
schema.sql, and run it. - Or via
psql:psql "$SUPABASE_DB_URL" -f schema.sql
Migrations in supabase/migrations/ are applied in filename order on top of
the baseline schema. Run each one you haven't already applied against your
database (dashboard SQL editor or psql -f).
The two top-level files migration_nav_items.sql and seed_nav_items.sql
set up the dynamic navigation table and seed its default entries — run the
migration first, then the seed.
To (re)load class definitions from the seed util:
bun run seed:classesscripts/db-backup.sh runs pg_dump against the configured Supabase pooler
and writes a compressed dump to backups/. It reads SUPABASE_DB_PASS from
.env:
bun run db:backupNote: the host and user in scripts/db-backup.sh are hardcoded to the
project's Supabase instance — edit the script if you're pointing at your
own project.
To start the application in development mode (auto-reload on file changes):
bun run devTo start the application in production mode:
bun run startTo run the test suite:
bun testLong-lived personal access tokens can be created per user for agent integrations.
POST /profile/agent-tokenswith{ "name": "My agent" }creates a token and returns the raw token once.GET /profile/agent-tokenslists active tokens for the signed-in user.DELETE /profile/agent-tokens/:idrevokes a token.GET /api/agent/meverifies a token sent viaX-Agent-TokenorAuthorization: Bearer ....GET /api/agent/classesreturns the class list visible to that user.GET /api/agent/classes/:idreturns full details or teaser-only details based on the same release/unlock rules as the web app.
Server-side agent routes should use SUPABASE_SERVICE_ROLE_KEY so token-authenticated requests can evaluate ownership and unlock state without a Supabase browser session.
This project is built using:
New to the Enclave? Watch the video:
This project is licensed under the MIT License.
