+
    jHàjö  ã                   óª   € R t ^ RIt^ RIHt ]P                  ! ]4      tRRRRRRRRRRRRR	RR
RRRRR/
t]! 0 Rm4      t	Rt
R tR tRRRR/R ltR tR# ) aÕ  Desktop's goal / loop / heartbeat / subgoal card buttons (``session.control``) on the owner.

``session.control.read`` was served, so the cards rendered as controllable, while every button
answered -32601. Each action is the typed slash command the button stands for, run through
``execute_command`` (the gateway's own /goal /loop /heartbeat /subgoal handlers, with their
capability, local-source, admission and busy rules), answered with the owner's control snapshot.
N)ÚRuntimeStoreErrorz
goal.pausezgoal.resumez
goal.clearzgoal.unwaitz
loop.pausezloop.resumez	loop.stopzheartbeat.pausezheartbeat.resumezheartbeat.clearc                 óî  € \        V\        4      '       d   \        V4      R R0,
          '       d   \        R4      hV R8X  d<   \	        VP                  R4      4      \        Jg   VR,          ^8  d   \        R4      hV R8X  dN   \        VP                  R 4      \        4      '       d   VR ,          P                  4       '       g   \        R4      hV \        9  d   V \        9  d   \        R4      hR# R# )ÚtextÚindexÚinvalid_paramsúsubgoal.removeúsubgoal.addN)Ú
isinstanceÚdictÚsetr   ÚtypeÚgetÚintÚstrÚstripÚ_ACTION_COMMANDSÚ_SUBGOAL_ACTIONS)ÚactionÚargss   &&ÚD/home/ubuntu/.hermes/hermes-agent/gateway/session_control_actions.pyÚ	_validater      sÉ   € Ü�dœD×!Ò!¤S¨£Y°&¸'Ð1B×%BÔ%BÜÐ 0Ó1Ð1ØÐ!Ô!¤t¨D¯H©H°WÓ,=Ó'>ÄcÓ'IÈTÐRYÍ]Ð]^ÔM^ÜÐ 0Ó1Ð1Ø�Ô¬
°4·8±8¸FÓ3CÄS×(IÒ(IÐQUÐV\ÕQ]×QcÑQc×QeÒQeÜÐ 0Ó1Ð1ØÔ%Ô%¨&Ô8HÔ*HÜÐ 0Ó1Ð1ñ +IÑ%ó    c           
   ƒ  óÎ  "  € ^ RI Hp ^ RIHp ^ RIHp ^ RIHp ^ RIH	p	 ^ RI
Hp
 V P                  pV	! WVR4       VP                  VP                  ,          pV
! VP                  VP                   4      RJd   \#        R	4      hVP%                  4        V! V! VP&                  4      4      ;_uu_ 4        VP                  P)                  V! R
VP                   R7      4      G Rj  x€L
 w  rÞVf   \#        RV! R4      R7      hVP+                  4       '       g   \#        RV! R4      R7      h VR8X  dP   VP-                  VR,          P/                  4       4      pV! R\1        VP2                  P4                  4      VR7      pMfVR8X  d,   VP7                  VR,          4      pV! RVR,          VR7      pM4VP9                  4       pV'       d   T! V^8X  d   RMRVR7      MV! R4      p RRR4       RR R!X/#  EL  \:         d   p\#        RR\=        T4      R7      ThRp?i\>        \@        3 d   p\#        R\=        T4      R7      ThRp?ii ; i  + '       g   i     Lo; i5i)"z¿A criterion button on the session's goal manager. A goal that is gone or an index that no longer exists is a refusal the card shows; the typed /subgoal command reports the same cases as text.)ÚPath)Út)ÚMessageEvent)Ú_profile_runtime_scope)Ú	authorize)Úauthorize_local_sourcezsession:controlTÚpermission_deniedz/subgoal)r   ÚsourceNÚcommand_unavailablezgateway.goal.unavailable)ÚdetailÚgoal_not_activezgateway.subgoal.no_goalr   r   zgateway.subgoal.added)r   r   r   r   zgateway.subgoal.removedzgateway.subgoal.cleared_onezgateway.subgoal.cleared_other)Úcountzgateway.subgoal.none_to_clearr   )Úfieldr"   r   ÚexecÚoutput)!Úpathlibr   Ú
agent.i18nr   Úgateway.platforms.baser   Úgateway.runr   Úgateway.session_busy_controlsr   Úgateway.session_localr   Ú	authorityÚsessionsÚ
session_idÚrunnerr    r   Ú_require_admission_openÚ
profile_idÚ_get_goal_manager_for_eventÚhas_goalÚadd_subgoalr   ÚlenÚstateÚsubgoalsÚremove_subgoalÚclear_subgoalsÚ
IndexErrorr   ÚRuntimeErrorÚ
ValueError)Ú
connectionÚrefÚparamsr   r   r   r   r   r   r   r   r.   ÚliveÚmgrÚ_entryÚaddedr'   Úremovedr$   Úexcs   &&&&&               r   Ú_subgoalrH   $   s  é € åÝÝ3Ý2Ý7Ý<Ø×$Ñ$€IÙˆj˜vÐ'8Ô9Ø×Ñ˜cŸn™nÕ-€DÙ˜i×.Ñ.°·±Ó<ÀDÓHÜÐ 3Ó4Ð4Ø×%Ñ%Ô'Ù	¡ Y×%9Ñ%9Ó :×	;Õ	;Ø%×,Ñ,×HÑHÙ˜j°·±Ô=ó?÷ ?‰ˆàŠ;Ü#Ð$9Á!ÐD^ÓB_Ô`Ð`Ø�|‰|�~Š~Ü#Ð$5¹aÐ@YÓ>ZÔ[Ð[ð	PØ˜Ô&ØŸ™¨¨V­×(:Ñ(:Ó(<Ó=�ÙÐ2¼#¸c¿i¹i×>PÑ>PÓ:QÐX]Ô^‘ØÐ+Ô+Ø×,Ñ,¨T°'­]Ó;�ÙÐ4¸DÀ½MÐPWÔX‘à×*Ñ*Ó,�ç"ñ ¸UÀa¼ZÑ9ÐMlÐtyÕzÙ()Ð*IÓ(Jñ ÷! 
<ð, �F˜H fÐ-Ð-ò+?øô" ô 	_Ü#Ð$4¸GÌCÐPSËHÔUÐ[^Ð^ûÜœjÐ)ô 	PÜ#Ð$4¼SÀ»XÔFÈCÐOûð	Pú÷) 
<×	;üs‹   ‚B4I%Â61IÃ'G9Ã(2IÄIÄ/AG<ÆIÆ1G<Æ6IÆ7G<ÇG<Ç*IÇ+I%Ç9IÇ<IÈHÈIÈ2IÈ3I
É
IÉIÉI"	ÉI%Úonly_if_presentFÚonly_if_changedc               óÂ  € V e   V P                   P                  V4      MRpVf   R# ^ RIHp ^ RIHp  V! W! V P                  V4      4      pT'       d   TR,          '       d!   T'       d   TR,          TP                  8X  d   R# TR,          Tn
        TP                  P                  TRT/R	R
7       R#   \         d    \        P                  RTRR7        R# i ; i)aA  Push one live session's control snapshot to every viewer as ``session.control.update``.

Desktop, Ink and the classic CLI paint the goal/loop/heartbeat cards from this event and run the loop
countdown off its ``next_due_at``, so every place that moves that state on the owner publishes: the
slash commands, a fired or settled loop wakeup, a judged turn, a tool that changed it mid-turn.
``only_if_present`` skips a session with no automation state (a plain turn's event stream stays
unchanged); ``only_if_changed`` also skips one whose snapshot matches the last one published.
N)Úcontrol_snapshot)Ú
SessionRefz%session.control.update skipped for %sT)Úexc_infoÚrevisionÚcontrolzsession.control.update)Ú
event_type)r/   r   Úgateway.session_ancillaryrL   Úgateway.session_contractrM   r3   r   ÚloggerÚdebugÚcontrol_revisionÚevent_streamÚpublish)r.   r0   rI   rJ   rB   rL   rM   Úsnapshots   &&$$    r   rX   rX   K   sÌ   € ð 2;Ò1Fˆ9×Ñ×!Ñ! *Ô-ÈD€DØ‚|ÙÝ:Ý3ðÙ# I¨z¸)×:NÑ:NÐPZÓ/[Ó\ˆ÷ 	 ¨× 4Ô 4¿/ÈhÐWaÕNbÐfj×f{Ñf{ÔN{ÙØ$ ZÕ0€DÔØ×Ñ×Ñ˜j¨9°hÐ*?ÐLdÐÖeøô ô Ü�‰Ð<¸jÐSWˆÔXÚðús   µB7 Â7#CÃCc           	   ƒ   óx  "  € \        V4      0 Rm,
          '       g   VP                  '       g   \        R4      hVP                  R4      p\	        V\
        4      '       g   \        R4      hVP                  R4      f   / MVR,          pVP                  4       p\        W44       VP                  V P                  P                  9  d   \        R4      hR Uu/ uF  qUV9   g   K  WRV,          bK  	  ppV\        9   d7   \        WWcV4      G Rj  x€L
 p\        V P                  VP                  4       M0^ RIHp \        V,          w  ršV! W/ VCRV	RV
/CR	R
7      G Rj  x€L
 p^ RIHp V! WVRR7      G Rj  x€L
 p/ VCR\$         Uu/ uF  qUVP                  V4      bK  	  up/C# u upi  Lž LO L8u upi 5i)r0   r   r   r   NÚ	not_found)Úexecute_commandÚnameÚargT)Údispatch)ÚreadrP   )Úkindr_   >   r   r   Úprofiler0   )r0   rb   )r   r0   r   r   r	   r   r   r   r.   r/   r   rH   rX   Úgateway.session_commandsr\   r   rR   r`   Ú	_ENVELOPE)r?   r@   rA   r   r   ÚkeyÚscopeÚresultr\   r]   r^   r`   rY   s   &&&          r   rP   rP   d   s  é € Ü
ˆ6ƒ{Ò@×@Ô@ÈÏÏÈÜÐ 0Ó1Ð1Ø�Z‰Z˜Ó!€FÜ�fœc×"Ò"ÜÐ 0Ó1Ð1Ø—‘˜FÓ#Ò+‰2°¸µ€DØ�\‰\‹^€FÜˆfÔØ
‡~�~˜Z×1Ñ1×:Ñ:Ô:Ü Ó,Ð,Ù)BÓTÑ)B #ÈVÁmÔˆS˜•+ÒÑ)B€EÐTð Ô!Ô!Ü 
°ÀÓE×EˆÜ�
×$Ñ$ c§n¡nÕ5å<Ü$ VÕ,‰	ˆÙ& zÐ8[¸5Ð8[À&È$ÐPUÐWZÑ8[ÐfjÔk×kˆÝ.Ù˜*¨5°yÔA×A€HØPˆhÐP˜
ÅYÓ$OÁY¸c¨&¯*©*°S«/Ò%9ÁYÑ$OÑPÐPùò Uñ Fñ
 láAùÚ$Oùs`   ‚,F:¯B*F:ÃF*Ã&F*Ã3F:ÄF/ÄAF:Å!F1Å"F:Å:F3Å;F:ÆF5Æ%F:Æ1F:Æ3F:Æ5F:)ÚgoalÚpause)rh   Úresume)rh   Úclear)rh   Úunwait)Úloopri   )rm   rj   )rm   Ústop)Ú	heartbeatri   )ro   rj   )ro   rk   >   r   úsubgoal.clearr   )r   r'   ÚnoticeÚmessageÚdisplay)Ú__doc__ÚloggingÚhermes_state_runtimer   Ú	getLoggerÚ__name__rT   r   Ú	frozensetr   rd   r   rH   rX   rP   © r   r   Ú<module>r{      sž   ðñó å 2à	×	Ò	˜8Ó	$€ð Ð# ]Ð4FØÐ# ]Ð4FØÐ# ]Ð4FÈÐUeØÐ-Ð/AÐCZØÐ-ðÐ ñ ÒOÓPÐ Ø>€	ò2ò$.ðNf°eð fÈUô fô2Qr   