import type { GraphV1, GraphPatchV1 } from "./graphTypes.js"; /** * Apply a GraphPatchV1 to a base GraphV1, returning a new graph instance. * * This helper is: * - Pure and deterministic (no side effects, does not mutate the base graph). * - Metadata-only: it operates on graph structure (nodes/edges) without * inspecting or logging any free-text content. * * Patch semantics (best-effort, forward compatible with engine contracts): * - Adds: * - `adds.nodes`: appended to the node list, replacing any existing node with * the same `id`. * - `adds.edges`: appended to the edge list. * - Updates: * - Node updates are objects with `id: string`; their properties are shallow- * merged into the matching node. * - Edge updates are objects with `id: string`; their properties are shallow- * merged into the matching edge when edges carry IDs. * - Removes: * - Node removals: objects with `node_id` / `nodeId` / `id` remove the node * and any incident edges. * - Edge removals: objects with `edge_id` / `edgeId` / `id` remove matching * edges by ID; as a fallback, objects with `from` + `to` remove matching * edges by endpoints. */ export declare function applyGraphPatch(base: GraphV1, patch: GraphPatchV1 | null | undefined): GraphV1;