How jdhubbard777/agentus.app works
AgentUS is a specialist-hiring product: customers configure named specialists, use them interactively, and define unattended workflows whose runs and outcomes are retained. The documented architecture separates interactive chat through the OpenClaw gateway from webhook/scheduled dispatch, which calls model APIs directly and records results and token costs in D1. The dashboard and Worker expose the product’s workflow, specialist, account, and administration capabilities; provisioning connects specialist instances to Hetzner VMs. Several route implementations were not sampled, so those branches reflect README capability descriptions rather than inspected call chains.
Main entry points: worker.ts HTTP and scheduled entry · App.tsx Dashboard routes · dispatcher.ts Workflow dispatcher · provision.ts VM provisioning
Components 26
Customer dashboard
- Dashboard routes
frontend/src/App.tsx - Session and user state
frontend/src/context/AuthContext.tsx - Specialist workspace
frontend/src/pages/Team.tsx - Workflow builder
frontend/src/pages/WorkflowBuilder.tsx - Run history
frontend/src/pages/WorkflowHistory.tsx - Administration
frontend/src/pages/AdminHetznerPage.tsx
Worker API
- HTTP and scheduled entry
backend/src/worker.ts - Authentication
backend/src/routes/auth.ts - Workflow endpoints
backend/src/routes/workflows.ts - Dispatcher endpoints
backend/src/routes/dispatcher.ts - Specialist endpoints
backend/src/routes/personas.ts - Task run endpoints
backend/src/routes/taskRuns.ts - Token and role checks
backend/src/middleware/auth.ts
Specialist execution
- Interactive chat
backend/src/routes/chat.ts - OpenClaw gateway
- Workflow dispatcher
backend/src/routes/dispatcher.ts - Direct model runtime
backend/src/runtime/directModelRuntime.ts - Slack, email, webhook
Product state
- Cloudflare D1
- D1 query adapter
backend/src/database/db.ts - Workflow and task records
backend/src/database/repositories/workflowRepository.ts - Instance records
backend/src/database/repositories/instanceRepository.ts
Provisioning and operations
- VM provisioning
backend/src/workflows/provision.ts - Hetzner Cloud
backend/src/providers/hetzner.js - Warm VM pool
backend/src/warmPool/warmPoolManager.ts
Other components
- Customer
Connections 32
- Customer → Dashboard routes: uses
- Dashboard routes → Session and user state: checks session
frontend/src/App.tsx - Dashboard routes → Specialist workspace: routes to
frontend/src/App.tsx - Dashboard routes → Workflow builder: routes to
frontend/src/App.tsx - Dashboard routes → Run history: routes to
frontend/src/App.tsx - Dashboard routes → Administration: routes to
frontend/src/App.tsx - Dashboard routes → HTTP and scheduled entry: calls API
- HTTP and scheduled entry → Authentication: mounts
backend/src/worker.ts - HTTP and scheduled entry → Workflow endpoints: mounts
backend/src/worker.ts - HTTP and scheduled entry → Dispatcher endpoints: mounts
backend/src/worker.ts - HTTP and scheduled entry → Specialist endpoints: mounts
backend/src/worker.ts - HTTP and scheduled entry → Task run endpoints: mounts
backend/src/worker.ts - HTTP and scheduled entry → Token and role checks: applies
backend/src/worker.ts - Customer → Interactive chat: chats with specialist
- Interactive chat → OpenClaw gateway: uses gateway
- Customer → Workflow builder: configures
- Workflow endpoints → Workflow and task records: persists workflows
- Customer → Workflow dispatcher: triggers work
- Workflow dispatcher → Direct model runtime: calls model API
- Workflow dispatcher → Slack, email, webhook: delivers output
- Workflow dispatcher → Workflow and task records: records runs and costs
- Task run endpoints → Workflow and task records: serves run records
- HTTP and scheduled entry → D1 query adapter: uses D1 access
backend/src/worker.ts - D1 query adapter → Cloudflare D1: queries
backend/src/database/db.ts - Workflow and task records → Cloudflare D1: stores records
- Instance records → Cloudflare D1: stores instances
- HTTP and scheduled entry → VM provisioning: starts provisioning
- VM provisioning → Hetzner Cloud: creates VMs
- VM provisioning → Instance records: tracks instances
- HTTP and scheduled entry → Warm VM pool: runs scheduled refill
backend/src/worker.ts - Warm VM pool → VM provisioning: requests capacity
- Administration → HTTP and scheduled entry: manages service