+
    „WÝjù(  ã                  ó€   € R t ^ RIHt ^ RItR tR tR R ltR tR R	 ltR
R0t	R R lt
R R ltR tR R ltR tR# )uù  Background-process notification turns the gateway admits for this CLI's session (W11).

On main the classic CLI drained ``tools.process_registry`` itself, queued a
``ProcessNotificationBatch`` into ``_pending_input`` and ran the ``[IMPORTANT: Background process
...]`` turn. Over the session authority the process runs in the gateway: the gateway drains the
completion, admits the notification turn (``authority.admit_automation``) and runs it. The CLI
neither drains the registry nor claims delivery (IPS-086) â€” it only watches its session's stream.

The claim's ``message.start`` carries the admission's async-result card (``display_kind`` /
``display_text`` / model ``text``; ``gateway.session_automation.admission_display``). The idle tick
turns it into main's ``TimelineNotification``, so main's input path paints the same ``â—ˆ Background
Process Finished: ...`` header, and ``GatewayAgent.run_conversation`` pumps that already-admitted
turn (no ``prompt.submit``) through the same callbacks as a typed turn.
)ÚannotationsNc                óR   € ^ RI Hp \        V RR4      p\        W!4      '       d   V# R# )zPThe CLI's gateway session store, or None (a test double / an unavailable store).)ÚGatewaySessionStoreÚ_session_dbN)Ú hermes_cli.gateway_session_storer   ÚgetattrÚ
isinstance)Úclir   Ústores   &  ÚSC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\gateway_tools_notify.pyÚgateway_storer      s(   € åDÜ�C˜¨Ó-€EÜ˜u×:Ò:ˆ5ÐDÀÐDó    c                ód  € V P                  R 4      p\        V\        4      '       g   R# VP                  R4      VP                  R4      VP                  R4      rCpV'       dK   \        V\        4      '       d5   VP	                  4       '       d   \        V\        4      '       d	   V'       g   R# V# )ÚpayloadNÚdisplay_kindÚdisplay_textÚtext)Úgetr   ÚdictÚstrÚstrip)Úparamsr   ÚkindÚdisplayr   s   &    r   Ú_cardr      s|   € Ø�j‰j˜Ó#€GÜ�gœt×$Ò$ÙØ!Ÿ+™+ nÓ5°w·{±{À>Ó7RÐT[×T_ÑT_Ð`fÓTg�4€Dß”z '¬3×/Ò/°w·}±}·²ÌjÐY]Ô_b×NcÒNc×koÙØ€Nr   c               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚNone© )Úformats   "r   Ú__annotate__r"   %   s   € ÷ 5ñ 5 tñ 5r   c                ó   € ^ RI Hp VP                  \        V RR4      rCVP	                  V4      p\        W4      '       d   R# RVn        VP                  p  VP                  4       p\        T\        4      '       d6   ^ RIHp T! T\        TRR4      4      '       d   KJ  TP!                  T4       R# \        T\"        4      '       d   TP%                  R4      MRp	\        T	\"        4      '       d   T	P%                  R4      T8w  d   K´  T	P%                  R4      R8X  d:   ^ R	IHp
 T
! T	P%                  R
4      4      pT'       d   T P+                  T4       EK  T	P%                  R4      R8w  g   T	P%                  R4      '       g   EK3  TP,                  P%                  T	R,          4      pTe0   ^ RIHp \3        YRT	R,          RT	P%                  R4      /T4       R# \5        T	4      pTf   EKš  RT	R,          RTR,          RT	P%                  R4      /Tn        \7        T P8                  T! TR,          TR,          TR,          TP%                  R4      ;'       g    R4      4       R#   \        P                   d    \        Y4        R# i ; i)a  Idle tick: find a gateway-admitted notification turn's ``message.start`` for this session and
queue main's ``TimelineNotification`` for it. Frames before it are the between-turn leftovers
``run_conversation`` would discard anyway; frames after it stay queued for the pump.)ÚTimelineNotificationÚ
session_idN)Úlost_beforeÚepochr   Útypezreview.summary)Úreview_summary_liner   úmessage.startÚadmission_id©Ú_SeededQueryMessageÚexecution_generationr   r   r   Únotification_categoryÚresult)Ú$tools.process_registry_notificationsr$   Ú
connectionr   ÚstateÚ_adoption_waitingÚadmitted_turnÚeventsÚ
get_nowaitÚqueueÚEmptyÚrecover_queuedr   Ú	ExceptionÚhermes_cli.gateway_connectionr&   Úputr   r   Úhermes_cli.gateway_agentr)   Ú_agent_status_printÚqueued_inputsr	   r-   Ú_adoptr   Ú
_put_firstÚ_pending_input)r	   r
   r$   r2   r%   r3   r6   Úframer&   r   r)   ÚlineÚqueued_textr-   Úcards   &&             r   Úqueue_admitted_turnrH   %   s4  € õ JØ"×-Ñ-¬w°s¸LÈ$Ó/O�
Ø×Ñ˜ZÓ(€EÜ˜×$Ò$ÙØ€EÔØ×Ñ€FØ
ð	Ø×%Ñ%Ó'ˆEô �eœY×'Ò'ÝAÙ˜5¤'¨*°g¸tÓ"D×EÒEÙØ�J‰J�uÔÙÜ(2°5¼$×(?Ò(?�—‘˜8Ô$ÀTˆÜ˜&¤$×'Ò'¨6¯:©:°lÓ+CÀzÔ+QÙØ�:‰:�fÓÐ!1Ô1åDÙ& v§z¡z°)Ó'<Ó=ˆDßØ×'Ñ'¨Ô-ÚØ�:‰:�fÓ Ô0¸¿
¹
À>×8RÒ8RÚØ×)Ñ)×-Ñ-¨f°^Õ.DÓEˆØÒ"õ
 0Ü�3 °°~Õ0FØ 6¸¿
¹
ÐCYÓ8Zð \Ø]hôjáÜ�V‹}ˆØŠ<ÚØ-¨v°nÕ/EÀvÈtÐTZÍ|Ø5°v·z±zÐBXÓ7Yð[ˆÔä�3×%Ñ%Ñ';Ø��L˜$˜~Õ.°°^Õ0DØ�H‰HÐ,Ó-×9Ð9°ó(;ô 	<ñ 	øôO �{‰{ô 	Ü˜3Ô&Úð	ús   ÁI) É) JÊJc                óÈ   € ^ RI Hp VP                  P                  VR,          4       W!P                  VR,          &   \        V P                  V! W2R,          R7      4       R# )é    r,   r+   )r+   N)r	   r-   ÚmissedÚdiscardÚadoptedrB   rC   )r	   r3   rM   r   r-   s   &&&& r   rA   rA   ]   sI   € Ý'Ø	‡L�L×Ñ˜ Õ0Ô1Ø-4‡M�M�'˜.Õ)Ñ*Üˆs×!Ñ!Ñ#6°tÐR`ÕJaÔ#bÖcr   c               ó   € V ^8„  d   QhRR/# )r   r   Úboolr    )r!   s   "r   r"   r"   d   s   € ÷ ñ  Tñ r   c           
     óþ  € VP                   '       g   R# \        V RR4      pVf   R# VP                  ;_uu_ 4        VP                   Uu0 uF  p\        VRR4      kK  	  ppRRR4       XP	                  VP
                  4       VP                    Uu. uF  qUV9  g   K  VNK  	  up F  pVP                   P                  VR4       K!  	  \        VP                   4      # u upi   + '       g   i     LŒ; iu upi )z[An adopted item is still in ``_pending_input`` (one ``/queue clear`` dropped is forgotten).FrC   Nr+   )rM   r   Úmutexr8   ÚaddÚarmed_admissionÚpoprO   )r	   r3   ÚpendingÚitemÚwaitingÚaÚ	admissions   &&     r   r4   r4   d   sÁ   € à�=�=ˆ=ÙÜ�cÐ+¨TÓ2€GØ‚ÙØ	��‹ØCJÇ=Â=ÓQÁ=¸4”7˜4 °Ö6Á=ˆÐQ÷ 
à‡K�K�×%Ñ%Ô&Ø!&§¢ÓC¡˜A¸7Ñ2B—a�a¡ÔCˆ	Ø�‰×Ñ˜) TÖ*ñ Dä�—‘ÓÐùò	 R÷ 
�üò Ds)   ¼C'ÁC"Á!C'ÂC:Â!C:Ã"C'Ã'C7	Ú	cancelledÚrejectedc               ó   € V ^8„  d   QhRR/# r   r    )r!   s   "r   r"   r"   v   s   € ÷ +ñ + $ñ +r   c                óž  € ^ RI Hp VP                  P                  \	        V RR4      4      pVP
                  '       d.   VP                  VP                  8X  d   VP                  '       g   R# VP                  Vn        VP                  ;'       g    R Uu/ uF<  p\        V\        4      '       g   K  VP                  R4      VP                  R4      bK>  	  pp\        VP
                  P                  4       4       EF/  w  rgWcP                  9   g'   WcP                  9  d   VP                  V4      R8X  d   K>   VP!                  RV P"                  VRR	7      ;'       g    / pTP                  R4      p	T	R8X  d   TP                  P%                  T4       K�  T	R
8X  dT   TP                  R4      \&        9   d:   TP
                  P)                  TR4       TP                  P%                  T4       K÷  T	R9  d   EK  RTRTP                  R4      RR/p
T	R
8X  d   YŠR&   \+        YY§4        R# 	  R# u upi   T d    RTn         EKM  i ; i)as  Idle tick, after the stream had no ``message.start`` for them: this viewer's ``/queue``
admissions the owner started or settled without this viewer painting the turn (a local turn's
drain or pump dropped the start, or it ran across a reconnect, which replays no frames). Read on
a new published pending list or a dropped start only, never every tick.

Still running: adopted and pumped live, its reply completed from the receipt (``recovered``).
Settled: adopted with its saved result, painted without a pump. One that never ran (cancelled,
rejected) is forgotten: the only point where ``queued_inputs`` drops a row unpainted.
)ÚGatewayClientErrorr%   Nr+   ÚstatusÚqueuedzprompt.receiptT)r%   r+   Úinclude_resultÚterminalÚoutcomer.   Ú	recoveredÚreceiptr    éÿÿÿÿ)Ústartedrb   )Úhermes_cli.gateway_clientr^   r2   r3   r   r@   Úrecovered_seqÚpending_seqrK   rU   r   r   r   ÚlistÚitemsrM   Úcallr%   rL   Ú
_NEVER_RANrT   rA   )r	   r
   r^   r3   ÚrowÚlistedrY   r   re   r_   rM   s   &&         r   r:   r:   v   s
  € õ =Ø×Ñ×"Ñ"¤7¨3°¸dÓ#CÓD€EØ××Ð 5×#6Ñ#6¸%×:KÑ:KÔ#KÐTY×T`×T`ÐT`ÙØ×+Ñ+€EÔØDIÇMÁM×DWÐDWÐUWÐDWÓqÑDW¸SÔ[eÐfiÔko×[pÔ8ˆc�g‰g�nÓ% s§w¡w¨xÓ'8Ò8ÑDW€FÐqÜ × 3Ñ 3× 9Ñ 9Ó ;×<‰ˆ	ØŸ™Ô%¨)¿<¹<Ô*GÈFÏJÉJÐW`ÓLaÐemÔLmÙð	Ø—j‘jÐ!1¸c¿n¹nÐ[dØ04ð !ó 6÷ <ð <Ø9;ð ð
 —‘˜XÓ&ˆØ�XÔØ�L‰L× Ñ  Ô+ÙØ�ZÔ G§K¡K°	Ó$:¼jÔ$HØ×Ñ×#Ñ# I¨tÔ4Ø�L‰L× Ñ  Ô+ÙØÐ0Ô0ò Ø! 9Ð.DÀgÇkÁkÐRhÓFiØ ð&ˆà�ZÔØ!(�IÑÜˆs˜7Ô)Úó7 =ùò røð "ô 	Ø"$ˆEÔÛð	ús$   ÂH4Â4%H4Ä=%H9Å#H9È9IÉIc               ó   € V ^8„  d   QhRR/# r   r    )r!   s   "r   r"   r"   ¤   s   € ÷ 1ñ 1 4ñ 1r   c                ó¾   € VP                  R4      R8X  dG   VP                  R4      V P                  9   d%   V P                  P                  VR,          4       R# R# R# )z£A frame dropped outside its turn: a ``/queue`` admission's ``message.start`` is remembered so
the idle tick paints that turn from its receipt instead of losing it.r(   r*   r+   N)r   r@   rK   rR   )r3   r   s   &&r   Úmissed_startrs   ¤   sK   € ð ‡z�z�&Ó˜_Ô,°·±¸NÓ1KÈu×ObÑObÔ1bØ�‰×Ñ˜ Õ/Ö0ñ 2cÑ,r   c                ó  € V P                   ;_uu_ 4        V P                  P                  V4       V ;P                  ^,          un        V P                  P                  4        RRR4       R#   + '       g   i     R# ; i)z´Ahead of anything already queued: the gateway is running this turn NOW (typed inputs the
post-turn path re-queued are admitted behind it), and a typed turn run first would drop it.N)rQ   r8   Ú
appendleftÚunfinished_tasksÚ	not_emptyÚnotify)rU   rV   s   &&r   rB   rB   «   sN   € ð 
��‹Ø�‰× Ñ  Ô&Ø× Ò  AÕ%Õ Ø×Ñ× Ñ Ô"÷ 
��Šús   •AA.Á.A?	c               ó   € V ^8„  d   QhRR/# r   r    )r!   s   "r   r"   r"   ´   s   € ÷ ]ñ ]˜dñ ]r   c                óª   € \        VRR4      pV'       d   \        V 4      MRpVe-   W#P                  P                  \        V RR4      4      n        R# R# )zžThe input loop took ``item``: when it is an adopted ``/queue`` admission, the next
``run_conversation`` pumps exactly that admission (``take_admitted_turn``).r+   Nr%   )r   r   r2   r3   rS   )r	   rV   rY   r
   s   &&  r   Úarm_adoptedr{   ´   sK   € ô ˜˜n¨dÓ3€Iß"+ŒM˜#Ô°€EØÒØS\×Ñ×Ñœw s¨L¸$Ó?Ó@ÖPñ r   c                óF  € V P                  4       p\        VRR4      Ruq2n        V'       d   VP                  P	                  VR4      MRpVe   VP
                  P	                  VR4       V# \        VRR4      pRVn        V'       d   VP                  R4      V8w  d   R# V# )zÿThe admitted turn ``run_conversation(text)`` replays instead of submitting; None (and the
stale notification adoption dropped) for any other turn. A ``/queue`` admission is matched by the
id ``arm_adopted`` recorded, a notification turn by its model text.rS   Nr5   r   )Ú_stater   rS   rM   rT   r@   r5   r   )Úagentr   r3   ÚarmedrM   s   &&   r   Útake_admitted_turnr€   ½   s’   € ð �L‰L‹N€EÜ#*¨5Ð2CÀTÓ#JÈDÐ €EÔ ß05ˆe�m‰m×Ñ  tÔ,¸4€GØÒØ×Ñ×Ñ  tÔ,ØˆÜ�e˜_¨dÓ3€GØ€EÔß�g—k‘k &Ó)¨TÔ1ÙØ€Nr   )Ú__doc__Ú
__future__r   r8   r   r   rH   rA   r4   rn   r:   rs   rB   r{   r€   r    r   r   Ú<module>rƒ      sU   ðñõ #ã òEòõ5òpdõð ˜:Ð&€
õ+õ\1ò#õ]ôr   