/** * Workflow graph store helpers (B wave-3 file-size split). * * Extracted verbatim from `workflow-graph-store.ts`: the canonical * `PEAKS_*` error-code constants, the `GraphStoreError` shape + * `makeError` factory, the session-root/path resolution helpers, the * cycle detector, and the fresh-graph builder. The on-disk graph * record layout is defined by `workflow-graph-types.ts` and is NOT * altered by this move — `emptyGraph` emits the identical node/edge * shape as before. `workflow-graph-store.ts` re-exports every public * name from this module so all importers keep resolving the same path. */ import { type WorkflowGraph, type WorkflowGraphNode, type WorkflowId } from './workflow-graph-types.js'; export declare const PEAKS_GRAPH_NOT_FOUND = "PEAKS_GRAPH_NOT_FOUND"; export declare const PEAKS_GRAPH_CORRUPTED = "PEAKS_GRAPH_CORRUPTED"; export declare const PEAKS_GRAPH_CYCLE = "PEAKS_GRAPH_CYCLE"; export declare const PEAKS_GRAPH_REF_BROKEN = "PEAKS_GRAPH_REF_BROKEN"; export declare const PEAKS_GRAPH_NODE_REQUIRED = "PEAKS_GRAPH_NODE_REQUIRED"; export declare const PEAKS_GRAPH_NODE_NOT_PREPARED = "PEAKS_GRAPH_NODE_NOT_PREPARED"; export declare const PEAKS_GRAPH_NODE_KIND_INVALID = "PEAKS_GRAPH_NODE_KIND_INVALID"; export declare const PEAKS_NODE_EXISTS = "PEAKS_NODE_EXISTS"; export declare const PEAKS_NODE_TRANSITION_INVALID = "PEAKS_NODE_TRANSITION_INVALID"; export declare const PEAKS_ENVELOPE_NOT_RECEIVED = "PEAKS_ENVELOPE_NOT_RECEIVED"; export declare const PEAKS_ENVELOPE_GRAPH_MISMATCH = "PEAKS_ENVELOPE_GRAPH_MISMATCH"; export declare const PEAKS_TERMINAL_REASON_INVALID = "PEAKS_TERMINAL_REASON_INVALID"; export declare const PEAKS_TERMINALIZE_ATOMICITY_FAILED = "PEAKS_TERMINALIZE_ATOMICITY_FAILED"; export declare const PEAKS_UNCONSUMED_ENVELOPE = "PEAKS_UNCONSUMED_ENVELOPE"; export declare const PEAKS_DEPENDENCY_NOT_CONSUMED = "PEAKS_DEPENDENCY_NOT_CONSUMED"; export declare const PEAKS_WORKFLOW_OWNS_PRESENCE_CLEAR = "PEAKS_WORKFLOW_OWNS_PRESENCE_CLEAR"; export declare const PEAKS_SESSION_NOT_BOUND = "PEAKS_SESSION_NOT_BOUND"; export declare const PEAKS_CALLER_NOT_RESOLVED = "PEAKS_CALLER_NOT_RESOLVED"; export interface GraphStoreError extends Error { readonly code: string; readonly legacyFallback: boolean; } export declare function makeError(code: string, message: string, legacyFallback?: boolean): GraphStoreError; /** Compute the on-disk graph path. Validates `graphRef` stays under the session root. */ export declare function graphPathFor(input: { projectRoot: string; sessionId: string; graphRef: string; workflowId: WorkflowId; }): string; /** Detect cycles in a node-dependency graph. */ export declare function detectCycle(nodes: readonly WorkflowGraphNode[]): boolean; /** Build a fresh empty graph with one terminal node. */ export declare function emptyGraph(input: { workflowId: WorkflowId; rootSkill: string; parentWorkflowId?: WorkflowId; }): WorkflowGraph;