// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

pub mod dsml;
pub mod harmony;
mod harmony_grammar;
mod harmony_recovery;
pub mod traits;

use traits::{Tool, ToolParser};

use self::dsml::DeepSeekV4ToolStreamParser;
use self::harmony::HarmonyToolStreamParser;

/// Create the Dynamo v2 tool parser for a conformance family.
pub fn create_tool_parser_for_family(
    family: &str,
    tools: &[Tool],
) -> anyhow::Result<Box<dyn ToolParser>> {
    match family {
        "harmony" | "harmony_text" => HarmonyToolStreamParser::create(tools),
        "deepseek_v4" => DeepSeekV4ToolStreamParser::create(tools),
        other => anyhow::bail!("no Dynamo parser v2 for family '{other}'"),
    }
}
