|
feat(M1): add Agent Node REST + WebSocket API to AI Hub
- NodeRegistryService: in-memory live node registry with rich EventBus
- emit() delivers all execution events to per-node and per-user subscribers
- EVENT_TYPES: 20 structured event types (task_start, sync_drift, retry, etc.)
- AgentNode DB model: persists node registrations + invite_token + last_status
- DB migration: auto-creates agent_nodes table + adds new columns
- REST API (/nodes):
GET /nodes - list all user's nodes (live+DB merged)
GET /nodes/{node_id} - full live status
GET /nodes/{node_id}/status - quick online/offline probe
POST /nodes/{node_id}/dispatch - dispatch shell/browser task to a node
- WebSocket API:
WS /nodes/{node_id}/stream - single-node live execution stream
WS /nodes/stream/all - multi-node global bus (split-pane UI ready)
|
|---|
|
|
| ai-hub/app/api/routes/api.py |
|---|
| ai-hub/app/api/routes/nodes.py 0 → 100644 |
|---|
| ai-hub/app/api/schemas.py |
|---|
| ai-hub/app/app.py |
|---|
| ai-hub/app/core/services/node_registry.py 0 → 100644 |
|---|
| ai-hub/app/db/migrate.py |
|---|
| ai-hub/app/db/models.py |
|---|