agileplus-domain 0.3.0

Typed intent graphs for engineering work — convert prompts into validated DAGs of intents, features, tasks, tests, and edges, then store, query, and serve them from Rust, HTTP, or MCP.
Documentation
//! `CanonicalMapBuilder` — constructs `CanonicalMap` records for edges.

use crate::intent_graph::{CanonicalLinkType, CanonicalMap, Direction};

/// Builder for the optional `canonical_map` field on `Edge`.
#[derive(Debug, Default)]
pub struct CanonicalMapBuilder {
    link_type: Option<CanonicalLinkType>,
    direction: Option<Direction>,
}

impl CanonicalMapBuilder {
    pub fn new() -> Self {
        Self::default()
    }

    pub fn link_type(mut self, lt: CanonicalLinkType) -> Self {
        self.link_type = Some(lt);
        self
    }

    pub fn direction(mut self, d: Direction) -> Self {
        self.direction = Some(d);
        self
    }

    pub fn build(self) -> CanonicalMap {
        CanonicalMap {
            link_type: self.link_type,
            direction: self.direction,
        }
    }
}