/** * Dashboard API route handlers. * * Factory function creates a request handler that serves JSON endpoints * for blackboard entries, decisions, graph data, and operational status. * * CRITICAL: Never use console.log or process.stdout in this module. * The MCP StdioServerTransport owns stdout exclusively. */ import http from "node:http"; import { BlackboardEngine } from "../engine/blackboard.js"; import { DecisionEngine } from "../engine/decisions.js"; import { GraphEngine } from "../engine/graph.js"; import type { IAgentStore, IBlackboardStore, IDecisionStore, IGraphStore, IHandoffStore, IMetricsStore } from "../storage/interfaces.js"; /** * Create an API request handler for the given project root. * * Returns an async function that handles /api/* routes and returns true * if the request was handled, false if it should fall through to other * handlers (e.g., static file serving). * * Store instances are created once in the closure, not per-request. */ /** * Shared instances handed in by the MCP server (src/server.ts) so the * dashboard reads through the same stores, caches, and embedder as the tool * layer instead of wiring a parallel stack of its own. Optional: when absent * (standalone dashboard, tests), the handler constructs its own file-backed * instances exactly as before. */ export interface DashboardDeps { blackboardStore: IBlackboardStore; decisionStore: IDecisionStore; graphStore: IGraphStore; agentStore: IAgentStore; handoffStore: IHandoffStore; metricsStore: IMetricsStore; blackboardEngine: BlackboardEngine; decisionEngine: DecisionEngine; graphEngine: GraphEngine; } export declare function createApiHandler(projectRoot: string, deps?: DashboardDeps): (req: http.IncomingMessage, res: http.ServerResponse) => Promise; //# sourceMappingURL=api-routes.d.ts.map