from typing import Optional

import logging

from ...core import Frisk as FriskCore
from ...core.frisk_options import FriskOptionsInput
from .frisk_tool_hook import FriskStrandsToolHook
from .strands_framework_adapter import StrandsFrameworkAdapter


class FriskStrands(FriskCore):
    """Frisk client preconfigured with the Strands framework adapter."""

    def __init__(
        self,
        api_key: str,
        *,
        base_url: Optional[str] = None,
        logger: Optional[logging.Logger] = None,
        logger_name: Optional[str] = None,
        options: Optional[FriskOptionsInput] = None,
    ):
        super().__init__(
            api_key,
            base_url=base_url,
            framework_adapter=StrandsFrameworkAdapter(),
            logger=logger,
            logger_name=logger_name,
            options=options,
        )

    def tool_hook(self):
        """Create a Strands HookProvider that enforces Frisk policy decisions."""
        return FriskStrandsToolHook(self)
