# Knowledge Base Default Configuration Values
#
# Pattern: Default values for all configuration options
# These are base values that modes can override

let contracts = import "contracts.ncl" in

{
  # Base configuration with all defaults
  base = {
    graph = {
      name = "knowledge-base",
      version = "1.0.0",
      description = "Knowledge Base graph",
    },

    # Inheritance paths: set via TOOLS_PATH env var at export time
    # Default paths resolve: $TOOLS_PATH/.kogral-shared (or $HOME/Tools/.kogral-shared)
    inheritance = {
      # Paths with $TOOLS_PATH are resolved at runtime by Rust code
      base = "$TOOLS_PATH/.kogral-shared",
      guidelines = [],
      priority = 100,
    },

    storage = {
      primary = 'filesystem,
      secondary = {
        enabled = false,
        type = 'surrealdb,
        url = "ws://localhost:8000",
        namespace = "kogral",
        database = "default",
      },
    },

    embeddings = {
      enabled = true,
      provider = 'fastembed,
      model = "BAAI/bge-small-en-v1.5",
      dimensions = 384,
      api_key_env = "OPENAI_API_KEY",
    },

    templates = {
      templates_dir = "templates",
      templates = {
        note = "note.md.tera",
        decision = "decision.md.tera",
        guideline = "guideline.md.tera",
        pattern = "pattern.md.tera",
        journal = "journal.md.tera",
        execution = "execution.md.tera",
      },
      export = {
        logseq_page = "export/logseq-page.md.tera",
        logseq_journal = "export/logseq-journal.md.tera",
        summary = "export/summary.md.tera",
        json = "export/graph.json.tera",
      },
      custom = {},
    },

    query = {
      similarity_threshold = 0.4,
      max_results = 10,
      recency_weight = 3.0,
      cross_graph = true,
    },

    mcp = {
      server = {
        name = "kogral-mcp",
        version = "1.0.0",
        transport = 'stdio,
      },
      tools = {
        search = true,
        add_note = true,
        add_decision = true,
        link = true,
        get_guidelines = true,
        export = true,
      },
      resources = {
        expose_project = true,
        expose_shared = true,
      },
    },

    sync = {
      auto_index = true,
      watch_paths = ["notes", "decisions", "guidelines", "patterns", "journal"],
      debounce_ms = 500,
    },
  } | contracts.KbConfig,
}
