/** * Type definitions for Graph API */ import type { IncomingMessage, ServerResponse } from 'http'; export interface GraphNode { id: string; topic: string; decision?: string; reasoning?: string; decision_preview?: string; outcome: string | null; confidence: number | null; created_at: number; } export interface GraphEdge { from: string; to: string; relationship: string; reason: string | null; } export interface SimilarityEdge { from: string; to: string; relationship: 'similar'; similarity: number; } export interface CheckpointData { id: string; timestamp: number; summary: string; open_files: string[]; next_steps: string; status: string | null; } export interface DelegationHistoryEntry { id: string; fromAgentId: string; toAgentId: string; task: string; background: boolean; status: 'active' | 'completed' | 'failed'; startedAt: string; completedAt: string | null; duration: number | null; error: string | null; } export interface CodeActResult { success: boolean; value?: unknown; logs?: string[]; error?: string; metrics?: { durationMs: number; hostCallCount: number; memoryUsedBytes: number; }; } export interface CodeActExecutionContext { agentId?: string; allowedTools?: string[]; blockedTools?: string[]; } export interface GraphHandlerOptions { getAgentStates?: () => Map; getSwarmTasks?: (limit: number) => SwarmTask[]; getRecentDelegations?: (limit: number) => DelegationHistoryEntry[]; applyMultiAgentConfig?: (config: Record) => Promise; restartMultiAgentAgent?: (agentId: string) => Promise; stopMultiAgentAgent?: (agentId: string) => Promise; executeCodeAct?: (code: string, context?: CodeActExecutionContext) => Promise; healthService?: { compute(windowMs?: number): unknown; }; healthCheckService?: { check(): Promise; }; auditConversation?: (job: { conversation: string; scopes: Array<{ kind: string; id: string; }>; candidates?: Array<{ kind: string; topicHint?: string; confidence: number; summary: string; }>; }) => Promise<{ status: string; action: string; event_ids: string[]; reason?: string; }>; /** Sessions database for agent version tracking */ sessionsDb?: import('../sqlite.js').SQLiteDatabase; /** UI command queue for bidirectional Agent↔Viewer communication */ uiCommandQueue?: import('./ui-command-handler.js').UICommandQueue; } export interface SwarmTask { id: string; description: string; category: string; wave: number; status: string; claimed_by: string | null; claimed_at: number | null; completed_at: number | null; result: string | null; } export interface MemoryStats { total: number; thisWeek: number; thisMonth: number; checkpoints: number; outcomes: Record; topTopics: Array<{ topic: string; count: number; }>; } export interface SessionStats { total: number; bySource: Record; channels: Array<{ source: string; channelId: string; channelName: string | null; lastActive: number; messageCount: number; }>; } export type GraphHandlerFn = (req: IncomingMessage, res: ServerResponse) => Promise; //# sourceMappingURL=graph-api-types.d.ts.map