import { type Router as ExpressRouter } from "express"; import { type AgentProjectMarkerInspection } from "../core/agent-project-discovery.js"; import { deriveWorkflowCanvas, type RenderableWorkflow } from "../core/canvas-document.js"; import type { CanvasGraph } from "../core/canvas-graph.js"; import type { CanvasEnrichment } from "../core/canvas-enrichment.js"; /** Why a board is not a graph. `ok` is the only status carrying one. */ export type WorkflowGraphStatus = "ok" | "empty" | "preparing" | "error"; export interface WorkflowGraphResponse { /** The resolved absolute agent directory the board was derived from. */ path: string; /** The registry's display name — the board's panel title. */ name: string; status: WorkflowGraphStatus; /** The extracted graph; null for every status but "ok". */ graph: CanvasGraph | null; /** Deterministic enrichment derived from `graph`; null when there is none. */ enrichment: CanvasEnrichment | null; /** Human-readable explanation for "empty"/"error"; null otherwise. */ reason: string | null; /** True when the graph came from the extraction cache — no child process ran. */ cached: boolean; /** * The finished canvas document the pane renders via `srcdoc`. Present for EVERY status — * an empty board is still a renderable page, not a hole. */ document: string; } export interface WorkflowGraphRouterDeps { /** * Resolves an absolute agent path against the live registry; null when the * path is not registered. Called before anything touches disk. */ resolveWorkflow(agentPath: string): RenderableWorkflow | null; /** Seam for tests — defaults to the real `sapiom.json` inspection. */ inspectMarker?(dir: string): Promise; /** Seam for tests — defaults to the real derivation (which runs esbuild). */ deriveCanvas?: typeof deriveWorkflowCanvas; /** Seam for tests — defaults to `fs.realpath`. */ realpath?(p: string): Promise; } export declare function createWorkflowGraphRouter(deps: WorkflowGraphRouterDeps): ExpressRouter; //# sourceMappingURL=workflow-graph.d.ts.map