
    Pmj	                       d Z ddlmZ ddlZddlmZmZmZ ddlm	Z	m
Z
mZ ddZ ed	
           G d d                      Z ed	
           G d d                      Z ed	
           G d d                      Zg dZdS )zTyped gateway monitoring events.

Content-free service-health and redacted diagnostic events for the gateway
daemon. These are the only event shapes the monitoring plane emits: no
prompts, messages, tool args/results, session history, or usage analytics.
    )annotationsN)	dataclassfieldasdict)AnyDictOptionalreturnintc                 (    t          j                    S )N)timetime_ns     =/home/thesage/.hermes/hermes-agent/agent/monitoring/events.py_now_nsr      s    <>>r   T)slotsc                     e Zd ZU dZded<   dZded<   dZded<   dZded<   dZded	<   dZ	d
ed<   dZ
ded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<    ee          Zded<   d dZdS )!GatewayHealthEventz8Content-free gateway health snapshot or lifecycle event.strnameNOptional[str]gateway_state	old_state	new_stateexit_reasonzOptional[bool]restart_requestedr   r   active_agentsFboolgateway_busygateway_drainableplatform_countfatal_platform_countprofile
install_idversionsupervision_modeOptional[int]piddefault_factoryts_nsr
   Dict[str, Any]c                (    ddit          |           S )Neventgateway_healthr   selfs    r   to_dictzGatewayHealthEvent.to_dict)       ):VD\\::r   r
   r-   )__name__
__module____qualname____doc____annotations__r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r)   r   r   r,   r4   r   r   r   r   r      sZ        BBIII#'M''''#I#####I####!%K%%%%(,,,,,ML#####N !!!!!!G!!!! $J$$$$!G!!!!&*****Cw///E////; ; ; ; ; ;r   r   c                      e Zd ZU dZded<   ded<   dZded<   dZded	<   dZded
<   dZded<   dZ	ded<   dZ
ded<   dZded<   dZded<    ee          Zded<   dZded<   ddZdS )GatewayDiagnosticEventzCRedacted gateway diagnostic event for operator-owned observability.r   r   	subsystemunknownerror_classNr   
error_codeplatformr   r   r$   r&   warningseverityr*   r   r,   source_loggerr
   r-   c                (    ddit          |           S )Nr/   gateway_diagnosticr1   r2   s    r   r4   zGatewayDiagnosticEvent.to_dict>   s    ->>>r   r6   )r7   r8   r9   r:   r;   r@   rA   rB   r   r   r$   r&   rD   r   r   r,   rE   r4   r   r   r   r=   r=   -   s         MMIIINNN K     $J$$$$"H""""#I#####I####!G!!!!!G!!!!Hw///E////#'M''''? ? ? ? ? ?r   r=   c                      e Zd ZU dZded<   ded<   dZded<   dZded	<   dZd
ed<   dZd
ed<    e	e
          Zded<   ddZdS )CronExecutionEventz9Content-free durable cron execution lifecycle projection.r   statusjob_keyr?   sourceNr(   duration_msr   delivery_outcomer@   r*   r   r,   r
   r-   c                (    ddit          |           S )Nr/   cron_executionr1   r2   s    r   r4   zCronExecutionEvent.to_dictN   r5   r   r6   )r7   r8   r9   r:   r;   rL   rM   rN   r@   r   r   r,   r4   r   r   r   rI   rI   B   s         CCKKKLLLF!%K%%%%&*****!%K%%%%w///E////; ; ; ; ; ;r   rI   )r   r=   rI   )r
   r   )r:   
__future__r   r   dataclassesr   r   r   typingr   r   r	   r   r   r=   rI   __all__r   r   r   <module>rU      sW    # " " " " "  0 0 0 0 0 0 0 0 0 0 & & & & & & & & & &    ; ; ; ; ; ; ; ;2 ? ? ? ? ? ? ? ?( ; ; ; ; ; ; ; ;  r   