from __future__ import annotations

from pathlib import Path
from unittest import TestCase

from iterfact.cli import build_parser
from MCP.runtime_paths import resolve_default_vault_path


class PackageSmokeTests(TestCase):
    def test_cli_exposes_mcp_commands(self) -> None:
        parser = build_parser()
        choices = parser._subparsers._group_actions[0].choices  # type: ignore[attr-defined]
        self.assertIn("mcp", choices)
        self.assertIn("serve", choices)

    def test_runtime_paths_resolve_bundled_vault(self) -> None:
        bundled = resolve_default_vault_path(Path("MCP/server.py"))
        self.assertTrue((bundled / "manifest.json").exists())
        self.assertTrue((bundled / "templates").exists())
