How code-with-antonio/ai-teammates works
This is a bot-chat application: users create bots, converse with them individually or in groups, and can inspect a bot’s live sandbox desktop and metered usage. The main path runs from the dashboard through chat UI and server actions into Trigger.dev streaming, where model turns can use sandbox tools and hand off among bots. Bot configuration, group membership, billing gates, usage accounting, and desktop access are distinct supporting capabilities. Relationships below are limited to README or indexed source references and shown excerpts; several UI and action implementations were not sampled.
Main entry points: index.ts Postgres database · chat.ts Chat orchestration · usage.ts Usage ledger logic · chat.tsx Chat interface
Components 25
User experience
- Dashboard
app/(dashboard)/page.tsx - Chat page
app/(dashboard)/chats/[chatId]/page.tsx - Chat interface
components/chat.tsx - Message components
components/ai-elements/message.tsx - Prompt input
components/ai-elements/prompt-input.tsx - Desktop panel
components/desktop-panel.tsx
Chat runtime
- Chat actions
actions/chat.ts - Chat orchestration
trigger/chat.ts - Bot handoff
lib/handoff-tool.ts - Chat model
lib/model.ts
Bots and sandboxes
- Bot editor
components/bot-dialog.tsx - Bot actions
actions/bot.ts - Sandbox tools
lib/sandbox-tools.ts - Sandbox service
lib/daytona.ts
Billing and usage
- Usage page
app/(dashboard)/usage/page.tsx - Paywall hook
hooks/use-paywall.ts - Usage actions
actions/usage.ts - Usage ledger logic
lib/usage.ts - Billing rules
lib/billing.ts - Pricing page
app/(dashboard)/pricing/page.tsx
Persistence
- Chat queries
queries/chats.ts - Bot queries
queries/bots.ts - Application schema
db/schema.ts - Postgres database
db/index.ts
Other components
- User
Connections 33
- User → Dashboard: opens
app/(dashboard)/page.tsx - User → Chat page: opens
app/(dashboard)/chats/[chatId]/page.tsx - Chat page → Chat interface: renders
app/(dashboard)/chats/[chatId]/page.tsx - Chat interface → Prompt input: renders
components/chat.tsx - Chat interface → Message components: renders
components/chat.tsx - Chat interface → Chat actions: starts sessions
components/chat.tsx - Chat interface → Chat orchestration: loads transcript
components/chat.tsx - Dashboard → Bot editor: opens editor
app/(dashboard)/page.tsx - Bot editor → Bot actions: submits bot
components/bot-dialog.tsx - Chat actions → Chat queries: loads chat
actions/chat.ts - Chat actions → Chat orchestration: starts session
actions/chat.ts - Chat orchestration → Sandbox tools: provides tools
trigger/chat.ts - Chat orchestration → Chat model: streams model
trigger/chat.ts - Chat orchestration → Usage ledger logic: checks and records
trigger/chat.ts - Sandbox tools → Sandbox service: gets sandbox
lib/sandbox-tools.ts - Sandbox tools → Bot handoff: uses handoff types
lib/sandbox-tools.ts - Chat actions → Sandbox service: opens desktop
actions/chat.ts - Chat page → Desktop panel: renders
app/(dashboard)/chats/[chatId]/page.tsx - Bot actions → Sandbox service: manages sandbox
actions/bot.ts - Bot actions → Usage ledger logic: checks usage
actions/bot.ts - Bot actions → Postgres database: persists bot
actions/bot.ts - Chat actions → Postgres database: updates chats
actions/chat.ts - Chat queries → Postgres database: reads chats
queries/chats.ts - Bot queries → Postgres database: reads bots
queries/bots.ts - Postgres database → Application schema: uses schema
db/index.ts - Usage page → Usage ledger logic: gets usage
app/(dashboard)/usage/page.tsx - Paywall hook → Usage actions: checks allowance
hooks/use-paywall.ts - Usage actions → Usage ledger logic: checks usage
- Usage ledger logic → Postgres database: reads and writes ledger
lib/usage.ts - Usage ledger logic → Billing rules: checks subscription
lib/usage.ts - Paywall hook → Billing rules: checks plan
hooks/use-paywall.ts - User → Pricing page: views plans
- Chat orchestration → Postgres database: loads chat data
trigger/chat.ts