+
    jHàj0<  ã                  ó–   € R t ^ RIHt ^ RIt^ RIHt ^ RIHtHt ]P                  ! R4      t
R R ltR]]3/R	 R
 llt ! R R4      tR# )z™Autonomy-loop gateway commands: /goal, /subgoal, /heartbeat, /loop, /refine, /review.
Bound onto ``GatewayRunner`` through ``GatewaySlashCommandsMixin``.)ÚannotationsN©Út)ÚMessageEventÚMessageTypezgateway.runc               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚbool© )Úformats   "ÚA/home/ubuntu/.hermes/hermes-agent/gateway/slash_commands_goals.pyÚ__annotate__r      s   € ÷ ñ �tñ ó    c                óH   €  \        V ! 4       4      #   \         d     R # i ; i)F)r
   Ú	Exception)Úfns   &r   Ú_quiet_boolr      s%   € ðÜ‘B“D‹zÐøÜô Úðús   ‚ ’! !Úerrorsc               ó   € V ^8„  d   QhRR/# )r   ÚprefixÚstrr   )r   s   "r   r   r      s   € ÷ (ñ (�cñ (r   c               óN   €  V! V!  R3#   T d   pRT  RT 23u Rp?# Rp?ii ; i)z[``(result, None)`` from ``fn(*args)``, or ``(None, "<prefix>: <exc>")`` on a manager error.Nz: r   )r   r   r   ÚargsÚexcs   &&$* r   Ú	_mgr_callr      s;   € ð(Ù�4‰y˜$ˆÐøØô (Ø˜�x˜r # Ð'Ð'Õ'ûð(ús   ‚
 Š$‘™$Ÿ$c                  ó†   € ] 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 ltR R ltR R ltRtR# )ÚGatewayGoalCommandsMixinzUAutonomy-loop gateway commands: /goal, /subgoal, /heartbeat, /loop, /refine, /review.c               ó    € V ^8„  d   QhRRRR/# ©r   Úeventr   r	   r   r   )r   s   "r   r   Ú%GatewayGoalCommandsMixin.__annotate__!   s   € ÷ !ñ !°ð !Àñ !r   c              ƒ  	óÊ  a aaaaa"  € ^ RI Ho ^ RIHo S P	                  S4      G Rj  x€L
 w  opSf   \        R4      # VV 3R loVVVVV3R lpS P                  V4      G Rj  x€L
 pVP                  '       d   S P                  SVP                  4       VP                  '       d*   S P                  SVP                  RVP                  R7       VP                  #  Lµ L{5i)	é    )Údispatch_goal_command)Úlast_user_message_from_dbNúgateway.goal.unavailablec                 óº   <€ ^ RI Hp  SP                  e   V ! SSP                  4      RJ d   R# SP                  SP                  4      '       g   \	        R4      # R# )r#   )Úauthorize_local_sourceNTz gateway.goal.gate_add_admin_only)Úgateway.session_localr(   ÚsourceÚ_resume_caller_is_adminr   )r(   r    Úselfs    €€r   Úauthorize_gateÚEGatewayGoalCommandsMixin._handle_goal_command.<locals>.authorize_gate)   sN   ø€ õ EØ�|‰|Ò'Ñ,BÀ4ÈÏÉÓ,VÐZ^Ó,^ÙØ×/Ñ/°·±×=Ò=ÜÐ;Ó<Ð<Ùr   c                 ór   <€ S! SSP                  4       ;'       g    R S R S! \        SRR4      4      R7      # )Ú c                ó   € \        V 3/ VB # ©Nr   )ÚkeyÚdefaultÚvaluess   &&,r   Ú<lambda>ÚQGatewayGoalCommandsMixin._handle_goal_command.<locals>.dispatch.<locals>.<lambda>7   s   € ´a¸Ñ6F¸vÒ6Fr   Ú
session_idN)r-   ÚrenderÚlast_user_message)Úget_command_argsÚgetattr)r-   r$   r    r%   Úmgrs   €€€€€r   ÚdispatchÚ?GatewayGoalCommandsMixin._handle_goal_command.<locals>.dispatch4   s=   ø€ Ù(Ø�U×+Ñ+Ó-×3Ð3°ÀNÙFÙ";¼GÀCÈÐW[Ó<\Ó"]ôð r   zcommand enqueue)ÚlabelÚkickoff)Úhermes_cli.goal_commandr$   Úhermes_cli.goalsr%   Ú_get_goal_manager_for_eventr   Ú_run_in_executor_with_contextÚclear_pendingÚ_clear_goal_continuationsÚpromptÚ_enqueue_goal_turnrA   Úoutput)	r,   r    Ú_session_entryr>   Úresultr-   r$   r%   r=   s	   ff   @@@@r   Ú_handle_goal_commandÚ-GatewayGoalCommandsMixin._handle_goal_command!   s½   ýé € ÝAÝ>à$(×$DÑ$DÀUÓ$K×KÑˆˆ^ØŠ;ÜÐ/Ó0Ð0ö		÷	ñ 	ð ×9Ñ9¸(ÓC×CˆØ××ÐØ×*Ñ*¨5°&×2FÑ2FÔGØ�=�=ˆ=Ø×#Ñ# E¨6¯=©=Ð@QÐ[a×[iÑ[iÐ#ÔjØ�}‰}Ðñ; Lñ0 Dùs-   ˆ!C#©Cª;C#Á%C!Á&C#Á<-C#Â*6C#Ã!C#c               ó$   € V ^8„  d   QhRRRRRR/# )r   r    r   Úverbr   r	   ÚNoner   )r   s   "r   r   r!   D   s&   € ÷ Xñ X¨|ð XÀ3ð XÈ4ñ Xr   c                	óÖ   €  V P                  V4      w  r4V'       d   V'       d   V P                  WC4       R# R# R#   \         d"   p\        P	                  R Y%4        Rp?R# Rp?ii ; i)z0goal %s: pending continuation cleanup failed: %sN)Ú_adapter_and_key_forÚ!_clear_goal_pending_continuationsr   ÚloggerÚdebug)r,   r    rP   ÚadapterÚ	quick_keyr   s   &&&   r   rG   Ú2GatewayGoalCommandsMixin._clear_goal_continuationsD   sY   € ð	XØ!%×!:Ñ!:¸5Ó!AÑˆGßŸ9Ø×6Ñ6°yÖJñ %‰wøäô 	XÜ�L‰LÐKÈT×WÒWûð	Xús   ‚"< ¥< ¼A(ÁA#Á#A(c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   r    r   Útextr   r@   rA   r
   r	   rQ   r   )r   s   "r   r   r!   L   s4   € ÷ ;ñ ;Ø!ð;Ø),ð;Ø8;ð;ØFJð;à	ñ;r   c          
     ó  € ^ RI Hp V! 4       ;pe   W&n        V'       g   RVn        R#  V P	                  V4      w  rxV'       d”   V'       dŠ   V'       d€   \        T\        P                  VP                  V'       d   VP                  MRV'       d   VP                  MRV'       d   VP                  MRV'       * R7      p	V P                  W‰V4       R# R# R# R#   \         d"   p
\        P                  RY:4        Rp
?
R# Rp
?
ii ; i)aq  Enqueue *text* as the next turn through the adapter FIFO (the post-turn judge's path).

A kickoff keeps the triggering message id / channel prompt / bound skills; a resume
continuation carries none. Best-effort: failures only logged. A local ``slash.exec`` returns
the turn to the client as its ``send`` directive instead (the client submits it with its own
input id).
)Úactive_sinkNz/goal resume)r[   Úmessage_typer*   Ú
message_idÚchannel_promptÚ
auto_skillÚinherit_channel_pinzgoal %s failed: %s)Úgateway.session_command_sinkr]   rH   ÚdisplayrS   r   r   ÚTEXTr*   r_   r`   ra   Ú_enqueue_fifor   rU   rV   )r,   r    r[   r@   rA   r]   ÚsinkrW   rX   Úturnr   s   &&&$$      r   rI   Ú+GatewayGoalCommandsMixin._enqueue_goal_turnL   sÍ   € õ 	=Ù“MÐ!ˆDÒ.ØŒKßØ-�”Ùð	;Ø!%×!:Ñ!:¸5Ó!AÑˆGßŸ§IÜ#ØÜ!,×!1Ñ!1Ø Ÿ<™<ß3:˜u×/Ò/Àß;B 5×#7Ò#7Èß3:˜u×/Ò/ÀØ,3¬ô�ð ×"Ñ" 9°GÖ<ñ %.™‰tøô ô 	;Ü�L‰LÐ-¨u×:Ò:ûð	;ús/   ª"C ÁC Á<C ÂC Â'+C ÃDÃ%DÄDc               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r!   l   s   € ÷ 4qñ 4q°\ð 4qÀcñ 4qr   c              ƒ  ó  a aaa"  € ^ RI HpHpHp SP	                  4       ;'       g    RP                  4       pVP                  4       pS P                  S4      G Rj  x€L
 w  opSf   \        R4      # SP                  '       d   S P                  SP                  4      MRoVVVV 3R lpV'       d   VR8X  d   SP                  4       # VR8X  d;   SP                  4       p	V	'       d   \        RV	P                  R	7      # \        R
4      # VR8X  dO   SP                  4       p	V	f   \        R4      # V! 4        \        RV! V	P                  4      V	P                  R7      # VR9   dH   SP!                  4       p
S'       d   S P#                  S4       V
'       d   \        R4      # \        R
4      # VP%                  R^4      pRRrÜV^ ,          P                  4       R8X  d?   \'        V4      ^8¼  d/   V! RV^,           24      p\'        V4      ^8”  d
   V^,          MRpMCV! V^ ,          4      pV'       d+   V^ 8”  d$   V\'        V^ ,          4      R P                  4       MRpVf   \        R4      # V^ 8  d   \        RVR7      # VP                  4       '       g   \        R4      # \)        \        R4      SP*                  WÜ\,        3R7      w  ržV'       d   V# V! 4        \        RV! V	P                  4      V	P                  R7      #  ELª5i)zÜHandle /heartbeat (mirror of the CLI handler): the session's one recurring re-entry
prompt. The gateway-wide poller injects due heartbeats through the adapter FIFO as
ordinary user turns, so alternation and caching hold.)Úparse_intervalÚformat_intervalÚMIN_INTERVAL_SECONDSr0   Nzgateway.heartbeat.unavailablec                 óŠ   <€ S'       d:   S P                   e*   SP                  SS P                   SP                  4       R # R # R # r2   )r*   Ú_register_heartbeat_watchr8   )r    r=   rX   r,   s   €€€€r   Ú_watchÚBGatewayGoalCommandsMixin._handle_heartbeat_command.<locals>._watchx   s0   ø€ ß˜UŸ\™\Ò5Ø×.Ñ.¨y¸%¿,¹,ÈÏÉÖWñ 6‰yr   ÚstatusÚpausezgateway.heartbeat.paused)rH   zgateway.heartbeat.none_setÚresumezgateway.heartbeat.no_resumezgateway.heartbeat.resumed)ÚintervalrH   zgateway.heartbeat.clearedÚeveryzevery zgateway.heartbeat.usagez$gateway.heartbeat.interval_too_small)Úmin_secondsz!gateway.heartbeat.prompt_requiredz gateway.heartbeat.invalid_prefix©r   zgateway.heartbeat.set>   ÚoffÚstopÚclear)Úhermes_cli.heartbeatrl   rm   rn   r;   ÚstripÚlowerÚ _get_heartbeat_manager_for_eventr   r*   Ú_session_key_for_sourceÚstatus_linert   rH   ru   Úinterval_secondsr|   Ú_unregister_heartbeat_watchÚsplitÚlenr   ÚsetÚ
ValueError)r,   r    rl   rm   rn   r   r   rK   rq   ÚstateÚhadÚtokensrv   rH   Úerrr=   rX   s   ff             @@r   Ú_handle_heartbeat_commandÚ2GatewayGoalCommandsMixin._handle_heartbeat_commandl   sŽ  ûé € ÷ 	_Ñ^Ø×&Ñ&Ó(×.Ð.¨B×5Ñ5Ó7ˆØ—
‘
“ˆØ$(×$IÑ$IÈ%Ó$P×PÑˆˆ^ØŠ;ÜÐ4Ó5Ð5ØBGÇ,Ç,À,�D×0Ñ0°·±Ô>ÐTXˆ	÷	Xð 	X÷ �u Ô(Ø—?‘?Ó$Ð$Ø�GÔØ—I‘I“KˆEßIN”1Ð/¸¿¹ÔEÐsÔTUÐVrÓTsÐsØ�HÔØ—J‘J“LˆEØŠ}ÜÐ6Ó7Ð7ÙŒHÜÐ0¹?È5×KaÑKaÓ;bÐkp×kwÑkwÔxÐxØÐ,Ô,Ø—)‘)“+ˆCßØ×0Ñ0°Ô;ß58”1Ð0Ó1Ð]¼aÐ@\Ó>]Ð]ð —‘˜D !Ó$ˆØ �&Ø�!�9�?‰?Ó Ô'¬C°«K¸1Ô,<Ù%¨¨v°a­y¨kÐ&:Ó;ˆHÜ"% f£+°¤/�V˜A–Y°r‰Fá% f¨Q¥iÓ0ˆHß6>À8ÈaÄ<�Tœ#˜f Q�i›.˜/Ð*×0Ñ0Ô2ÐUWˆFØÒÜÐ.Ó/Ð/Ø�aŒ<ÜÐ;ÐI]Ô^Ð^Ø�|‰|�~Š~ÜÐ8Ó9Ð9ÜœqÐ!CÓDÀcÇgÁgÈvÔisÐhuÔv‰
ˆßØˆJÙŒÜÐ(±?À5×CYÑCYÓ3ZÐch×coÑcoÔpÐpò[ Qùs@   †AL
ÁLÁ'L
Â-L
Â45L
Ã*BL
Æ L
ÆBL
È5A$L
ÊA.L
c               ó    € V ^8„  d   QhRRRR/# )r   r    r   rP   r   r   )r   s   "r   r   r!   ¢   s   € ÷ &ñ &°ð &ÀSñ &r   c                ó*  € VP                   '       d   V P                  VP                   4      MRpV'       g   RR\        RV R24      3# W0P                  9   d   VR\        RVR7      3# V P	                  V4      pVf   VR\        RV R24      3# W4R3# )a  ``(session_key, cached_agent, None)`` for /refine and /review, or ``(_, _, error_text)``:
both need a cached agent from a completed turn and refuse while a run is in flight.
``verb`` is the command name (``refine`` / ``review``) and selects ``gateway.<verb>.*`` copy.Nzgateway.z.unavailablez(gateway.shared.agent_running_retry_later)Úcommandz.nothing_yet)r*   r�   r   Ú_running_agentsÚ_cached_agent_for)r,   r    rP   rX   Úagents   &&&  r   Ú_idle_cached_agent_or_errorÚ4GatewayGoalCommandsMixin._idle_cached_agent_or_error¢   s    € ð CHÇ,Ç,À,�D×0Ñ0°·±Ô>ÐTXˆ	ßØ˜œq 8¨D¨6°Ð!>Ó?Ð?Ð?Ø×,Ñ,Ô,Ø˜d¤AÐ&PÐZ^Ô$_Ð_Ð_Ø×&Ñ& yÓ1ˆØŠ=Ø˜d¤A¨°°°lÐ&CÓ$DÐDÐDØ Ð%Ð%r   c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r!   °   s   € ÷ >ñ >°,ð >À3ñ >r   c              ƒ  óŽ  "  € VP                  4       ;'       g    RP                  4       pV P                  VR4      w  r4p\        \	        VRR4      ;'       g    . 4      pV'       g@   V'       d8   W0P
                  9  d(   ^ RIHp V! WP                  V4      G Rj  x€L
 pVe   V# V'       d   V# V'       g   \        R4      #  TP                  TRR\	        VR	\        4       4      9   T;'       g    RR
7       T'       d   \        RTR7      MRp
\        RT
R7      #  L�  \         d   p	\        RT	R7      u Rp	?	# Rp	?	ii ; i5i)u´   Handle /refine â€” run the memory/skill review fork on demand, in a daemon thread against a
snapshot of the cached AIAgent's conversation (live session and prompt cache untouched).r0   ÚrefineÚ_session_messagesN)Úrefine_local_sessionzgateway.refine.emptyTÚskill_manageÚvalid_tool_names)Úmessages_snapshotÚreview_memoryÚreview_skillsÚfocuszgateway.refine.start_failed©Úerrorzgateway.refine.focus_suffix)r¡   zgateway.refine.started)Úfocus_suffix)r;   r~   r•   Úlistr<   r’   Úgateway.session_refiner›   r*   r   Ú_spawn_background_reviewr‡   r   )r,   r    r   Ú
_quick_keyr”   r£   Úsnapshotr›   Úlocalr   Útails   &&         r   Ú_handle_refine_commandÚ/GatewayGoalCommandsMixin._handle_refine_command°   s+  é € ð ×&Ñ&Ó(×.Ð.¨B×5Ñ5Ó7ˆØ#'×#CÑ#CÀEÈ8Ó#TÑ ˆ
˜5Üœ Ð':¸DÓA×GÐGÀRÓHˆßŸJ¨:×=QÑ=QÔ+Qõ DÙ.¨t·\±\À4ÓH×HˆEØÒ Ø�ßØˆLßÜÐ+Ó,Ð,ð	?Ø×*Ñ*Ø"*¸$Ø,´¸Ð?QÔSVÓSXÓ0YÑYÐae×amÐamÐimð +ô ÷ @DŒqÐ.°dÕ;ÈˆÜÐ)¸Ô=Ð=ñ Iøô ô 	?ÜÐ2¸#Ô>Õ>ûð	?üsf   ‚A%EÁ(EÁ0,EÂDÂEÂ/	EÂ9EÃ,D  Ã2D  Ã:EÄEÄ EÄ+D=Ä7EÄ8EÄ=EÅEc               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r!   Ë   s   € ÷ 2ñ 2°,ð 2À3ñ 2r   c              ƒ  óè  aaa	a
aa"  € VP                  4       ;'       g    RP                  4       oV P                  VR4      w  o	opV'       d   V# \        \	        SRR4      ;'       g    . 4      o^ RIHo
Ho VVV	V
VV3R lp V P                  V4      G Rj  x€L
 p^ R	IHp T! TS4      #  L  \         d   p\        T4      u Rp?# Rp?i\         d   p\        RTR7      u Rp?# Rp?ii ; i5i)
uë   Handle /review â€” spawn an independent reviewer subagent. The approval session-key
contextvar is only bound during agent turns, so bind it explicitly here or the completion
event carries no gateway route and never re-enters this chat.r0   Úreviewrš   N)Úreset_current_session_keyÚset_current_session_keyc                 ó`   <€ S! S4      p  ^ RI Hp V! SSS4      S! V 4       #   S! T 4       i ; i)r#   )Ústart_review)Úagent.review_enginer´   )Útokenr´   r”   r   rX   r±   r²   r©   s     €€€€€€r   Ú	_dispatchÚBGatewayGoalCommandsMixin._handle_review_command.<locals>._dispatchÖ   s3   ø€ Ù+¨IÓ6ˆEð1Ý<Ù# E¨8°TÓ:á)¨%Õ0øÑ)¨%Õ0ús   ‹# £
-zgateway.review.start_failedr¢   )Úformat_dispatch_note)r;   r~   r•   r¥   r<   Útools.approval_contextr±   r²   rE   rˆ   r   r   r   rµ   r¹   )r,   r    r£   r·   rL   r   r¹   r”   r   rX   r±   r²   r©   s   &&     @@@@@@r   Ú_handle_review_commandÚ/GatewayGoalCommandsMixin._handle_review_commandË   sÒ   ýé € ð ×&Ñ&Ó(×.Ð.¨B×5Ñ5Ó7ˆØ"&×"BÑ"BÀ5È(Ó"SÑˆ	�5˜%ßØˆLÜœ Ð':¸DÓA×GÐGÀRÓHˆß]÷	1ò 	1ð	?ð  ×=Ñ=¸iÓH×HˆFõ
 	=Ù# F¨DÓ1Ð1ñ IøÜô 	Ü�s“8�OûÜô 	?ÜÐ2¸#Ô>Õ>ûð	?üsr   ˆAC2ÁC2Á*C2ÂB/ ÂB-ÂB/ ÂC2Â-B/ Â/C/Â:
C
ÃC/ÃC2Ã
C/ÃC/ÃC*Ã$C/Ã%C2Ã*C/Ã/C2c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r!   é   s   € ÷ %@ñ %@°<ð %@ÀCñ %@r   c              ƒ  óš  "  € VP                  4       ;'       g    RP                  4       pV P                  V4      G Rj  x€L
 w  r4Vf   \        R4      # VP	                  4       '       g   \        R4      # V'       g$   VP                  4        RVP                  4        2# VP                  R^4      pV^ ,          P                  4       p\        V4      ^8”  d   V^,          P                  4       MRpVR8X  dq   V'       g   \        R4      #  \        VP                  4       ^ ,          4      p\        R	TP                  T\        \        3R
7      w  ršT
;'       g    \        RY‰R7      # VR8X  dY   \        RVP                   \        3R
7      w  rºV
'       d   V
# V'       g   \        R4      # \        V^8X  d	   RVR7      # RVR7      # \        RVP"                  V4      w  rÊV
'       d   V
# VP$                  '       d    \        VP$                  P&                  4      M^ p\        RWŒR7      #  ELí  \         d    \        R4      u # i ; i5i)z¿Handle /subgoal (mirror of the CLI handler): extra criteria appended to the active goal
mid-loop. They modify state read at the next turn boundary, so this is safe while the
agent is running.r0   Nr&   zgateway.subgoal.no_goalÚ
Úremovezgateway.subgoal.usage_removezgateway.subgoal.remove_not_intz/subgoal removery   zgateway.subgoal.removed)Úindexr[   r|   z/subgoal clearzgateway.subgoal.none_to_clearzgateway.subgoal.cleared_onezgateway.subgoal.cleared_other)Úcountz/subgoalzgateway.subgoal.added)r;   r~   rD   r   Úhas_goalr‚   Úrender_subgoalsr…   r   r†   Úintrˆ   r   Úremove_subgoalÚ
IndexErrorÚRuntimeErrorÚclear_subgoalsÚadd_subgoalr‰   Úsubgoals)r,   r    r   r=   rK   r‹   rP   ÚrestÚidxÚremovedrŒ   Úprevr[   s   &&           r   Ú_handle_subgoal_commandÚ0GatewayGoalCommandsMixin._handle_subgoal_commandé   sõ  é € ð ×&Ñ&Ó(×.Ð.¨B×5Ñ5Ó7ˆØ$(×$DÑ$DÀUÓ$K×KÑˆØŠ;ÜÐ/Ó0Ð0Ø�|‰|�~Š~ÜÐ.Ó/Ð/ßØ—o‘oÓ'Ð(¨¨3×+>Ñ+>Ó+@Ð*AÐBÐBØ—‘˜D !Ó$ˆØ�a�y�‰Ó ˆÜ$'¨£K°!¤Oˆv�a�y�‰Ô ¸ˆØ�8ÔßÜÐ7Ó8Ð8ð;Ü˜$Ÿ*™*›, q�/Ó*�ô %Ø! 3×#5Ñ#5°sÄJÔP\ÐC]ô‰LˆGð ×OÐOœ!Ð5¸SÔOÐOØ�7Œ?Ü!Ð"2°C×4FÑ4FÔP\ÈÔ_‰IˆDßØ�
ßÜÐ8Ó9Ð9Ü°d¸a´iÐ2ÐlpÔqÐqÐEdÐlpÔqÐqÜ˜j¨#¯/©/¸4Ó@‰	ˆßØˆJØ),¯¯¨Œc�#—)‘)×$Ñ$Ô%¸ˆÜÐ(°Ô?Ð?òA Løô ô ;ÜÐ9Ó:Ò:ð;üs[   ‚=I¿H,Á *IÁ+IÁ>BIÄIÄ H/ Ä.-IÅAIÆ"AIÇ>/IÈ/IÉIÉIÉIc               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r!     s   € ÷ &ñ &°ð &Àñ &r   c              ƒ  ób  aa"  €  ^ RI HpHpHo T P                  R4      G Rj  x€L
   T P                  P                  TP                  4      G Rj  x€L
 p\        TRR4      ;'       g    RpT'       g   \        R4      # T! TR	7      o/ p TP                  pTeš   \        TR
R4      p	R
\        T	R4      '       d   T	P                  M\        T	;'       g    R4      /pR F$  p
\        \        YŠR4      ;'       g    R4      Yz&   K&  	  TP!                  4        UUu/ uF  w  r¼T'       g   K  Y¼bK  	  pppT! STP#                  4       ;'       g    RP%                  4       TR7      pTP'                  R4      ;'       g    RpTP'                  R4      '       d)   \)        TT3R l4      '       d   T\        R4      ,          pT#   \         d,   p\
        P                  RT4       \        R4      u Rp?# Rp?ii ; i ELØ EL­  \         d    Rp EL»i ; iu uppi   \         d    / p Lõi ; i5i)uZ   Handle /loop â€” recurring in-session wakeups, via ``dispatch_loop_command`` (CLI mirror).)ÚLoopManagerÚdispatch_loop_commandÚgoal_blocks_loop_tickzloops module unavailable: %szgateway.loop.unavailableNzloop managerr8   r0   zgateway.loop.no_session©r8   ÚplatformÚvalue)ÚrouterJ   Úcreatedc                 ó(   <€ S ! SP                   4      # r2   r×   )rÖ   r=   s   €€r   r6   Ú?GatewayGoalCommandsMixin._handle_loop_command.<locals>.<lambda>4  s   ø€ Ñ9NÈsÏ~É~Ô9^r   zgateway.loop.goal_defers_note)Úchat_idÚ	chat_typeÚ	thread_idÚuser_idÚ	user_nameÚprofile)Úhermes_cli.loopsrÔ   rÕ   rÖ   r   rU   rV   r   Ú_warm_goals_session_dbÚasync_session_storeÚget_or_create_sessionr*   r<   ÚhasattrrÙ   r   Úitemsr;   r~   Úgetr   )r,   r    rÔ   rÕ   r   Úsession_entryÚsidrÚ   ÚsrcrØ   r3   ÚkÚvrL   rJ   rÖ   r=   s   &&             @@r   Ú_handle_loop_commandÚ-GatewayGoalCommandsMixin._handle_loop_command  sê  ùé € ð	1ßbÑbð ×)Ñ)¨.Ó9×9Ð9ð	!Ø"&×":Ñ":×"PÑ"PÐQV×Q]ÑQ]Ó"^×^ˆMô �m \°4Ó8×>Ð>¸BˆßÜÐ.Ó/Ð/Ù SÔ)ˆð
 ˆð		Ø—,‘,ˆCØŠÜ" 3¨
°BÓ7�Ø#´w¸xÈ×7QÒ7Q X§^¢^ÔWZÐ[c×[iÐ[iÐgiÓWjÐk�Ûc�CÜ!$¤W¨S°rÓ%:×%@Ð%@¸bÓ!A�E“Jñ dà*/¯+©+¬-Ô=©-¡$ !¼1œ˜š©-�Ñ=ñ ' s¨U×-CÑ-CÓ-E×-KÐ-KÈ×,RÑ,RÓ,TÐ\aÔbˆØ—‘˜HÓ%×+Ð+¨ˆØ�:‰:�i× Ò ¤[Õ1^×%_Ò%_Ø”aÐ7Ó8Õ8ˆFØˆøôE ô 	1Ü�L‰LÐ7¸Ô=ÜÐ/Ó0Õ0ûð	1úò 	:â^øÜô 	!Ø ‹Mð	!üó$ >øÜô 	ØŠEð	üsÔ   „H/†
G �H/¤G<¥H/ª(H ÁG?ÁH ÁH/Á+
H/Á6H/ÂA	H ÃAH ÄHÄ-HÄ3H Ä6H/Å.H/Å?H/Æ*H/ÇG9Ç G4Ç.G9Ç/H/Ç4G9Ç9H/Ç?H ÈHÈH/ÈHÈH/ÈH ÈH,È)H/È+H,È,H/r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rM   rG   rI   r�   r•   r¬   r»   rÐ   rð   Ú__static_attributes__r   r   r   r   r      s>   † Ù_õ!õFXõ;õ@4qõl&õ>õ62õ<%@÷N&ñ &r   r   )rö   Ú
__future__r   ÚloggingÚ
agent.i18nr   Úgateway.platforms.eventr   r   Ú	getLoggerrU   r   rÈ   rˆ   r   r   r   r   r   Ú<module>rý      sM   ðñGõ #ã å ß =ð 
×	Ò	˜=Ó	)€õð(¨l¸JÐ-G÷ (÷Xó Xr   