feat: add agent API and operational analytics
This commit is contained in:
1 parent
720ea0652a
commit
e8b730b592
65 files changed
+2650
-1214
No files matched your search
+7
-1
@@ -40,6 +40,7 @@ import { createConfigRouter } from './routes/config.js';
|
||||
import { createLoginRouter } from './routes/login.js';
|
||||
import { createDashboardAuth, createDashboardSessionRouter } from './auth.js';
|
||||
import { resolveDashboardAssets } from './dashboard-assets.js';
|
||||
import { createAgentRouter, createHealthRouter } from './routes/agent.js';
|
||||
|
||||
export type { BotStats, ActivityItem, LogEntry, RuntimeConfig } from './types.js';
|
||||
|
||||
@@ -120,8 +121,12 @@ export class WebServer {
|
||||
throw new Error('Web dashboard requires web.authToken or WEB_DASHBOARD_TOKEN');
|
||||
}
|
||||
this.app.use(express.json({ limit: '64kb' }));
|
||||
this.app.use(createHealthRouter());
|
||||
this.app.use(createDashboardSessionRouter(dashboardToken));
|
||||
this.app.use(createDashboardAuth(dashboardToken));
|
||||
this.app.use(createDashboardAuth(dashboardToken, {
|
||||
readToken: this.config.web.agentReadToken,
|
||||
controlToken: this.config.web.agentControlToken,
|
||||
}));
|
||||
|
||||
const dashboardAssets = resolveDashboardAssets(this.workspaceDirectory);
|
||||
|
||||
@@ -140,6 +145,7 @@ export class WebServer {
|
||||
this.app.use(express.static(dashboardAssets.directory, { index: false }));
|
||||
|
||||
const ctx = this.context();
|
||||
this.app.use('/api', createAgentRouter(ctx));
|
||||
this.app.use('/api', createStatsRouter(ctx));
|
||||
this.app.use('/api', createChatsRouter(ctx));
|
||||
this.app.use('/api', createConversationsRouter(ctx));
|
||||
|
||||
Reference in new issue
Block a user