§
    øžyj
  ã                  ó6   — d Z ddlmZ ddlZdd„Zdd	„Zdd„ZdS )uï  ``hermes pause`` / ``hermes resume`` â€” the global emergency stop.

``hermes pause`` writes the ESTOP sentinel at ``$HERMES_HOME/ESTOP``, which
halts cron dispatch, kanban dispatch, and new gateway turns on their next
check. In-flight work is never killed. ``hermes resume`` removes the
sentinel and normal operation resumes on the next tick â€” no restart needed.

Ported from: gastownhall/gastown estop.go (MIT); related prior art:
#26778 (/panic â€” kill/exit semantics, different), #44617.
é    )ÚannotationsNÚargsúargparse.NamespaceÚreturnÚintc                ó:  — ddl m}m}m} t	          | dd¦  «        } |¦   «         } ||¬¦  «        } |¦   «         pi }|rdnd}|                     d¦  «        rd|d         › �nd	}	t          d
|› |	› �¦  «         t          d|› �¦  «         t          d¦  «         dS )z!Engage the global emergency stop.r   )ÚengageÚ	get_stateÚ
is_engagedÚreasonN)r   zStill pausedzHermes pausedu    â€” reason: Ú u   â�¸ï¸�  z    sentinel: z�    Cron dispatch, kanban dispatch, and new gateway turns are on hold.
    In-flight work keeps running. Run `hermes resume` to lift the pause.)Úagent.estopr	   r
   r   ÚgetattrÚgetÚprint)
r   r	   r
   r   r   ÚalreadyÚpathÚstateÚverbÚdetails
             úB/home/ragecks/.hermes/hermes-agent/hermes_cli/subcommands/pause.pyÚ	cmd_pauser      sæ   € à9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9å�T˜8 TÑ*Ô*€FØˆj‰lŒl€GØˆ6˜Ð Ñ Ô €DØˆI‰KŒKÐ˜2€EØ$Ð9ˆ>ˆ>¨/€DØ27·)²)¸HÑ2EÔ2EÐMÐ.˜U 8œ_Ð.Ð.Ð.È2€FÝ	Ð
#�TÐ
#˜6Ð
#Ð
#Ñ$Ô$Ð$Ý	Ð
!˜4Ð
!Ð
!Ñ"Ô"Ð"Ý	ð	Sñô ð ð ˆ1ó    c                ó€   — ddl m}m}  |¦   «         rt          d¦  «         nt          d |¦   «         › d�¦  «         dS )z$Disengage the global emergency stop.r   )Ú	disengageÚsentinel_pathu>   â–¶ï¸�  Hermes resumed â€” dispatch picks up on the next tick.z%Hermes is not paused (no sentinel at z).)r   r   r   r   )r   r   r   s      r   Ú
cmd_resumer   $   s`   € à4Ð4Ð4Ð4Ð4Ð4Ð4Ð4à€y�{„{ð KÝÐNÑOÔOÐOÐOåÐI°m°m±o´oÐIÐIÐIÑJÔJÐJØˆ1r   ÚNonec                ó  — |                       ddd¬¦  «        }|                     ddd¬¦  «         |                     t          ¬	¦  «         |                       d
dd¬¦  «        }|                     t          ¬	¦  «         dS )zBAttach the ``pause`` and ``resume`` subcommands to ``subparsers``.Úpausez@Emergency stop: pause cron/kanban dispatch and new gateway turnsuª   Engage the global emergency stop. Halts NEW work only â€” cron dispatch, kanban dispatch, and new gateway turns â€” until `hermes resume`. In-flight work is never killed.)ÚhelpÚdescriptionz--reasonNz9Optional reason stored in the sentinel and shown to users)Údefaultr!   )ÚfuncÚresumez-Lift the emergency stop set by `hermes pause`z=Remove the ESTOP sentinel; dispatch resumes on the next tick.)Ú
add_parserÚadd_argumentÚset_defaultsr   r   )Ú
subparsersÚpause_parserÚresume_parsers      r   Úbuild_pause_parserr,   /   sª   € à×(Ò(ØØOð?ð	 )ñ ô €Lð ×ÒØØØHð ñ ô ð ð
 ×Ò¥9ÐÑ-Ô-Ð-à×)Ò)ØØ<ØSð *ñ ô €Mð
 ×Ò¥JÐÑ/Ô/Ð/Ð/Ð/r   )r   r   r   r   )r   r   )Ú__doc__Ú
__future__r   Úargparser   r   r,   © r   r   ú<module>r1      sr   ðð	ð 	ð #Ð "Ð "Ð "Ð "Ð "à €€€ðð ð ð ð&ð ð ð ð0ð 0ð 0ð 0ð 0ð 0r   