/** Structural shape of a node — deliberately loose, so this module stays * decoupled from the generated API types and can also render a hand-written * graph that has not been deployed yet. */ export type DiagramNode = { uuid: string; slug?: string | null; name?: string | null; kind?: string | null; actionSlug?: string | null; integrationSlug?: string | null; toolUuid?: string | null; agentUuid?: string | null; /** Template slug for tool/agent nodes sourced from a template graph. */ templateSlug?: string | null; childrenUuids?: (string | null)[] | null; fallbackChildUuid?: string | null; config?: Record | null; position?: { x?: number; y?: number; } | null; }; export type DiagramOptions = { title?: string; direction?: string; /** Node slugs or uuids that bill credits — rendered with a 💳. */ paid?: string[]; /** Node slugs or uuids to mark red, e.g. the failing node in a trace. */ highlight?: string[]; }; export type DiagramResult = { diagram: string; format: "mermaid"; /** Structural problems worth saying out loud rather than drawing over. */ warnings: string[]; }; /** Actions that route rather than do work. Shared, so adding one to the * platform does not have to be mirrored in each renderer. */ export declare const ROUTING_ACTIONS: Set; export declare function isStart(node: DiagramNode | undefined): boolean; export declare function isEnd(node: DiagramNode | undefined): boolean; export declare function indexByUuid(nodes: DiagramNode[]): Map; /** Where the graph begins — the `start` node, or the first node if it has none. */ export declare function findStart(nodes: DiagramNode[]): DiagramNode | undefined; /** * Whether a user-supplied `--paid` / `--highlight` token names this node. * Slugs repeat within a release, so a slug token marks every node carrying it; * pass a uuid to mark exactly one. */ export declare function matchesNode(node: DiagramNode, needles: string[]): boolean; /** * A node's outgoing edges, in `childrenUuids` order, labelled by what the * routing node means. Shared because this encodes routing *semantics* — index * order, and the rule that a fallback pointing at the node's own next step is * the same arrow rather than a second one. Two copies would let the two formats * draw different graphs from one release. */ /** * A fallback pointing at the node's own next step: a failure here does not stop * the run. It is not a second arrow — it is the same one — so it shows as a mark * on the step rather than an edge. Silently dropping it makes a step that * survives a provider outage look like one that dies on it, which is the exact * misread this command exists to prevent. */ export declare function continuesOnFailure(node: DiagramNode): boolean; export declare function outgoingEdges(node: DiagramNode, byUuid: Map): { to: string; label?: string; dashed?: boolean; }[]; /** Structural problems worth saying out loud rather than drawing over. */ export declare function graphWarnings(nodes: DiagramNode[], byUuid: Map, reached: Set): string[]; /** What the node is, in words a user recognises. */ export declare function labelFor(node: DiagramNode): string; /** * `childrenUuids` order carries the routing semantics — index 0 of a `branch` * is the matched path, index 1 the unmatched one. Getting this backwards * inverts the diagram's meaning, so it is table-driven, never inferred. */ export declare function edgeLabels(node: DiagramNode, count: number): (string | undefined)[]; export declare function renderNodeDiagram(nodes: DiagramNode[], options?: DiagramOptions): DiagramResult; /** Node-shaped means: a uuid plus the fields a graph is walked by. */ export declare function isNodeArray(value: unknown): value is DiagramNode[]; /** * Pull the graph out of a CLI payload: `release get`, `release get-draft`, * `template get`, an ad-hoc `run get`, or a bare node array. */ export declare function extractNodes(payload: unknown): DiagramNode[] | undefined; /** The fenced block, ready to paste into a message, a PR, or the docs. */ export declare function toMermaidBlock(diagram: string): string; //# sourceMappingURL=nodeDiagram.d.ts.map