+
    „WÝjø  ã                  óV   € R t ^ RIHt ^ RIt^ RIHtHtHt ^ RIH	t	 R R lt
R R ltR# )	zËConversation-wide ``sessions.model_config`` keys: read-modify-write at the compression tip and the
key scan. Bodies of :class:`hermes_state_sessions.SessionSessionsMixin`'s two methods of the same names.)ÚannotationsN)ÚAnyÚCallableÚOptional)Ú_sql_json_extractc               ó(   € V ^8„  d   QhRRRRRRRR/# )é   Ú
session_idÚstrÚkeyÚupdatezCallable[[Any], Any]ÚreturnúOptional[str]© )Úformats   "ÚVC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_state_sessions_model_config.pyÚ__annotate__r      s*   € ÷ "ñ "¸3ð "ÀSð "Ø3Gð"ØLYñ"ó    c                óT   a aaaa€ ^ RI Ho R VV VVV3R llpS P                  V4      # )aË  Read a conversation-wide ``key`` at *session_id*'s compression tip and write ``update(value)``
back, in one write transaction: a concurrent writer of the key cannot be overwritten with a stale
copy, and a rotation cannot publish between finding the tip and writing it (the child would keep
the old copy). ``update`` may run more than once (lock retry) and must be pure; returning None
removes the key. Returns the id written, None when the row does not exist.)Ú_parse_model_configc               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   Ú<update_conversation_model_config_value.<locals>.__annotate__   s   € ÷ ñ �]ñ r   c                óL  <€ SP                  V S4      pV P                  R V34      P                  4       pVf   R# S! V^ ,          4      pS	! VP                  S4      4      ;pf   VP	                  SR4       MWCS&   V P                  R\
        P                  ! V4      V34       V# )z.SELECT model_config FROM sessions WHERE id = ?Nz1UPDATE sessions SET model_config = ? WHERE id = ?)Ú_compression_tip_onÚexecuteÚfetchoneÚgetÚpopÚjsonÚdumps)
ÚconnÚtipÚrowÚconfigÚvaluer   Údbr   r	   r   s
   &    €€€€€r   Ú_doÚ3update_conversation_model_config_value.<locals>._do   s˜   ø€ Ø×$Ñ$ T¨:Ó6ˆØ�l‰lÐKÈcÈVÓT×]Ñ]Ó_ˆØŠ;ÙÙ$ S¨¥VÓ,ˆÙ˜FŸJ™J s›OÓ,Ð,ˆEÒ5Ø�J‰J�s˜DÕ!à�3‰KØ�‰ÐHÌ4Ï:Ê:ÐV\ÓK]Ð_bÐJcÔdØˆ
r   )Úhermes_state_sessionsr   Ú_execute_write)r%   r	   r   r   r&   r   s   ffff @r   Ú&update_conversation_model_config_valuer*      s%   ü€ õ :÷ô ð ×Ñ˜SÓ!Ð!r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r
   r   z	list[str]r   )r   s   "r   r   r   $   s   € ÷ 'ñ '¨sð '°yñ 'r   c           
     ó  € V P                  4       ;_uu_ 4       pVP                  R\        RRV,           4       R24      P                  4       pRRR4       X Uu. uF  qDR,          NK  	  up#   + '       g   i     L(; iu upi )zEIds of the sessions whose model_config carries ``key``, newest first.zSELECT id FROM sessions WHERE Úmodel_configz$.z% IS NOT NULL ORDER BY started_at DESCNÚid)Ú	_read_ctxr   r   Úfetchall)r%   r   r    Úrowsr"   s   &&   r   Ú!session_ids_with_model_config_keyr2   $   ss   € à	�‰�Œ˜4Ø�|‰|Ø,Ô->¸~ÈtÐVYÍzÓ-ZÐ,[ð \'ð 'ó(ç(0©«
ð 	÷ 
ñ "&Ó&¡˜#��IˆI¡Ñ&Ð&÷	 
�üò 's   ™5A.ÁBÁ.A>	)Ú__doc__Ú
__future__r   r   Útypingr   r   r   Úhermes_state_commonr   r*   r2   r   r   r   Ú<module>r7      s&   ðñlõ #ã ß *Ñ *å 1õ"÷0'r   