
    :j                         d Z ddlmZmZmZ ddlmZmZmZ e G d de             Z	e G d de             Z
e G d	 d
e             Zy)a|  
Protocol Interfaces for Status System

This module defines Protocol interfaces to replace hasattr/getattr checks
with proper type-safe interfaces. These protocols ensure compile-time
type checking and eliminate runtime attribute inspection.

Defines clean interfaces that eliminate circular dependencies by allowing
bottom layers to define contracts that upper layers implement.
    )OptionalProtocolruntime_checkable   )
CacheStatsIMonitorProviderSystemStatusc                       e Zd ZdZdefdZy)TaskDataProviderz'Task management data provider interfacereturnc                      y)zGet comprehensive task statistics

        Returns:
            SystemStatus: Complete system status including runtime, state,
                         pipeline info, provider stats, and all metrics
        N selfs    2/root/.openclaw/workspace/harvester/state/types.pystatszTaskDataProvider.stats   s     	    N)__name__
__module____qualname____doc__r	   r   r   r   r   r   r      s    1| r   r   c                   (    e Zd ZdZdedededdfdZy)ICollectorWithAlertsz5Protocol for collectors that support alert managementstatus
error_typeerrorr   Nc                      y)zAdd error alert to status

        Args:
            status: System status to add alert to
            error_type: Type of error
            error: Original exception
        Nr   )r   r   r   r   s       r   _add_error_alertz%ICollectorWithAlerts._add_error_alert%   s     	r   )r   r   r   r   r	   str	Exceptionr   r   r   r   r   r   !   s'    ?|  Y [_ r   r   c                   H    e Zd ZU dZed   ed<   d
dedefdZde	fdZ
dd	Zy)IStatusCollectorz>Protocol for status collectors that have monitoring capabilityr   
monitoringrefreshr   c                      y)zGet system statusNr   )r   r$   s     r   r   zIStatusCollector.status6       r   c                      y)zGet cache statisticsNr   r   s    r   cache_statszIStatusCollector.cache_stats:   r&   r   Nc                      y)zClear cacheNr   r   s    r   clear_cachezIStatusCollector.clear_cache>   r&   r   )F)r   N)r   r   r   r   r   __annotations__boolr	   r   r   r(   r*   r   r   r   r"   r"   0   s5    H+,,d | Z r   r"   N)r   typingr   r   r   modelsr   r   r	   r   r   r"   r   r   r   <module>r/      si   	 9 8 > > 
x 
 
 8   x  r   