feat(gateway): add system.services and dashboard services grid

This commit is contained in:
William Valentin
2026-02-14 00:42:41 -08:00
parent 4f3810ba4c
commit 0493660e7d
9 changed files with 369 additions and 11 deletions
+6 -1
View File
@@ -27,6 +27,7 @@ import {
createRoutingHandlers,
createHistoryHandlers,
} from './handlers/index.js';
import { discoverServices } from './handlers/services.js';
import type { TokenUsageEntry } from './handlers/system.js';
import type { SessionManager } from '../session/manager.js';
import type { Config } from '../config/index.js';
@@ -39,6 +40,7 @@ import type { MemoryStore } from '../memory/store.js';
import type { CommandRegistry } from '../commands/index.js';
import type { ComponentRegistry } from '../intents/index.js';
import type { RoutingPolicy } from '../routing/index.js';
import type { ChannelRegistry } from '../channels/index.js';
export interface GatewayServerConfig {
port: number;
@@ -58,7 +60,7 @@ export interface GatewayServerConfig {
config?: Config;
/** Optional callback for system.restart. Should trigger graceful shutdown + process restart. */
restart?: () => Promise<void>;
channelRegistry?: { list(): Array<{ readonly name: string; readonly status: string }> };
channelRegistry?: ChannelRegistry;
/** Optional webhook handler for inbound webhook HTTP routes. */
webhookHandler?: WebhookHandler;
/** Optional Gmail handler for Pub/Sub push notifications. */
@@ -116,6 +118,9 @@ export class GatewayServer {
getChannels: this.config.channelRegistry
? () => this.config.channelRegistry!.list().map(a => ({ name: a.name, status: a.status }))
: undefined,
getServices: this.config.config && this.config.channelRegistry
? () => discoverServices(this.config.config!, this.config.channelRegistry!)
: undefined,
getUsage: () => ({
totalSessions: this.config.sessionManager.listSessions().length,
activeConnections: this.sessionBridge.connectionCount,