
    %j                     B    d Z ddlmZmZ ddlmZ  G d de          ZdS )z
Abstract interface for managing Hindsight embedded servers and profiles.

This module provides a clean interface for daemon lifecycle and profile management,
abstracting away the implementation details.
    )ABCabstractmethod)Optionalc                       e Zd ZdZedededefd            Zededefd            Z	ededefd            Z
ededefd            Zedded
ee         defd            Zd	S )EmbedManagerzHAbstract interface for managing Hindsight embedded servers and profiles.configprofilereturnc                     dS )a=  
        Ensure daemon is running for the given profile with config.

        Args:
            config: Environment configuration dict (HINDSIGHT_API_* vars)
            profile: Profile name for isolation

        Returns:
            True if daemon is running (started or already running), False on failure
        N )selfr   r	   s      e/home/rurouni/.hermes/hermes-agent/venv/lib/python3.11/site-packages/hindsight_embed/embed_manager.pyensure_runningzEmbedManager.ensure_running   	     	    c                     dS )a  
        Get the URL for the daemon serving this profile.

        Args:
            profile: Profile name

        Returns:
            URL string (e.g., "http://127.0.0.1:54321")

        Raises:
            RuntimeError: If daemon is not running
        Nr   r   r	   s     r   get_urlzEmbedManager.get_url   s	     	r   c                     dS )z
        Stop the daemon for this profile.

        Args:
            profile: Profile name

        Returns:
            True if stopped successfully, False otherwise
        Nr   r   s     r   stopzEmbedManager.stop-   	     	r   c                     dS )z
        Check if daemon is running for this profile.

        Args:
            profile: Profile name

        Returns:
            True if daemon is running and responsive
        Nr   r   s     r   
is_runningzEmbedManager.is_running:   r   r   Ndb_urlc                     dS )z
        Get the database URL for this profile.

        Args:
            profile: Profile name
            db_url: Optional override database URL

        Returns:
            Database connection string
        Nr   )r   r	   r   s      r   get_database_urlzEmbedManager.get_database_urlG   r   r   )N)__name__
__module____qualname____doc__r   dictstrboolr   r   r   r   r   r   r   r   r   r   r      s       RRT C D    ^ s s    ^ 
C 
D 
 
 
 ^
 
# 
$ 
 
 
 ^
   Xc] c    ^  r   r   N)r    abcr   r   typingr   r   r   r   r   <module>r&      sy     $ # # # # # # #      G G G G G3 G G G G Gr   