"""工具部署 — uv init / docker build"""

from __future__ import annotations

import logging
from pathlib import Path

from tool_agent.router.status import SourceType

logger = logging.getLogger(__name__)


class Deployer:
    """将工具部署到对应运行环境"""

    async def deploy_local(self, tool_dir: Path) -> bool:
        logger.info(f"Deployed local tool: {tool_dir}")
        return True

    async def deploy_docker(self, tool_dir: Path) -> bool:
        logger.info(f"Deployed docker tool: {tool_dir}")
        return True

    async def deploy(self, tool_dir: Path, source_type: SourceType) -> bool:
        if source_type == SourceType.LOCAL:
            return await self.deploy_local(tool_dir)
        elif source_type == SourceType.DOCKER:
            return await self.deploy_docker(tool_dir)
        return False
