+
    jHàj#  ã                  óH   € R t ^ RIHt ^ RItR tR tR tR R ltR R	 ltR# )
a!  ``hermes sessions discard``: acknowledge a turn lost across a gateway crash, without a REPL.

After an owner restart mid-turn, the session's ``started`` admission is fenced ``unknown`` and
everything queued behind it waits. A finite ``hermes chat --resume <id> -q`` refuses (exit 3)
rather than queue behind it. Interactively, ``/discard <admission>`` clears it. This is the same
fenced control (``prompt.resolve_unknown`` with the generation the owner stamped) for scripts.
The lost input is not replayed; it stays in the transcript to resend.
)ÚannotationsNc              ƒ  óÈ   "  € ^ RI Hp R F  p V P                  ! R/ W1/B G Rj  x€L
 u # 	  V! RV R24      h L  T d   p\        T4      R8w  d   h  Rp?KO  Rp?ii ; i5i)zTExact session id first, then title, as ``hermes chat --resume`` / ``-c`` resolve it.©ÚGatewayClientErrorNÚ	not_foundzNo session found matching 'z8'. Use 'hermes sessions list' to see available sessions.)Ú
session_idÚtitle)zsession.resume)Úhermes_cli.gateway_clientr   ÚrpcÚstr)ÚclientÚnamer   ÚkeyÚexcs   &&   Ú@/home/ubuntu/.hermes/hermes-agent/hermes_cli/sessions_discard.pyÚ_resumer      so   é € å<Û&ˆð	ØŸšÑD¸¸ÑD×DÒDñ 'ñ Ð:¸4¸&Ð@xÐyÓ
zÐzñ	 EøØ!ô 	Ü�3‹x˜;Ô&Øõ 'ûð	üs7   ‚A"�<¥:¦<©A"º<¼AÁAÁA"ÁAÁA"c                óî   € \        R \        V4       RV  R24       V F  p\        RVR,           24       K  	   \        R4      P                  4       P	                  4       R9   #   \
         d     R# i ; i)zDiscard z lost turn(s) on session z&? They are acknowledged, not replayed.z  Úadmission_idzProceed? [y/N] F>   ÚyÚyes)ÚprintÚlenÚinputÚstripÚlowerÚEOFError)r   ÚrowsÚrows   && r   Ú_confirmr      sx   € Ü	ˆH”S˜“Y�KÐ8¸¸ÐDjÐ
kÔlÛˆÜ��3�~Õ&Ð'Ð(Ö)ñ ðÜÐ&Ó'×-Ñ-Ó/×5Ñ5Ó7¸<ÑGÐGøÜô Úðús   »)A% Á%A4Á3A4c           
   ƒ  ó4  "  € ^ RI HpHp V! 4       ;_uu_4       GRj  x€L
 p\        W0P                  4      G Rj  x€L
 pVP                  R4      ;'       g
    VR,          pVP                  R. 4       Uu. uF  qfP                  R4      R8X  g   K  VNK  	  ppV P                  '       d–   V Uu. uF'  qfR,          \        V P                  4      9   g   K%  VNK)  	  pp\        \        V P                  4      V Uu0 uF  qfR,          kK  	  up,
          4      p	V	'       d   V! R	R
P                  V	4      ,           4      hMTpV'       g#   \        RV R24        RRR4      GRj  x€L
  ^ # V P                  '       g‚   \        P                  P                  4       '       g/   \        R\        P                  R7        RRR4      GRj  x€L
  ^# \!        WX4      '       g   \        R4        RRR4      GRj  x€L
  ^# V FB  pVP#                  RWVR,          VR,          R7      G Rj  x€L
  \        RVR,           24       KD  	   RRR4      GRj  x€L
  ^ #  EL= EL#u upi u upi u upi  EL
 L¨ L{ LL L$  + GRj  x€L 
 '       g   i     R# ; i5i)é    )r   Úconnect_gatewayNr   Ústored_session_idÚpendingÚstatusÚunknownr   z1Not an unknown (lost) admission of this session: z, zNothing to discard: session z has no unknown admission.zPRefusing to discard without confirmation on a non-interactive stdin; pass --yes.©Úfilez!Cancelled; nothing was discarded.zprompt.resolve_unknownÚexecution_generation)r   r   r(   z
Discarded )r	   r   r!   r   ÚsessionÚgetÚ	admissionÚsetÚsortedÚjoinr   r   ÚsysÚstdinÚisattyÚstderrr   r
   )
Úargsr   r!   r   Úsnapshotr   r   r%   ÚchosenÚmissings
   &         r   Ú_discardr7   $   s  é € ßMÙ× × Ô  FÜ  ¯©Ó6×6ˆØ—\‘\ ,Ó/×PÐP°8Ð<OÕ3Pˆ
Ø"*§,¡,¨y¸"Ô"=Ó`Ñ"=˜3ÇÁÈÓARÐV_ÑA_—3�3Ñ"=ˆÐ`Ø�>�>ˆ>Ù%,Ó[¡W˜c°NÕ0CÄsÈ4Ï>É>ÓGZÑ0Z—c�c¡WˆFÐ[ÜœS §¡Ó0ÑSYÓ3ZÑSYÈC¸×4GÐ4GÑSYÑ3ZÕZÓ[ˆGßÙ(Ð)\Ð_c×_hÑ_hÐipÓ_qÕ)qÓrÐrð ð ˆFßÜÐ0°°Ð<VÐWÔXØ÷ !× Ñ ð �x�xˆxÜ—9‘9×#Ñ#×%Ò%ÜÐhÔor×oyÑoyÕzØ÷# !× Ñ ô$ ˜J×/Ò/ÜÐ9Ô:Ø÷) !× Ñ ó* ˆCØ—*‘*Ð5À*Ð_mÕ[nØ25Ð6LÕ2Mð ó O÷ Oð Oä�J˜s >Õ2Ð3Ð4Ö5ñ ð ÷3 !× Ô Ú6ùâ`ùâ[ùÚ3Zö !ñ,O÷- !× × Ó üs  ‚JžIŸJ¢I;»I¼I;ÁI;Á6I!ÂI!ÂI;Â0"I&ÃI&ÃI;Ã<I+ÄI;Ä"(I;ÅI;ÅJÅ&I0Å'JÅ-I;Å?#I;Æ#I;Æ?JÇ
I3ÇJÇI;Ç.JÇ9I5Ç:JÈ *I;È*I7
È+I;É	JÉI9ÉJÉI;É!I;É0JÉ3JÉ5JÉ7I;É9JÉ;J	ÊJÊ
J	ÊJ	Ê	Jc               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚNone© )Úformats   "r   Ú__annotate__r>   B   s   € ÷ 
[ñ 
[¨tñ 
[ó    c                óœ   € ^ RI Hp V P                  RRRR7      pVP                  RRR7       VP                  R	R
RRR7       V! VR4       R# )r    )Úadd_yes_flagÚdiscardzXAcknowledge turns lost in a gateway crash (unknown admissions) so the session runs againzöAfter a gateway crash mid-turn, the lost turn is fenced 'unknown' and blocks the session: `hermes chat --resume <id> -q` exits 3 until it is acknowledged. This is the non-interactive form of `/discard <admission>`. The lost input is not replayed.)ÚhelpÚdescriptionr)   zSession ID or title)rC   z--admissionÚappendÚIDzRDiscard only this unknown admission (repeatable; default: every unknown admission))ÚactionÚmetavarrC   z>Do not ask for confirmation (required when stdin is not a TTY)N)Úhermes_cli.subcommands._sharedrA   Ú
add_parserÚadd_argument)Úsessions_subparsersrA   Úparsers   &  r   Úadd_discard_parserrN   B   se   € Ý;Ø ×+Ñ+ØÐrð^ð ,ó _€Fð
 ×Ñ˜	Ð(=ÐÔ>Ø
×Ñ˜¨hÀØað ô cá�ÐYÖZr?   c               ó   € V ^8„  d   QhRR/# )r9   r:   Úintr<   )r=   s   "r   r>   r>   O   s   € ÷ 	ñ 	˜ñ 	r?   c                ó  € ^ RI p^ RIHp ^ RIHp  VP                  \        V 4      4      #   T\        \        T3 dL   p\        YC4      '       d   \        T4      MRp\        RT,           \        P                  R7        Rp?^# Rp?ii ; i)r    N)ÚWebSocketExceptionr   zGateway connection/read failedzError: r&   )ÚasyncioÚwebsockets.exceptionsrR   r	   r   Úrunr7   ÚOSErrorÚTimeoutErrorÚ
isinstancer   r   r/   r2   )r3   rS   rR   r   r   Úmessages   &     r   Úcmd_discardrZ   O   si   € ÛÝ8Ý<ðØ�{‰{œ8 D›>Ó*Ð*øØ¤¬Ð7IÐJô Ü(¨×AÒA”#�c”(ÐGgˆÜˆi˜'Õ!¬¯
©
Õ3Ýûðús   ’, ¬B
¿A BÂB
)	Ú__doc__Ú
__future__r   r/   r   r   r7   rN   rZ   r<   r?   r   Ú<module>r]      s-   ðñõ #ã 
ò	{òòõ<
[÷	r?   