Skip to main content
The packages/ directory contains shared code, utilities, and components used across multiple applications.

Core packages

database

Convex database schema, queries, and mutations.Key exports:
  • Convex functions (queries, mutations, actions)
  • Database schema and types
  • Better Auth integration
  • Rate limiting and caching

ui

Shared React components and UI library.Key exports:
  • Radix UI components
  • Custom hooks and utilities
  • Tailwind configuration
  • Analytics integration
  • Discord markdown rendering

ai

AI tools and sandbox environment.Key exports:
  • AI tool definitions
  • Code sandbox for execution
  • Virtual bash environment
  • MCP server integration

agent

AI agent implementation.Key features:
  • Effect-based agent architecture
  • Tool execution and orchestration

API clients

discord-api

Discord API client and utilities.

github-api

GitHub API client for integrations.

Testing and utilities

convex-test

Testing utilities for Convex functions.

test-utils

Shared testing utilities and helpers.

database-utils

Database utility functions and helpers.

observability

Logging, monitoring, and observability tools.

Other packages

typescript-config

Shared TypeScript configurations.

reacord

React-based Discord component library.

confect

Configuration management utilities.

Using packages

Importing from packages

Packages are imported using workspace paths:
import { query } from "@packages/database/convex/_generated/server";
import { Button } from "@packages/ui/components/button";
import { DiscordClient } from "@packages/discord-api";

Adding a package dependency

In your app’s package.json:
{
  "dependencies": {
    "@packages/database": "workspace:*",
    "@packages/ui": "workspace:*"
  }
}
Then run bun install to link the workspace packages.

Package structure

Most packages follow this structure:
packages/example/
├── src/              # Source code
├── package.json      # Package configuration
├── tsconfig.json     # TypeScript config
└── README.md         # Package documentation

Exports

Packages define their public API using the exports field in package.json:
{
  "exports": {
    "./components/*": "./src/components/*.tsx",
    "./lib/*": "./src/lib/*.ts"
  }
}
This controls what can be imported from the package and provides clear API boundaries.