+
    iHàjN  ã                  óÄ   a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt RtR R lt	]P                  R8X  d   ]	! 4       MR;'       g    ]P                  tR]R	&    ! R
 R4      tR# )a¤  Clocks that stop while the computer sleeps.

A laptop that sleeps in the middle of a request freezes Hermes and the local model server
together. Timers measured on the wall clock or on Python's ``time.monotonic`` on Windows keep
counting through the sleep, so every stall watchdog fires the moment the machine wakes and kills
work that was about to continue. Watchdogs that judge "no progress" use these clocks instead.
)ÚannotationsN)ÚCallableg      @c               ó   € V ^8„  d   QhRR/# )é   ÚreturnzCallable[[], float] | None© )Úformats   "Ú6/home/ubuntu/.hermes/hermes-agent/agent/sleep_clock.pyÚ__annotate__r
      s   € ÷ ñ Ð!;ñ ó    c                 ó˜   aa€  ^ RI oSP                  P                  P                  oR TT3R llp T #   \        \
        3 d     R# i ; i)zHThe unbiased interrupt time in seconds, or None where kernel32 lacks it.Nc               ó   € V ^8„  d   QhRR/# ©r   r   Úfloatr   )r   s   "r	   r
   Ú-_windows_unbiased_clock.<locals>.__annotate__   s   € ÷ (ñ (�5ñ (r   c                 óz   <€ SP                  ^ 4      p S! SP                  V 4      4       V P                  R,          # )é    i€–˜ )Úc_ulonglongÚbyrefÚvalue)r   ÚctypesÚquerys    €€r	   ÚclockÚ&_windows_unbiased_clock.<locals>.clock   s3   ø€ Ø×"Ñ" 1Ó%ˆÙˆf�l‰l˜5Ó!Ô"Ø�{‰{˜ZÕ'Ð'r   )r   ÚwindllÚkernel32ÚQueryUnbiasedInterruptTimeÚAttributeErrorÚOSError)r   r   r   s    @@r	   Ú_windows_unbiased_clockr      sJ   ù€ ðÛà—‘×&Ñ&×AÑAˆ÷(ñ (ð
 €Løô œGÐ$ô Úðús   „$4 ´A	ÁA	Úwin32zCallable[[], float]Úawake_secondsc                  ó2   € ] tR t^*tRtR R ltR R ltRtR# )Ú
SleepWatchaT  Reports how long this process was stopped since the last check, for a caller that checks
every ``interval`` seconds: the wall time past one interval. That covers a machine that slept
and a process that Modern Standby froze, without relying on how any clock treats either.
Gaps under five seconds (clock sync, scheduling noise) don't count.
c               ó    € V ^8„  d   QhRRRR/# )r   Úintervalr   r   ÚNoner   )r   s   "r	   r
   ÚSleepWatch.__annotate__1   s   € ÷ !ñ ! ð !¨4ñ !r   c                	óF   € Wn         \        P                  ! 4       V n        R # )N)Ú	_intervalÚtimeÚ_wall)Úselfr%   s   &&r	   Ú__init__ÚSleepWatch.__init__1   s   € Ø!ŒÜ—Y’Y“[ˆŽ
r   c               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r	   r
   r'   5   s   € ÷ Añ A�uñ Ar   c                óž   € \         P                   ! 4       pWP                  ,
          V P                  ,
          Vuq n        V\        8¼  d   V# R# )z0Seconds stopped since the previous call, or 0.0.g        )r*   r+   r)   Ú_SLEEP_THRESHOLD_S)r,   ÚwallÚstoppeds   &  r	   ÚsleptÚSleepWatch.slept5   s<   € ä�yŠy‹{ˆØ"§Z¡ZÕ/°$·.±.Õ@À$Ðˆ”Ø!Ô%7Ô7ˆwÐ@¸SÐ@r   )r)   r+   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r-   r4   Ú__static_attributes__r   r   r	   r#   r#   *   s   † ñõ!÷Añ Ar   r#   )Ú__conditional_annotations__r:   Ú
__future__r   Úsysr*   Úcollections.abcr   r1   r   ÚplatformÚ	monotonicr!   Ú__annotations__r#   )r<   s   @r	   Ú<module>rC      s`   øðôõ #ã 
Û Ý $àÐ õð* #&§,¡,°'Ô"9ÑÔ¸t×VÐVÈÏÉð Ð"ó X÷Aó Ar   