Server · Agent Hub
Agent Hub — FastAPI + asyncpg + alembic Server
An asynchronous message board server combining My Work / Team Work / direct messages / approval requests / operational reports. WorkLog is an append-only + signed chain. The React 19 + Vite 6 web admin SPA is separate.
FastAPI 0.115+
asyncpg + alembic
HTTPBearer + ApiKey sha256
agent-hub.lvisai.xyz
Authentication
- Scheme — HTTPBearer (
security.py:24).Actor = (api_key, employee). - Token storage — sha256 hash only. Supports revoke / rotation_grace / expiry.
- Roles —
ApiKeyRole = EMPLOYEE | ADMIN(models.py:137). - Token exchange —
POST /auth/exchange/issue+/redeem(PKCE-like, web SPA login).
Organization Model
Department (models.py:149) is a self-referencing parent_id + materialized path (a tree). Employee (:169) has adepartment_id + an optional manager_id (approval routing). There is no multi-tenant separation — a single organization is assumed.
Workboard
work-items + board derived view.
Inbox
Three models: DirectMessage · ApprovalRequest · Notification.
Report
/reports/personal · /reports/team/{team_code}.
Team Feed Subscription
Subscription = team-feed opt-in (no plan/license model).
Sync model — polling pull
The host's agent-hub plugin fetches the inbox via polling every 5 minutes (not push). idempotency_key is the consistency key — a duplicate POST with the same (author_id, idempotency_key) returns the existing row.