import type { CanvasGraph } from "./canvas-graph.js"; import type { CanvasEnrichment } from "./canvas-enrichment.js"; import { type CanvasMapInput } from "./canvas-map-steps.js"; export interface RenderableWorkflow { path: string; name: string; definitionId: number | null; activeBuildRunStatus?: string | null; /** "unavailable" = the signed-in account can't see the linked definition. * Absent = unknown. */ definitionAccess?: "visible" | "unavailable"; } export interface DeriveCanvasOptions { /** * Force extraction even when the project's dependencies aren't installed, * so the honest esbuild error panel is built instead of the calm * "preparing" placeholder. */ surfaceErrorOnMissingDeps?: boolean; /** Provenance check evaluated on a cache miss immediately before the * extractor child starts. */ authorizeBeforeExtraction?: () => boolean | Promise; /** Lifecycle/test hook immediately before the launch-boundary recheck. */ beforeExtractionLaunchAuthorization?: () => void | Promise; /** This agent's entry in the project map, at the ref the map is drawn at. */ map?: CanvasMapInput | null; /** The agent has no `sapiom.json` to extract from: draw the map alone. */ mapOnly?: boolean; } /** Everything derived for ONE agent's Canvas: the graph on the board, its * deterministic enrichment, and the finished document. */ export interface WorkflowCanvasDerivation { /** "ok": extracted and rendered. "preparing": dependencies aren't installed * yet, so extraction was skipped and the calm placeholder was built * instead. "error": extraction ran and failed — the honest error panel. */ status: "ok" | "preparing" | "error" | "cancelled"; graph: CanvasGraph | null; enrichment: CanvasEnrichment | null; /** The extraction failure reason ("error" only); null otherwise. */ reason: string | null; /** True when the graph came from the extraction cache — no child process ran. */ cached: boolean; /** The canvas document — byte-identical to what the render file would hold. */ document: string; } /** * Extracts `workflow`'s graph, joins the map's steps and edges when given, * and builds its canvas document. Nothing is written. Never throws for an * extraction failure: that comes back as `status: "error"` with the reason. */ export declare function deriveWorkflowCanvas(workflow: RenderableWorkflow, options?: DeriveCanvasOptions): Promise; //# sourceMappingURL=canvas-document.d.ts.map