+
    lHàjä  ã                   óØ   € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	 R t
RR R lltR R	 ltR
RRRRRRRRRRRR/RRRRR/RRRRR//RR.//t]P                  ! RR]R ]RR7       R# ) a`  Agent emoji reaction in the Hermes desktop app: the counterpart to the user's tapback
(same store, one-per-author, ``author="agent"``). Lives in the ``desktop_ui`` toolset so it
costs nothing elsewhere (adapters expose reactions via ``send_message(action="react")``);
defaults to the triggering message and emits ``message.reaction`` for live painting.N)Úget_session_env)Ú
desktop_ui)ÚregistryÚ
tool_errorc                 óB   €  ^ RI Hp  V ! 4       #   \         d     R# i ; i)zAOpen the SessionDB for the profile owning this turn, or ``None``.©ÚacquireN)Úhermes_state_registryr   Ú	Exceptionr   s    Ú@/home/ubuntu/.hermes/hermes-agent/tools/react_to_message_tool.pyÚ_open_session_dbr      s$   € ðÝ1Ù‹yÐøÜô Úðús   ‚ ��c                ó0   € V ^8„  d   QhR\         R\         /# )é   ÚemojiÚreturn)Ústr)Úformats   "r   Ú__annotate__r      s   € ÷ #!ñ #!¤ð #!ÔRUñ #!ó    c                ó¨  € T ;'       g    RP                  4       p \        RR4      ;'       g    \        RR4      pV'       g   \        R4      # \        4       pVf   \        R4      #  TRreVf‹   \	        ^ \        T;'       g    ^ 4      4      pVP                  VRVR7      pVfS   \        V'       d   R	V R
2MR4      \        P                  ! \        4      ;_uu_ 4        ^ RI
Hp V! V4       RRR4       # M%VP                  V\        V4      4      ;'       g    Rp TP                  T\        V4      T ;'       g    RRR7      p	T	fI   \        RT R24      \        P                  ! \        4      ;_uu_ 4        ^ RI
Hp T! T4       RRR4       # \        P                  ! \        4      ;_uu_ 4        \        P                  ! RR\        T4      RT	RT/4       RRR4       \         P"                  ! RRR\        T4      RT	/RR7      \        P                  ! \        4      ;_uu_ 4        ^ RI
Hp T! T4       RRR4       #   + '       g   i     # ; i  \         de   p
\        RT
 24      u Rp
?
\        P                  ! \        4      ;_uu_ 4        ^ RI
Hp T! T4       RRR4       #   + '       g   i     # ; iRp
?
ii ; i  + '       g   i     # ; i  + '       g   i     EL	; i  + '       g   i     # ; i  \        P                  ! \        4      ;_uu_ 4        ^ RI
Hp T! T4       RRR4       i   + '       g   i     i ; i; i)zAAttach (or with an empty ``emoji`` retract) the agent's reaction.Ú ÚHERMES_SESSION_IDÚHERMES_SESSION_KEYu>   No active session â€” reactions need a persisted conversation.NzSession storage is unavailable.Úuser)ÚroleÚoffsetzNo user message found z back.z No user message to react to yet.)Úrelease_or_closeÚagent)ÚauthorzFailed to set the reaction: zMessage z" is not part of this conversation.zmessage.reactionÚrow_idÚ	reactionsr   ÚsuccessTF)Úensure_ascii)Ústripr   r   r   ÚmaxÚintÚlatest_message_row_idÚ
contextlibÚsuppressr
   r	   r   Úget_message_roleÚset_message_reactionr   ÚemitÚjsonÚdumps)r   Úmessage_row_idÚmessages_backÚsession_keyÚdbr   Útarget_roleÚbackr   r    Úexcs   &&&        r   Úreact_to_message_toolr5      s’  € à�[ˆ[�b×ÑÓ!€Eä!Ð"5°rÓ:×gÐg¼oÐNbÐdfÓ>g€KßÜÐZÓ[Ð[Ü	Ó	€BØ	‚zÜÐ;Ó<Ð<ð!Ø,¨f�ØŠ>ô �qœ#˜m×0Ð0¨qÓ1Ó2ˆDØ×-Ñ-¨kÀÈtÐ-ÓTˆFØŠ~Ü!Ï4Ð$:¸4¸&ÀÑ"GÐUwÓxô × Ò ¤×+Õ+Ý>Ù˜RÔ ÷ ,Ð+ð! ð ×-Ñ-¨k¼3¸v»;ÓG×QÐQÈ6ˆKð	DØ×/Ñ/°¼SÀ»[È%Ï-È-ÐSWÐ`gÐ/ÓhˆIð ÒÜ ¨¨Ð0RÐSÓTô × Ò ¤×+Õ+Ý>Ù˜RÔ ÷ ,Ð+ô	 × Ò ¤×+Õ+Ü�OŠOÐ.°¼3¸v»;ÈÐU^Ð`fÐhsÐ0tÔu÷ ,ä�zŠz˜9 d¨H´c¸&³kÀ;ÐPYÐZÐinÔoä× Ò ¤×+Õ+Ý>Ù˜RÔ ÷ ,×+×+Ð+ûô ô 	DÜÐ <¸S¸EÐBÓCÔCô × Ò ¤×+Õ+Ý>Ù˜RÔ ÷ ,×+×+Ð+þð	Dú÷ ,×+ú÷	 ,×+Ð+ú÷ ,×+ûŒZ× Ò ¤×+Õ+Ý>Ù˜RÔ ÷ ,×+×+Ð+ýsº   Á(L Â;L Ã IÃ8"L ÄL ÄI Ä>	I ÅL Å;K	Æ"L Æ5'KÇ.L È,K0ÉIÉKÉ"KÉ/KÉ0L ÊJ.Ê.J>ËKËL Ë	KËK-	Ë'	L Ë0L Ì#MÌ&L>	Ì5	MÌ>MÍ	Mc                ó$   € V ^8„  d   QhR\         /# )r   r   )Úbool)r   s   "r   r   r   >   s   € ÷ Gñ G¤$ñ Gr   c                 ó2   € \         P                  ! RRR7      # )uX   Opt-in flag (Settings â†’ Appearance); ``desktop_ui`` already restricts to GUI sessions.Úmessage_reactionsF)Údefault)r   Úuser_enabled© r   r   Úcheck_react_requirementsr=   >   s   € ä×"Ò"Ð#6ÀÔFÐFr   ÚnameÚreact_to_messageÚdescriptionu  React to a message with a single emoji, the way you'd tapback in iMessage. Reach for it when a reaction is what a person would do: something funny gets a ðŸ˜‚, warmth gets a â�¤ï¸�, a plan you're on board with gets a ðŸ‘� â€” then just carry on with whatever the message actually needs. If a reaction says it all, it can BE the reply (skip the redundant 'sounds good!' turn). Use it like a person would: occasionally, when felt â€” not on every message, and never as a status signal. NEVER narrate or explain a reaction ('I reacted with...', 'Reacting now') â€” the emoji appearing on the bubble is the whole point, and commentary kills it. Defaults to the user's most recent message. One reaction per message: a different emoji replaces yours, an empty string retracts it.Ú
parametersÚtypeÚobjectÚ
propertiesr   Ústringuf   The emoji to react with (e.g. 'â�¤ï¸�', 'ðŸ˜‚', 'ðŸ‘�'). Pass an empty string to remove your reaction.r.   Úintegerz}Optional. The specific message to react to. Omit to react to the user's latest message, which is almost always what you want.r/   u®   Optional. React to an EARLIER user message: 1 = the one before the latest, 2 = two before, and so on. For when something lands late â€” the joke you only got after answering.Úrequiredr   c                 óz   € \        V P                  R R4      V P                  R4      V P                  R4      R7      # )r   r   r.   r/   )r   r.   r/   )r5   Úget)ÚargsÚkws   &,r   Ú<lambda>rL   s   s0   € Ô4Ø�h‰h�w Ó#°D·H±HÐ=MÓ4NØ—h‘h˜Ó/õ 1r   u   ðŸ’›)r>   ÚtoolsetÚschemaÚhandlerÚcheck_fnr   )NN)Ú__doc__r'   r,   Úgateway.session_contextr   Útoolsr   Útools.registryr   r   r   r5   r=   ÚREACT_TO_MESSAGE_SCHEMAÚregisterr<   r   r   Ú<module>rW      sÏ   ðñXó
 Û å 3Ý ß /ò÷#!õLGð ÐØð
	ð Ø�ØØØ˜Øð6ðð Ø˜	ØðSðð Ø˜	ØðFðð
ð0 	�W�Ið5ð+Ð ð\ 	× Ò Ø	 \Ð:Qñ1ð &¨V÷r   