+
    jHàj†x  ã                  óÖ   € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	 ^ RI
HtHtHt ^ RIHt ^ RIHtHt ]'       d   ^ RIHt ^ RIHt ]P.                  ! R	4      t ! R
 R4      tR# )aC  Goal/heartbeat continuation, post-turn hooks and loop-wakeup watcher methods for GatewayRunner.

Split out of ``gateway/run.py``; bound onto ``GatewayRunner`` via the MRO.
``gateway.run`` internals are imported lazily inside method bodies (import cycle),
so ``patch("gateway.run.X")`` keeps intercepting them at call time.
)ÚannotationsN)ÚnullcontextÚsuppress)ÚTYPE_CHECKINGÚAnyÚOptional)ÚPlatform)ÚMessageEventÚMessageType)ÚGatewayRunner)Ú
TurnRunnerzgateway.runc                  óv  € ] tR t^tRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
]RR/R R ll4       tR R ltR R ltR R ltR tR R ltR R ltR R ltR R  ltR! R" ltR# R$ ltR%R&/R' R( lltR)R/R* R+ llt]R, R- l4       t]R7R. R/ ll4       tR0 R1 ltR7R2 R3 lltR8R4 R5 lltR6tR&# )9ÚGatewayGoalsMixinz_Goal/heartbeat continuation, post-turn hooks and loop-wakeup watcher methods for GatewayRunner.c               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚint© )Úformats   "Ú6/home/ubuntu/.hermes/hermes-agent/gateway/run_goals.pyÚ__annotate__ÚGatewayGoalsMixin.__annotate__    s   € ÷ ñ ¨Sñ ó    c                ó°  €  \        V P                  \        4      '       d'   V P                  ;'       g    / P                  R/ 4      M \	        V P                  R/ 4      ;'       g    / pV'       g1   ^ RIHp V! 4       ;'       g    / P                  R4      ;'       g    / p\        VP                  R^4      ;'       g    ^4      #   \         d     ^# i ; i)z¨Configured /goal turn budget. GatewayRunner.config is a GatewayConfig dataclass, so the
top-level ``goals`` block is only reachable via hermes_cli.config.load_config().Úgoals)Úload_configÚ	max_turns)	Ú
isinstanceÚconfigÚdictÚgetÚgetattrÚhermes_cli.configr   r   Ú	Exception)ÚselfÚ	goals_cfgr   s   &  r   Ú_goal_max_turns_from_configÚ-GatewayGoalsMixin._goal_max_turns_from_config    s¯   € ð	ô ˜dŸk™k¬4×0Ò0ð —‘×"Ð" ×'Ñ'¨°Ô4ä˜TŸ[™[¨'°2Ó6×<Ð<¸"ð ÷
 Ý9á(›]×0Ð0¨b×5Ñ5°gÓ>×DÐDÀ"�	Ü�y—}‘} [°"Ó5×;Ð;¸Ó<Ð<øÜô 	Úð	ús4   ‚2C µ0C Á&
C Á1C ÂC Â C Â?C ÃCÃCc               ó    € V ^8„  d   QhRRRR/# )r   ÚlabelÚstrr   ÚNoner   )r   s   "r   r   r   1   s   € ÷ 	Lñ 	L°#ð 	L¸$ñ 	Lr   c              ƒ  ó°   "  €  ^ RI Hp V P                  V4      G Rj  x€L
  R#  L  \         d"   p\        P                  RY4        Rp?R# Rp?ii ; i5i)zÿWarm the goals SessionDB cache off-loop (best-effort): a cold cache runs the state.db
init on the loop thread and freezes the loop. The executor hop keeps the profile home
override alive under multiplex; a failed warm-up is a bounded stall, never a crash.)Ú_get_session_dbNz!%s: session DB warm-up failed: %s)Úhermes_cli.goalsr-   Ú_run_in_executor_with_contextr#   ÚloggerÚwarning)r$   r)   Ú_warm_goals_dbÚexcs   &&  r   Ú_warm_goals_session_dbÚ(GatewayGoalsMixin._warm_goals_session_db1   sE   é € ð	LÝJà×4Ñ4°^ÓD×DÔDøÜô 	LÜ�N‰NÐ>À×KÒKûð	Lüs6   ‚A„' ž%Ÿ' £A¥' §A²AÁAÁAÁAc               ó    € V ^8„  d   QhRRRR/# )r   Úeventr	   r)   r*   r   )r   s   "r   r   r   <   s   € ÷ Uñ U°lð UÈ3ñ Ur   c           
   ƒ  ób  "  € V P                  V4      G Rj  x€L
   V P                  P                  VP                  \	        \        VRR4      4      '       * R7      G Rj  x€L
 p\        TRR4      '       d   T# R#  Ld L  \         d"   p\        P                  RY$4        Rp?R# Rp?ii ; i5i)zòSession entry for a /goal or /heartbeat manager, or None when lookup fails. Warms the
SessionDB cache first (a cold cache drops the first write while the reply claims it was
set). Internal events never touch activity (idle/daily reset clock).NÚinternalF©Útouch_activityz%s: session lookup failed: %sÚ
session_id)	r4   Úasync_session_storeÚget_or_create_sessionÚsourceÚboolr!   r#   r0   Údebug)r$   r7   r)   Úsession_entryr3   s   &&&  r   Ú_session_entry_for_managerÚ,GatewayGoalsMixin._session_entry_for_manager<   s¥   é € ð ×)Ñ)¨%Ó0×0Ð0ð	Ø"&×":Ñ":×"PÑ"PØ—‘´´g¸eÀZÐQVÓ6WÓ1XÔ-Xð #Qó #÷ ˆMô !(¨°|ÀT× JÒ Jˆ}ÐTÐPTÐTñ 	1ñøô ô 	Ü�L‰LÐ8¸%ÔEÝûð	üsK   ‚B/—A<˜B/�AB  Á A>Á!B  Á%B/Á>B  Â B,ÂB'Â!B/Â'B,Â,B/c               ó    € V ^8„  d   QhRRRR/# )r   r7   r	   Úkindr*   r   )r   s   "r   r   r   J   s   € ÷ @ñ @¨lð @À#ñ @r   c              ƒ  óê   "  €  V! 4       pT P                  Y R24      G Rj  x€L
 pTf   R# T! TP                  4      T3#   \          d#   p\        P                  RY%4       Ru Rp?# Rp?ii ; i LN5i)z¨``(manager, session_entry)`` for *kind* ("goal"/"heartbeat"), or ``(None, None)``.
``load()`` imports the manager class and returns a ``session_id -> manager`` factory.z%s manager unavailable: %sNz manager)NN)r#   r0   rA   rC   r<   )r$   r7   rF   ÚloadÚfactoryr3   rB   s   &&&&   r   Ú_manager_for_eventÚ$GatewayGoalsMixin._manager_for_eventJ   s|   é € ð	Ù“fˆGð #×=Ñ=¸eÀvÈXÐEVÓW×WˆØÒ ØÐÙ�}×/Ñ/Ó0°-Ð?Ð?øô ô 	Ü�L‰LÐ5°tÔAØÕûð	úñ Xùs=   ‚A3„A ‹A3¢A1£A3ÁA.ÁA)Á#A.Á$A3Á)A.Á.A3c               ó   € V ^8„  d   QhRR/# ©r   r7   r	   r   )r   s   "r   r   r   W   s   € ÷ Cñ C°|ñ Cr   c              ƒ  óR   a "  € V 3R lpS P                  VRV4      G Rj  x€L
 #  L5i)zLReturn ``(GoalManager, session_entry)`` for this event, or ``(None, None)``.c                 óB   <a a€ ^ RI Ho  SP                  4       oV V3R l# )é    ©ÚGoalManagerc                ó   <€ S! V SR 7      # ©)r<   Údefault_max_turnsr   ©ÚsidrR   r   s   &€€r   Ú<lambda>ÚNGatewayGoalsMixin._get_goal_manager_for_event.<locals>._load.<locals>.<lambda>\   ó   ø€ ™{°cÈYÕWr   ©r.   rR   r&   ©rR   r   r$   s   @@€r   Ú_loadÚ<GatewayGoalsMixin._get_goal_manager_for_event.<locals>._loadY   ó   ú€ Ý4Ø×8Ñ8Ó:ˆIÝWÐWr   ÚgoalN©rJ   ©r$   r7   r]   s   f& r   Ú_get_goal_manager_for_eventÚ-GatewayGoalsMixin._get_goal_manager_for_eventW   s)   øé € õ	Xð ×,Ñ,¨U°F¸EÓB×BÐBÑBùs   ƒ' %¡'c               ó   € V ^8„  d   QhRR/# rM   r   )r   s   "r   r   r   _   s   € ÷ Hñ H¸Lñ Hr   c              ƒ  óJ   "  € R pV P                  VRV4      G Rj  x€L
 #  L5i)zQReturn ``(HeartbeatManager, session_entry)`` for this event, or ``(None, None)``.c                 ó   a € ^ RI Ho  V 3R l# )rP   ©ÚHeartbeatManagerc                ó   <€ S! V R 7      # ©©r<   r   )rW   ri   s   &€r   rX   ÚSGatewayGoalsMixin._get_heartbeat_manager_for_event.<locals>._load.<locals>.<lambda>c   s   ø€ Ñ/¸3Õ?r   )Úhermes_cli.heartbeatri   rh   s   @r   r]   ÚAGatewayGoalsMixin._get_heartbeat_manager_for_event.<locals>._loada   s   ø€ Ý=Ü?Ð?r   Ú	heartbeatNra   rb   s   && r   Ú _get_heartbeat_manager_for_eventÚ2GatewayGoalsMixin._get_heartbeat_manager_for_event_   s(   é € ò	@ð ×,Ñ,¨U°KÀÓG×GÐGÑGùs   ‚#œ!�#r9   Fc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r?   r   Útextr*   r9   r@   r   r	   r   )r   s   "r   r   r   g   s)   € ÷ 
ñ 
¨ð 
°3ð 
ÀTð 
ÐVbñ 
r   c               ó†   € ^ RI Hp \        V RR4      '       d   V! V RR7      MT p \        V\        P
                  WRR7      # )a«  Build the TEXT event used to inject a goal/heartbeat/loop prompt into a session.

The stored source's ``message_id`` is the message that registered the watch; a synthetic
prompt is not a reply to it, so it is dropped or every progress bubble and final reply
would quote that stale message (Telegram DM topics route anchorless via the topic id).
``replace_source`` keeps the receiving-adapter provenance native admission reads.
)Úreplace_sourceÚ
message_idN)rw   T)rt   Úmessage_typer?   r9   Úinherit_channel_pin)Úgateway.session_identityrv   r!   r	   r
   ÚTEXT)r?   rt   r9   rv   s   &&$ r   Ú_synthetic_prompt_eventÚ)GatewayGoalsMixin._synthetic_prompt_eventf   sB   € õ 	<Ü<CÀFÈLÐZ^×<_Ò<_‘ °4Õ8ÐekˆÜØ¤K×$4Ñ$4¸VØ $ô
ð 	
r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Ú	quick_keyr*   r?   r   r<   r   r+   r   )r   s   "r   r   r   v   s*   € ÷ 'ñ '°3ð 'Àð 'ÐQTð 'ÐY]ñ 'r   c                ób   € \        V RR4      pVf	   / ;q@n        W#3WA&   V P                  4        R# )zCTrack the canonical route and start the restart-recoverable poller.Ú_heartbeat_watchN)r!   r�   Ú_start_heartbeat_poller)r$   r   r?   r<   Úwatchs   &&&& r   Ú_register_heartbeat_watchÚ+GatewayGoalsMixin._register_heartbeat_watchv   s8   € ä˜Ð0°$Ó7ˆØŠ=Ø,.Ð.ˆEÔ)Ø"Ð/ˆÑØ×$Ñ$Ö&r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r*   r   r+   r   )r   s   "r   r   r   ~   s   € ÷ Mñ M°Sð M¸Tñ Mr   c                	óT   € \        V R R4      ;'       g    / P                  VR4       R# )r�   N)r!   Úpop)r$   r   s   &&r   Ú_unregister_heartbeat_watchÚ-GatewayGoalsMixin._unregister_heartbeat_watch~   s$   € Ü	�Ð)¨4Ó	0×	6Ð	6°B×;Ñ;¸IÀtÖLr   c               ó    € V ^8„  d   QhRRRR/# )r   rƒ   r   r   r+   r   )r   s   "r   r   r   �   s   € ÷ Qñ Q°ð Q¸ñ Qr   c           	   ƒ  ó\  "  € \        VP                  4       4       FE  w  pw  r4 V P                  V4      ;_uu_ 4        V P                  WW44      G Rj  x€L
  RRR4       KG  	  R#  L  + '       g   i     K^  ; i  \         d"   p\
        P                  RY%4        Rp?Kˆ  Rp?ii ; i5i)zJWake each idle watched session once; leave busy sessions' ticks unclaimed.Nz heartbeat poll for %s failed: %s)ÚlistÚitemsÚ_profile_scope_for_sourceÚ_heartbeat_poll_watchr#   r0   rA   )r$   rƒ   r   r?   r<   r3   s   &&    r   Ú_heartbeat_poll_onceÚ&GatewayGoalsMixin._heartbeat_poll_once�   sŒ   é € ä/3°E·K±K³MÖ/BÑ+ˆIÑ+˜ðQØ×3Ñ3°F×;Õ;Ø×4Ñ4°UÀvÓZ×ZÐZ÷ <Ñ;ó 0Cñ [÷ <×;Ð;ûäô QÜ—‘Ð?À×PÒPûðQüsc   ‚"B,¥A=¾A)ÁA'
ÁA)ÁA=Á!B,Á'A)Á)A:Á4A=Á8B,Á:A=Á=B)ÂB$ÂB,Â$B)Â)B,c              ƒ  	óú  aaa"  € V P                  R 4      G Rj  x€L
  \        V RR4      pVe5   VP                  V4      pV'       g   VP                  VR4       R# TpW43W&   V P	                  V4      pVe   VP
                  '       g   R# \        V RR4      e   ^ RIHp V! WW4V4      G Rj  x€L
  R# V P                  V4      '       g(   W'P                  9   g   V P                  W'R7      ^ 8”  d   R# ^ RIHp	 V	! R\        4      '       d   R# ^ RIHp
 V
! VR	7      oSP!                  4       '       g   VP                  VR4       R# SP#                  4       pV'       g   R# V P%                  W;4      oVSP&                  R
&   RSn        VSn         VP-                  S4      G Rj  x€L
  \        VR/ 4      P/                  V4      pVe    ^ RIHo VP3                  VVV3R l4       R# W'P                  9  d   SP5                  4        R# R#  ELõ ELc Lm  \        TR/ 4      P/                  T4      pTe   ^ RIHo TP3                  TTT3R l4       i Y'P                  9  d   SP5                  4        i i ; i5i)zheartbeat pollNÚsession_storeÚsession_authority)Úadmit_heartbeat)Úadapter©Úcheck_pausedrp   rh   rl   Úgateway_session_keyFÚ_session_tasks)Úsettle_heartbeat_attemptc                ó   <€ S! SS4      # ©Nr   )Údoner7   Úmgrrœ   s   &€€€r   rX   Ú9GatewayGoalsMixin._heartbeat_poll_watch.<locals>.<lambda>¼   s   ø€ Ñ4LÈUÐTWÔ4Xr   )r4   r!   Úpeek_session_idrˆ   Ú_delivery_adapter_forÚ_message_handlerÚ gateway.run_heartbeat_acceptancer–   Ú_is_session_runningÚ_active_sessionsÚ_queue_depthÚagent.estopr™   r0   rn   ri   Úhas_heartbeatÚ
due_promptr|   ÚmetadataÚ_heartbeat_execution_startedÚ_heartbeat_session_idÚhandle_messager    rœ   Úadd_done_callbackÚabandon_fire)r$   rƒ   r   r?   r<   ÚstoreÚcurrentr—   r–   r™   ri   ÚpromptÚtaskr7   r    rœ   s   &&&&&        @@@r   r�   Ú'GatewayGoalsMixin._heartbeat_poll_watchŠ   s0  úé € Ø×)Ñ)Ð*:Ó;×;Ð;Ü˜˜o¨tÓ4ˆØÒØ×+Ñ+¨IÓ6ˆGßØ—	‘	˜) TÔ*ÙØ ˆJØ &Ð3ˆEÑØ×,Ñ,¨VÓ4ˆØŠ? '×":×":Ð":ÙÜ�4Ð,¨dÓ3Ò?ÝHÙ! $°ÀYÓO×OÐOÙà×$Ñ$ Y×/Ò/Ø×4Ñ4Ô4Ø× Ñ  Ð Ó<¸qÔ@áÝ,á˜¤V×,Ò,ÙÝ9á¨*Ô5ˆØ× Ñ ×"Ò"Ø�I‰I�i Ô&ÙØ—‘Ó!ˆßÙØ×,Ñ,¨VÓ<ˆØ09ˆ�‰Ð,Ñ-Ø-2ˆÔ*ð '1ˆÔ#ð	#Ø×(Ñ(¨Ó/×/Ð/ä˜7Ð$4°bÓ9×=Ñ=¸iÓHˆDØÒÝUØ×&Ñ&Ö'XÖYØ×":Ñ":Ô:Ø× Ñ Ö"ñ ;òe 	<ò Pñ< 0øä˜7Ð$4°bÓ9×=Ñ=¸iÓHˆDØÒÝUØ×&Ñ&Ö'XÕYØ×":Ñ":Ô:Ø× Ñ Õ"ð ;üss   …I;šH›-I;Á	AI;Â$I;Â/HÂ0I;ÃAI;Ä&I;Ä6+I;Å"0I;ÆH Æ'HÆ(H Æ,A$I;ÈI;ÈH ÈA!I8É8I;c               ó   € V ^8„  d   QhRR/# ©r   r   r+   r   )r   s   "r   r   r   À   s   € ÷ Lñ L¨ñ Lr   c                óš  a a€ \        S RR4      pVe   VP                  4       '       g   R# ^ RIHo VV 3R lp \        P
                  ! V! 4       4      ;pS n        RVn        \        S RR4      pVe/   VP                  V4       VP                  VP                  4       R# R#   \         d    \        P                  RRR7        R# i ; i)	z?Start the single gateway-wide heartbeat poll task (idempotent).Ú_heartbeat_poll_taskN)ÚPOLL_SECONDSc               “  óæ   <"  €  \         P                  ! S4      G Rj  x€L
  ^ RIHp  V ! S4      G Rj  x€L
  \	        SRR4      pV'       g   KL  SP                  V4      G Rj  x€L
  Kg   LL L8 L
5i)TN)Úrestore_heartbeat_watchesr�   )ÚasyncioÚsleepÚgateway.run_heartbeat_restorer½   r!   r‘   )r½   rƒ   r»   r$   s     €€r   Ú
_poll_loopÚ=GatewayGoalsMixin._start_heartbeat_poller.<locals>._poll_loopÈ   sa   øé € ØÜ—m’m LÓ1×1Ð1ÝSÙ/°Ó5×5Ð5Ü Ð&8¸$Ó?�ß‘5Ø×3Ñ3°EÓ:×:Ò:ñ 2á5ñ ;ùs7   ƒA1žA+ŸA1´A-µA1ÁA1Á$A/Á%A1Á-A1Á/A1TÚ_background_tasksz Failed to start heartbeat poller©Úexc_info)r!   rŸ   rn   r»   r¾   Úcreate_taskrº   Ú_hermes_supervised_watcherÚaddr°   Údiscardr#   r0   rA   )r$   ÚexistingrÁ   rµ   Ú_bgr»   s   f    @r   r‚   Ú)GatewayGoalsMixin._start_heartbeat_pollerÀ   s±   ù€ ä˜4Ð!7¸Ó>ˆØÒ¨¯©¯ªÙå5ö	;ð
	LÜ/6×/BÒ/BÁ:Ã<Ó/PÐPˆD�4Ô,ð /3ˆDÔ+Ü˜$Ð 3°TÓ:ˆCØŠØ—‘˜”Ø×&Ñ& s§{¡{Ö3ñ øô ô 	LÜ�L‰LÐ;ÀdˆL×Kð	Lús   ºA&B$ Â$"C
Ã	C
c               ó   € V ^8„  d   QhRR/# )r   r?   r   r   )r   s   "r   r   r   Ý   s   € ÷ ñ ¨3ñ r   c                	óz   € V P                  V4      pV'       g"   \        P                  R \        VRR4      4       V# )z$goal continuation: no adapter for %sÚplatformN)r£   r0   rA   r!   )r$   r?   r—   s   && r   Ú_goal_notice_adapterÚ&GatewayGoalsMixin._goal_notice_adapterÝ   s4   € Ø×,Ñ,¨VÓ4ˆßÜ�L‰LÐ?ÄÈÐQ[Ð]aÓAbÔcØˆr   c               ó$   € V ^8„  d   QhRRRRRR/# ©r   r?   r   Úmessager*   r   r+   r   )r   s   "r   r   r   ã   s!   € ÷ ñ °Sð À3ð È4ñ r   c              ƒ  ó¬  "  € \        VRR4      \        P                  8X  dl   ^ RIHp V! V 4      pVe&   VP
                  P                  VP                  4      MRpVe-   VP                  P                  VP                  RRRV/RR7       R# V P                  V4      pV'       g   R# Rp\        \        4      ;_uu_ 4        V P                  V4      pRRR4       VP                  VP                  W'R	7      G Rj  x€L
 pVe9   \        VR
R4      '       g$   \        P!                  R\        VRR4      4       R# R# R#   + '       g   i     Ls; i LU5i)zCSend a /goal judge status line back to the originating chat/thread.rÏ   N©Úactive_authorityrF   r`   rt   zstatus.update)Ú
event_type)r¬   ÚsuccessTú)goal continuation: status send failed: %sÚerrorzunknown error)r!   r   ÚLOCALÚgateway.session_authoritiesr×   Úsessionsr    Úchat_idÚevent_streamÚpublishrÐ   r   r#   Ú_thread_metadata_for_sourceÚsendr0   r1   )	r$   r?   rÔ   r×   Ú	authorityÚliver—   r¬   Úresults	   &&&      r   Ú_send_goal_status_noticeÚ*GatewayGoalsMixin._send_goal_status_noticeã   s  é € ä�6˜: tÓ,´·±Ô>õ EÙ(¨Ó.ˆIØ=FÒ=R�9×%Ñ%×)Ñ)¨&¯.©.Ô9ÐX\ˆDØÒØ×!Ñ!×)Ñ)¨&¯.©.¸6À6È6ÐSZÐ:[Ø5Dð *ô FáØ×+Ñ+¨FÓ3ˆßÙØˆÜ”i× Õ Ø×7Ñ7¸Ó?ˆH÷ !à—|‘| F§N¡N°G�|ÓO×OˆØÒ¤g¨f°iÀ×&FÒ&FÜ�N‰NØ;¼WÀVÈWÐVeÓ=föñ 'GÑ÷ !× úáOùs1   ‚B$EÂ'EÃD?Ã(EÃ<EÃ=AEÄ?E	Å
	Ec               ó$   € V ^8„  d   QhRRRRRR/# rÓ   r   )r   s   "r   r   r   û   s#   € ÷ ñ ÀSð ÐSVð Ð[_ñ r   c              ƒ  ó(  a aa"  € S P                  S4      pV'       g   R# R VV V3R llpRp\        \        4      ;_uu_ 4        S P                  S4      pRRR4       V'       dX   \	        VR4      '       dF    \        VR/ 4      P                  V4      pVe   \        VRR4      MRpVP                  WTVR7       R# V! 4       G Rj  x€L
  R#   + '       g   i     L€; i  \         d!   p\        P                  RT4        Rp?LJRp?ii ; i LG5i)	zñSend a /goal status line after the main response is delivered.

The adapter sends the agent response after this caller returns, so for reading order use
its one-shot post-delivery callback when available, else deliver directly (never drop).
Nc               ó   € V ^8„  d   QhRR/# r¸   r   )r   s   "r   r   ÚPGatewayGoalsMixin._defer_goal_status_notice_after_delivery.<locals>.__annotate__  s   € ÷ 	`ñ 	` ñ 	`r   c               “  ó¬   <"  €  SP                  SS4      G R j  x€L
  R #  L  \         d$   p \        P                  RT RR7        R p ? R # R p ? ii ; i5i)NrÚ   TrÄ   )rç   r#   r0   r1   )r3   rÔ   r$   r?   s    €€€r   Ú_deliverÚLGatewayGoalsMixin._defer_goal_status_notice_after_delivery.<locals>._deliver  sJ   øé € ð`Ø×3Ñ3°F¸GÓD×DÔDøÜô `Ü—‘ÐJÈCÐZ^�×_Ò_ûð`üs6   ƒA…# š!›# ŸA¡# £A®AÁAÁAÁAÚregister_post_delivery_callbackr§   Ú_hermes_run_generation)Ú
generationzAgoal continuation: post-delivery callback registration failed: %s)
rÐ   r   r#   Ú_session_key_for_sourceÚhasattrr!   r    rð   r0   rA   )	r$   r?   rÔ   r—   rî   Úsession_keyÚactiverò   r3   s	   fff      r   Ú(_defer_goal_status_notice_after_deliveryÚ:GatewayGoalsMixin._defer_goal_status_notice_after_deliveryû   sî   úé € ð ×+Ñ+¨FÓ3ˆßÙ÷	`ò 	`ð ˆÜ”i× Õ Ø×6Ñ6°vÓ>ˆK÷ !çœ7 7Ð,M×NÒNðgÜ  Ð*<¸bÓA×EÑEÀkÓR�ØPVÒPbœW VÐ-EÀtÔLÐhl�
Ø×7Ñ7¸ÐZdÐ7ÔeÙñ ‹j×Ò÷ !× ûô ô gÜ—‘Ð`Ðbe×fÑfûðgúáùs[   …A DÁCÁDÁ'DÁ:AC" Â<DÃDÃ	DÃC	ÃDÃ"DÃ-DÄDÄDÄDc               ó$   € V ^8„  d   QhRRRRRR/# )r   rB   r   r)   r*   Úmoduler   )r   s   "r   r   r     s!   € ÷ ñ °cð À#ð Èsñ r   c              ƒ  ó  "  €  V! 4       p\        TRR4      ;'       g    RpT'       g   R# T P	                  T4      G Rj  x€L
  T! T4      #   \          d#   p\        P                  RY#T4        Rp?R# Rp?ii ; i L<5i)uý   Shared head of the post-turn hooks: ``load()`` imports the manager module and returns a
``session_id -> manager`` factory; None when unavailable / no session id. Warms the
SessionDB cache first â€” a cold cache at the turn boundary drops the read/write.z%s: %s module unavailable: %sNr<   Ú )r#   r0   rA   r!   r4   )r$   rB   r)   rú   rH   rI   r3   rW   s   &&&&&   r   Ú_post_turn_managerÚ$GatewayGoalsMixin._post_turn_manager  sx   é € ð	Ù“fˆGô �m \°4Ó8×>Ð>¸BˆßÙØ×)Ñ)¨%Ó0×0Ð0Ù�s‹|Ðøô ô 	Ü�L‰LÐ8¸%ÈÔMÝûð	úñ 	1ùsC   ‚A?„A ‹A?Ÿ
A?ªA?Á A=ÁA?ÁA:ÁA5Á/A?Á5A:Á:A?c               ó(   € V ^8„  d   QhRRRRRRRR/# ©r   rB   r   r?   Úfinal_responser*   r   r+   r   )r   s   "r   r   r   '  s2   € ÷ 6Gñ 6GØ #ð6GØ-0ð6GØBEð6Gà	ñ6Gr   c          	   ƒ  óÆ  a aaaa"  € V 3R lpS P                  VRRV4      G Rj  x€L
 oSe   SP                  4       '       g   R# R^ uoo\        \        4      ;_uu_ 4        ^ RIHpHp T! \        VRR4      ;'       g    RR7      oV! \        VRR4      4      oRRR4       S P                  VVVV3R l4      G Rj  x€L
 pVP                  R	4      ;'       g    R
pV'       d   Ve   S P                  W(4      G Rj  x€L
  VP                  R4      ;'       g    R
p	VP                  R4      '       d   V	'       d   Vf   R# \        VRR4      \        P                  8X  d,   ^ RIHp
  V
! S S P                  V4      W)R4      G Rj  x€L
  R#  S P                  V4      pS P%                  V4      pV'       d/   V'       d%   S P'                  VS P)                  W)4      V4       R# R# R#  ELÅ  + '       g   i     ELZ; i ELB EL L~  \         d    \         P#                  RRR7        R# i ; i  \         d"   p\         P#                  RT4        Rp?R# Rp?ii ; i5i)z²Run the goal judge after a gateway turn (AFTER delivery) and, if still active, enqueue a
continuation through the adapter FIFO so a simultaneous real user message takes priority.c                 óB   <a a€ ^ RI Ho  SP                  4       oV V3R l# )rP   rQ   c                ó   <€ S! V SR 7      # rT   r   rV   s   &€€r   rX   ÚOGatewayGoalsMixin._post_turn_goal_continuation.<locals>._load.<locals>.<lambda>/  rZ   r   r[   r\   s   @@€r   r]   Ú=GatewayGoalsMixin._post_turn_goal_continuation.<locals>._load,  r_   r   úgoal continuationr   N)Úcount_active_delegationsÚgather_background_processesr<   )Úowner_task_idc                 óB   <€ SP                  S;'       g    R RSS R7      # )rü   T)Úuser_initiatedÚbackground_processesÚactive_delegations)Úevaluate_after_turn)Ú_active_delegÚ	_bg_procsr  r    s   €€€€r   rX   Ú@GatewayGoalsMixin._post_turn_goal_continuation.<locals>.<lambda>A  s(   ø€ �C×+Ñ+Ø×$Ð$ "°TÐPYØ#0ð ,ô r   rÔ   rü   Úcontinuation_promptÚshould_continuerÏ   ©Úadmit_route_wakezgoal-continuationz)goal continuation: local admission failedTrÄ   z%goal continuation: enqueue failed: %s)rý   Ú	is_activer   r#   r.   r  r	  r!   r/   r    r÷   r   rÜ   Úgateway.session_automationr  r£   r0   rA   ró   Ú_enqueue_fifor|   )r$   rB   r?   r  r]   r  Ú
_gather_bgÚdecisionÚmsgr´   r  r—   Ú
_quick_keyr3   r  r  r    s   f$$d          @@@r   Ú_post_turn_goal_continuationÚ.GatewayGoalsMixin._post_turn_goal_continuation'  s  üé € õ
	Xð
 ×+Ñ+¨MÐ;NÐPWÐY^Ó_×_ˆØŠ;˜cŸm™mŸošoÙà#'¨Ð ˆ	�=Ü”i× Õ ßlñ #´¸ÈÐVZÓ1[×1cÐ1cÐ_cÔdˆIÙ4´W¸]ÈLÐZ^Ó5_Ó`ˆM÷ !ð ×;Ñ;÷ó
÷ 
ˆð �l‰l˜9Ó%×+Ð+¨ˆç�6Ò%Ø×?Ñ?ÀÓL×LÐLØ—‘Ð3Ó4×:Ð:¸ˆØ�|‰|Ð-×.Ò.·fÀÂÙÜ�6˜: tÓ,´·±Ô>õ DðYÙ& t¨T×-GÑ-GÈÓ-OÐQWÐatÓu×uÐuñ ð	GØ×0Ñ0°Ó8ˆGØ×5Ñ5°fÓ=ˆJßŸ:Ø×"Ñ" :¨t×/KÑ/KÈFÓ/[Ð]dÖeñ &‰wòS `÷
 !× Ð úò
ò Mñ vøÜô YÜ—‘ÐHÐSW�ÕXÙðYûô ô 	GÜ�L‰LÐ@À#×FÒFûð	GüsÕ   ‡I!¥G*¦I!ÁI!Á":G-Â#I!Â?HÃ I!Ã
I!Ã'I!Ã?HÄ I!ÄI!Ä6I!Ä>,I!Å+H	 ÆHÆ	H	 ÆI!Æ)H2 Æ:H2 Ç"H2 Ç$I!Ç-G>	Ç8
I!ÈI!ÈH	 È	"H/È+I!È.H/È/I!È2IÈ=IÉI!ÉIÉI!r7   Nc          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   Úagent_resultr   r?   Úis_internalr@   r7   r   r+   r   )r   s   "r   r   r   _  s;   € ÷ Bñ BØ"ðBØ,/ðBØ>BðBØKNðBà	ñBr   c             ƒ  óÐ  "  € ^ RI Hp ^ RIHp V! V! V 4      \	        VRR4      4      '       d   R# V P                  W4      p V P                  P                  W#'       * R7      G Rj  x€L
 pT P                  4       p
RT P                  3.pTP                  4       '       d'   T
'       g   TP                  ^ RT P                  34       T F"  w  rÍ T! Y‚T
'       d   R	MTR
7      G Rj  x€L
  K$  	  T P!                  TRR7       R#  Lœ  \         d"   p	\        P                  RT	4        Rp	?	R# Rp	?	ii ; i LN  \         d"   p	\        P                  RYÉ4        Rp	?	K•  Rp	?	ii ; i5i)z:Run goal and loop bookkeeping after an agent turn returns.rÖ   )Úviewer_drivenrß   Nr:   z'post-turn session resolution failed: %súloop completionr  rü   )rB   r?   r  z%s hook failed: %sT©Úonly_if_present)rÝ   r×   Ú!gateway.session_viewer_automationr$  r!   Ú_final_text_for_post_turn_hooksr=   r>   r#   r0   rA   Ú_turn_failedÚ_post_turn_loop_completionÚstripÚinsertr  Ú_publish_local_control)r$   r!  r?   r"  r7   r×   r$  Ú
final_textrB   r3   ÚfailedÚhooksr)   Úhooks   &$$$$         r   Ú_run_post_turn_hooksÚ&GatewayGoalsMixin._run_post_turn_hooks_  sC  é € õ 	AÝCÙÑ)¨$Ó/´¸ÀÈDÓ1Q×RÒRÙØ×9Ñ9¸,ÓNˆ
ð	Ø"&×":Ñ":×"PÑ"PØ¤ð #Qó #÷ ˆMð ×"Ñ"Ó$ˆØ# T×%DÑ%DÐEÐFˆØ×Ñ×Ò§fØ�L‰L˜Ð0°$×2SÑ2SÐTÔUÛ ‰KˆEð?Ù¨×\bÑVXÐhrÔs×sÒsñ !ð
 	×#Ñ# F¸DÐ#ÖAñ'øô ô 	Ü�L‰LÐBÀCÔHÝûð	úñ tøÜô ?Ü—‘Ð1°5×>Ò>ûð?üsŠ   ‚A E&Á$D Á'DÁ(D Á,4E&Â!E&Â)%E&ÃD7Ã&D5Ã'D7Ã+E&ÄD ÄD2ÄD-Ä'E&Ä-D2Ä2E&Ä5D7Ä7E#ÅEÅE&ÅE#Å#E&r'  c               ó$   € V ^8„  d   QhRRRRRR/# )r   r?   r   r'  r@   r   r+   r   )r   s   "r   r   r   ~  s'   € ÷ Yñ Y¨Sð YÀdð YÐW[ñ Yr   c               ó˜   € \        VRR4      \        P                  8w  d   R# ^ RIHp ^ RIHp V! V! V 4      VP                  VR7       R# )z�A local (Desktop/Ink) session's goal or loop state just moved here: repaint its viewers' cards,
whose loop countdown runs off the snapshot's ``next_due_at``.rÏ   NrÖ   )rá   r&  )r!   r   rÜ   rÝ   r×   Úgateway.session_control_actionsrá   rß   )r$   r?   r'  r×   rá   s   &&$  r   r.  Ú(GatewayGoalsMixin._publish_local_control~  s8   € ô �6˜: tÓ,´·±Ô>ÙÝ@Ý;ÙÑ  Ó&¨¯©È×Xr   c               ó   € V ^8„  d   QhRR/# )r   r   r@   r   )r   s   "r   r   r   ˆ  s   € ÷ Gñ G˜$ñ Gr   c                 óè   € ^ RI Hp  V P                  4       ;'       g    / pVP                  RVP                  R4      4      p\        V\        4      ;'       d    \        VP                  R4      4      # )z�Whether the owner recorded this turn's result as failed (``session_ingress`` captures it
around ``_handle_message``; turns outside an owner capture nothing).)Úexecution_resultÚterminal_resultræ   r0  )Úgateway.session_resultsr;  r    r   r   r@   )r;  Úcapturedræ   s      r   r*  ÚGatewayGoalsMixin._turn_failed‡  sZ   € õ 	=Ø#×'Ñ'Ó)×/Ð/¨RˆØ—‘Ð/°·±¸hÓ1GÓHˆÜ˜&¤$Ó'×FÐF¬D°·±¸HÓ1EÓ,FÐFr   c               ó   € V ^8„  d   QhRR/# )r   r   r*   r   )r   s   "r   r   r   ‘  s   € ÷ Tñ TÀSñ Tr   c                óV  € Rp\        V \        4      '       d&   \        V P                  R4      ;'       g    R4      pM\        V \        4      '       d   T pVP	                  4       '       d   V# \        VRR4      p\        V\        4      '       d   VP	                  4       '       d   V# T# )z¦Text for /goal and /loop after a gateway turn. Streamed turns return None from
_handle_message_with_agent (already_sent); the delivered reply is stashed on the event.rü   r  Ú_streamed_final_responseN)r   r   r*   r    r,  r!   )r!  r7   rt   Ústreameds   &&  r   r)  Ú1GatewayGoalsMixin._final_text_for_post_turn_hooks�  sˆ   € ð ˆÜ�l¤D×)Ò)Ü�|×'Ñ'Ð(8Ó9×?Ð?¸RÓ@‰DÜ˜¤c×*Ò*ØˆDØ�:‰:�<Š<ØˆKÜ˜5Ð"<¸dÓCˆÜ% h´×4Ò4¸¿¹×9IÒ9IˆxÐSÈtÐSr   c               ó(   € V ^8„  d   QhRRRRRRRR/# r   r   )r   s   "r   r   r   ž  s2   € ÷ Mñ MØ #ðMØ-0ðMØBEðMà	ñMr   c             ƒ  ó�  "  € R pV P                  VRRV4      G Rj  x€L
 pVe   VP                  MRpVe   VP                  '       g   R# T P                  VP                  T;'       g    R4      G Rj  x€L
 pVP                  R4      ;'       g    RpV'       d"   Ve   V P                  W(4      G Rj  x€L
  R# R# R#  L¢ LL L5i)zÿComplete a /loop wakeup tick after a gateway turn. No-op unless a tick is in flight
(``awaiting_response``, set when the wakeup was injected); applies the LOOP_COMPLETE marker
/ --until judge / caps and schedules the next tick for the idle wakeup watcher.c                 ó   a € ^ RI Ho  V 3R l# )rP   ©ÚLoopManagerc                ó   <€ S! V R 7      # rk   r   )rW   rI  s   &€r   rX   ÚMGatewayGoalsMixin._post_turn_loop_completion.<locals>._load.<locals>.<lambda>¦  s
   ø€ ™{°cÕ:r   )Úhermes_cli.loopsrI  rH  s   @r   r]   Ú;GatewayGoalsMixin._post_turn_loop_completion.<locals>._load¤  s   ø€ Ý4Ü:Ð:r   r%  ÚloopsNrü   rÔ   )rý   ÚstateÚawaiting_responser/   Úcomplete_tickr    r÷   )	r$   rB   r?   r  r]   r    rO  r  r  s	   &$$$     r   r+  Ú,GatewayGoalsMixin._post_turn_loop_completionž  sº   é € ò	;ð ×+Ñ+¨MÐ;LÈgÐW\Ó]×]ˆØ š_�—	’	°$ˆØŠ= × 7× 7Ð 7Ùð ×;Ñ;¸C×<MÑ<MÈ~×OcÐOcÐacÓd×dˆØ�l‰l˜9Ó%×+Ð+¨ˆß�6Ò%Ø×?Ñ?ÀÓL×LÒLñ &‰3ñ ^ñ eñ MùsK   ‚C�C ž+CÁ
 CÁ+
CÁ5CÁ6CÂ
CÂCÂ5CÂ6CÃCÃCc               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r   rW   r*   rO  r   ÚnowÚfloatÚwarned_no_routeÚsetÚprofileúOptional[str]r   r+   r   )r   s   "r   r   r   ´  sD   € ÷ V,ñ V,ØðV,Ø"ðV,Ø).ðV,ØADðV,ØO\ðV,à	ñV,r   c              ƒ  óÆ  a"  € ^ RI HpHp VP                  '       g   W2P                  8  d   R# VP
                  ;'       g    / pVP                  RR4      oVP                  RR4      p	S'       d	   V	'       g   R# VP                  R4      ;'       g    TpV P                  V4      p
\        V3R lV
P                  4        4       R4      pVf1   W9  d)   VP                  V4       \        P                  RSW4       R# T P                  R	RRSRV	/R Uu/ uF  qÌVP                  VR4      bK  	  upC4      pVf   R# V'       d   \        VRR4      '       g   W]n        Rp\!        \"        4      ;_uu_ 4        V P%                  V4      pRRR4       V'       d   WàP&                  9   d   R# V! V4      '       d   R# V! VR
7      pVP)                  V4      '       g   R# ^ RIHp V! R\        4      '       d   R# V P/                  VP0                  4      G Rj  x€L
 pV'       g   R#  \        P3                  RVP4                  '       d   VP4                  P6                  MRSVP8                  VP:                  4       ^ RIHp VPA                  4       PC                  R4      '       g   V! WVVR4      G Rj  x€L
 '       g,   VPE                  V PG                  VVRR7      4      G Rj  x€L
  VPA                  4       PC                  R4      '       d%   V P/                  VPH                  R4      G Rj  x€L
  T PO                  T4       R# u upi   + '       g   i     ELË; i ELI L­ L~ L7  \"         dj   p\        PK                  RTT4       \!        \"        4      ;_uu_ 4        TPM                  4        RRR4        Rp?K�    + '       g   i      Rp?L¡; iRp?ii ; i5i)z¯Inject one due /loop wakeup into its session, applying every deferral rule. ``profile`` is
the store being scanned (None = default); a ``profile`` persisted in the route wins.)rI  Úgoal_blocks_loop_tickNrÏ   rü   rß   rX  c              3  óR   <"  € T F  w  rVP                   S8X  g   K  Vx € K  	  R # 5irž   )Úvalue)Ú.0ÚpÚaÚplatform_names   &  €r   Ú	<genexpr>Ú:GatewayGoalsMixin._loop_wakeup_fire_one.<locals>.<genexpr>Ç  s"   øé € ÐSÑ&6™d˜a¸!¿'¹'À]Ñ:RŸšÓ&6ùs   ƒ'�
'z@loop wakeup: no adapter for platform %r (session %s, profile %s)rõ   rl   r˜   Úloopu6   loop wakeup #%s â€” injecting for %s chat=%s thread=%sÚ?r  Ú/z	loop-tickT)r9   z'loop wakeup injection failed for %s: %s)Ú	chat_typeÚ	thread_idÚuser_idÚ	user_name)(rL  rI  r[  rP  Únext_due_atÚrouter    Ú_adapters_for_profileÚnextrŽ   rÈ   r0   rA   Ú_build_process_event_sourcer!   rX  r   r#   ró   Ú_running_agentsÚis_duer©   r™   r/   Ú	fire_tickÚinforO  Úticks_firedrß   rh  r  r  ÚlstripÚ
startswithr¯   r|   rQ  r1   Úabandon_tickr.  )r$   rW   rO  rT  rV  rX  rI  r[  rl  rß   Úadaptersr—   Úkr?   rõ   r    r™   Úwakeupr  r3   ra  s   &&&&&&              @r   Ú_loop_wakeup_fire_oneÚ'GatewayGoalsMixin._loop_wakeup_fire_one´  s#  øé € ÷
 	Hà×"×"Ð" c×,=Ñ,=Ô&=ÙØ—‘×!Ð!˜rˆØŸ	™	 *¨bÓ1ˆØ—)‘)˜I rÓ*ˆß§GÙØ—)‘)˜IÓ&×1Ð1¨'ˆð ×-Ñ-¨gÓ6ˆÜÔS h§n¡nÔ&6ÓSÐUYÓZˆØŠ?ØÔ)Ø×#Ñ# CÔ(Ü—‘ØVÐXeÐgjôñ à×1Ñ1Ø˜2Ø˜Ø�wð3
ñ -_Ó_Ñ,^ q�%—)‘)˜A˜rÓ"Ò"Ñ,^Ñ_ð	3
ó ˆð Š>Ùßœ7 6¨9°d×;Ò;Ø$ŒNØˆÜ”i× Õ Ø×6Ñ6°vÓ>ˆK÷ !ç˜;×*>Ñ*>Ô>ÙÙ  ×%Ò%Ùá SÔ)ˆØ�z‰z˜#�ŠÙÝ,ñ ˜¤×'Ò'Ùð ×9Ñ9¸#¿-¹-ÓH×HˆßÙð	#Ü�K‰KØHØ),¯¯¨�—	‘	×%Ò%¸Ø˜vŸ~™~¨v×/?Ñ/?ôõ
 Dð �}‰}‹×)Ñ)¨#×.Ò.Ñ<LÈTÐ\bÐdjÐlwÓ<x×6xÖ6xØ×,Ñ,¨T×-IÑ-IÈ&ÐRXÐcgÐ-IÓ-hÓi×iÐið �}‰}‹×)Ñ)¨#×.Ò.Ø×8Ñ8¸×9JÑ9JÈBÓO×OÐOð 	×#Ñ# FÖ+ùòm `÷ !× Ð úò& Iñ" 7yÙiñ PøÜô 	#Ü�N‰NÐDÀcÈ3ÔOÜœ)×$Õ$Ø× Ñ Ô"÷ %×$×$×$Ñ$þð	#üs  ƒ?O!Á.O!Á2O!Á:O!ÂBO!ÄM
Ä1O!Å2O!Å9MÆO!ÆO!Æ;!O!ÇO!Ç8 O!ÈM!ÈO!È%O!È(!M* É
AM* Ê(M* Ê6M$Ê7	M* Ë&M* Ë'M&Ë((M* ÌM* Ì0M(Ì1M* Ì5O!ÍM	Í
O!Í$M* Í&M* Í(M* Í*OÍ5.OÎ#OÎ4OÎ<O!ÏOÏOÏO!ÏOÏOÏO!c               ó    € V ^8„  d   QhRRRR/# )r   ÚintervalrU  r   r+   r   )r   s   "r   r   r     s   € ÷ 1*ñ 1*°5ð 1*ÀDñ 1*r   c           	   ƒ  ó¦  a a	a
"  € ^ RI Ho	Hp ^ RIHp \
        P                  ! ^4      G Rj  x€L
  \        4       o
V	3R lpR V V
3R llpS P                  '       d™    V! S 4      G Rj  x€L
  Fc  w  rgVe"   S P                  W74      G Rj  x€L
 '       g   K*  V! V4      ;_uu_4       GRj  x€L
  V! V4      G Rj  x€L
  RRR4      GRj  x€L
  Ke  	  \
        P                  ! V4      G Rj  x€L
  Kª  R#  LÊ L� Lo LP LB L4  + GRj  x€L 
 '       g   i     K¯  ; i  \         d!   p\        P                  RT4        Rp?LqRp?ii ; i L_5i)u�  Fire due /loop wakeups for idle gateway sessions: a coarse ticker scans persisted loops
(SessionDB ``loop:*`` rows) and injects each due prompt via the synthetic-message path.
Deferrals: session running a turn (FIFO would race the live turn); active non-parked /goal
(goal owns the idle boundary); no routing metadata (one-time warning).

Multiplex: one gateway-wide task, so ``list_active_loops`` alone reads only the launch home's
store â€” a ``/loop`` set from a secondary profile's chat would never fire. Every served
profile's store is scanned under its own runtime scope (same shape as ``_handoff_watcher``),
and each hit is fired against that profile's adapters.)Ú_async_profile_runtime_scopeÚ_resolve_handoff_watch_scopes)Úprofile_has_active_loopNc                ó6   <€ V e	   S! V 4      # ^ RI Hp V! 4       # )N)Ú)async_launch_profile_scope_if_multiplexed)Ú!tui_gateway.launch_profile_policyr„  )Úprofile_homer„  r€  s   & €r   Ú_scopeÚ6GatewayGoalsMixin._loop_wakeup_watcher.<locals>._scope  s"   ø€ ð Ò'Ù3°LÓAÐAÝcÙ<Ó>Ð>r   c               ó    € V ^8„  d   QhRRRR/# )r   Úprofile_namerY  r   r+   r   )r   s   "r   r   Ú<GatewayGoalsMixin._loop_wakeup_watcher.<locals>.__annotate__#  s   € ÷ 
	añ 
	a°ð 
	aÀ$ñ 
	ar   c              “  ó  <"  € ^ RI Hp SP                  R4      G Rj  x€L
  SP                  V4      G Rj  x€L
 p\        P                  ! 4       pV F!  w  rESP                  WEVSV 4      G Rj  x€L
  K#  	  R#  L[ LD L5i)rP   )Úlist_active_loopszloop wakeupN)rL  r�  r4   r/   Útimer{  )rŠ  r�  Úactive_loopsrT  rW   rO  r$   rV  s   &     €€r   Ú_scan_one_storeÚ?GatewayGoalsMixin._loop_wakeup_watcher.<locals>._scan_one_store#  ss   øé € Ý:ð ×-Ñ-¨mÓ<×<Ð<à!%×!CÑ!CÐDUÓ!V×VˆLÜ—)’)“+ˆCÛ*‘
�Ø×0Ñ0°¸SÀ/ÐS_Ó`×`Ò`ó +ñ	 =áVñ aùs1   ƒB žA:ŸB ·A<¸7B Á/A>Á0B Á<B Á>B zloop wakeup watcher error: %s)Úgateway.runr€  r�  Úgateway.run_idle_gatesr‚  r¾   r¿   rW  Ú_runningr/   r#   r0   rA   )r$   r~  r�  r‚  r‡  r�  rŠ  r†  r3   r€  rV  s   f&       @@r   Ú_loop_wakeup_watcherÚ&GatewayGoalsMixin._loop_wakeup_watcher  s  úé € ÷ 	\ÝBÜ�mŠm˜AÓ×ÐÜ"›uˆõ	?÷
	añ 
	að �m�mˆmðCñ 9VÐVZÓ8[×2[Ò2[Ñ.�Lð $Ò/¸d×>`Ñ>`Ø3ó?C÷ 9Cö 9Cá Ù% l×3×3Õ3Ù-¨lÓ;×;Ð;÷  4×3Ñ3ñ 3\ô —-’- Ó)×)Ò)ñ ñ/ 	ñ6 3\ñ9Cñ  4Ù;÷  4×3×3Ó3ûäô CÜ—‘Ð<¸c×BÑBûðCúá)ùsÏ   …(E­C8®/EÁD! Á*C:Á+!D! ÂC<Â	D! ÂD! Â-C>
Â.D! Â1DÂ=D 
Â>DÃD! ÃDÃD! ÃEÃ/EÃ0	EÃ:D! Ã<D! Ã>D! Ä DÄD! ÄDÄ
DÄ
DÄDÄ	D! Ä!EÄ,EÅEÅEÅE)rº   r�   rž   )g      .@)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r&   r4   rC   rJ   rc   rq   Ústaticmethodr|   r„   r‰   r‘   r�   r‚   rÐ   rç   r÷   rý   r  r3  r.  r*  r)  r+  r{  r•  Ú__static_attributes__r   r   r   r   r      sÛ   † Ùiõõ"	LõUõ@õCõHð ð
ÈEö 
ó ð
õ'õMõQò4#õlLõ:õõ0õ:õ6GðpBØQU÷Bð>YÈU÷ Yð ôGó ðGð öTó ðTõM÷,V,÷p1*ó 1*r   r   )r›  Ú
__future__r   r¾   ÚdataclassesÚloggingrŽ  Ú
contextlibr   r   Útypingr   r   r   Úgateway.configr   Úgateway.platforms.eventr	   r
   r’  r   Úgateway.run_turn_runnerr   Ú	getLoggerr0   r   r   r   r   Ú<module>r§     sQ   ðñõ #ã Û Û Û ß ,ß /Ñ /å #ß =çÝ)Ý2ð 
×	Ò	˜=Ó	)€÷a*ó a*r   