+
    jHàjÎ/  ã                   ó¤   € R t ^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	 R t
R tR R ltR	 tR
 tR tR tR tR tR tR tRR ltR tR tR# )zHOwner-bound native settings and model inventory, never legacy execution.N)Úpartial)ÚPath)ÚRuntimeStoreErrorc                 óF   € R \        \        V 4      R\        \        V 4      /# )z
config.getzmodel.options)r   Ú
config_getÚmodel_options)Ú
connections   &Ú;/home/ubuntu/.hermes/hermes-agent/gateway/session_config.pyÚhandlersr
      s&   € Øœ'¤*¨jÓ9ØœW¤]°JÓ?ðAð Aó    c                 óŽ  € V P                   V P                  rCVP                  VP                  8w  d   \        R 4      hRVP                  9  d   \        R4      hR F2  pWR9   g   K  \        W%,          \        4      '       d   K)  \        R4      h	  VP                  R4      '       d;   ^ RIH	p V! VR,          \        VP                  4      4      '       g   \        R 4      hVP                  '       dQ   TP                  WAR4       ^ RIHp V! VP                  VP                   VP                  ,          P"                  4      # R# )	Úprofile_mismatchzsession:readÚpermission_deniedÚprofileÚinvalid_params)Úprofile_matches_home)Úpolicy_for_sourceN)r   Ú
session_id)Ú	authorityÚactorÚ
profile_idr   ÚcapabilitiesÚ
isinstanceÚstrÚgetÚhermes_cli.profilesr   r   r   Ú	authorizeÚgateway.session_policyr   ÚrunnerÚsessionsÚsource)r   ÚrefÚparamsr   r   Únamer   r   s   &&&     r	   Ú
_authorizer$      sü   € Ø!×+Ñ+¨Z×-=Ñ-=ˆuØ×Ñ˜9×/Ñ/Ô/ÜÐ 2Ó3Ð3Ø˜U×/Ñ/Ô/ÜÐ 3Ó4Ð4Û)ˆØŽ>¤*¨V­\¼3×"?Ô"?Ü#Ð$4Ó5Ð5ñ *ð ‡z�z�)×ÒÝ<Ù# F¨9Õ$5´t¸I×<PÑ<PÓ7Q×RÒRÜ#Ð$6Ó7Ð7Ø
‡~‡~€~Ø×Ñ˜E¨Ô7Ý<Ù  ×!1Ñ!1°9×3EÑ3EÀcÇnÁnÕ3U×3\Ñ3\Ó]Ð]Ùr   c                ó$   € V ^8„  d   QhR\         /# )é   Úreturn©r   )Úformats   "r	   Ú__annotate__r*   $   s   € ÷ Pñ P¤ñ Pr   c                ó  € \         P                  ! \        P                  ! R Uu/ uF,  pY '       d   V P	                  4       MTP                  V4      bK.  	  upRR7      P                  4       4      P                  4       R,          # u upi )uW  ``mcp_rev``: the MCP-relevant sections a client polls (``config.get mtime``) and names back on
``reload.mcp``. Read from the session's frozen policy when it has one â€” a live config edit is not an
MCP reload request, it reaches a chat as a committed generation â€” so the value a client is told to load
is the value the session already holds.T)Ú	sort_keys:Né   N)ÚmcpÚmcp_serversÚtools)ÚhashlibÚsha256ÚjsonÚdumpsÚconfigr   ÚencodeÚ	hexdigest)ÚpolicyÚcfgÚks   && r	   Úmcp_revisionr;   $   sx   € ô
 �>Š>œ$Ÿ*š*Ù/Nó&PÙ/N¨!ð '(¾V¨&¯-©-¬/È×)QÑ)QÐRSÓ)TÒ&TÙ/Nñ&Pà/3ô5ç5;±V³Xó?ç?H¹y»{È3õPð Pùò &Ps   ¥2Bc                 óJ  € ^ RI Hp T! R Uu/ uF  pW 9   g   K  W V,          bK  	  up4      pRV9   d   ^ RIHp V! VR,          4      VR&   R Uu/ uF<  pW P	                  R/ 4      9   g   K  W P	                  R/ 4      P	                  V4      bK>  	  upVR&   V# u upi u upi )é    )Úredact_config_valueÚdisplay©Úlocal_display_configÚvoice)r?   Ú	approvalsÚpaste_collapse_thresholdÚpaste_collapse_char_threshold)Ú
record_keyÚsubmit_mode)Úhermes_cli.configr>   Úgateway.display_configrA   r   )r9   r>   ÚkeyÚresultrA   s   &    r	   Ú_client_configrL   .   sÉ   € õ 6Ù ñ <]ó "lñ <]°CØ`cÑ`jô #0 #¨3¥x¢-ñ <]ñ "ló m€Fà�FÔõ 	@Ù0°¸	Õ1BÓCˆˆyÑñ Fcó 7ÑEb¸cØ§¡¨°"Ó!5Ñ5ô :�sŸG™G G¨RÓ0×4Ñ4°SÓ9Ò9ÑEbñ 7€Fˆ7�Oà€Mùò"lùò7s   �BšBÁB Á.%B c              ƒ   óf  a aaaaa"  € \        S4      0 R	m,
          '       d   \        R4      hSP                  R4      o\        S\        4      '       g   \        R4      hSR
9   d   ^ RIHp V! S SS4      G Rj  x€L
 # \        S SS4      oRS9   d0   SR8w  g   \        SR,          \        4      '       g   \        R4      hSR8X  d   \        S S4      # SP                  '       d   S P                  P                  S4      MRoVV VVVV3R lp\        P                  ! V4      G Rj  x€L
 #  L² L5i)r   rJ   Úcwdr   )Úbusy_configNÚprojectrB   c                  ó  <aaaaaa€ ^ RI Hp  ^ RIHp ^ RIHo ^ RIHo ^ RIH	o \        S
P                  P                  4      oV ! S4      ;_uu_ 4        V! 4       oSP                  R4      ;'       g    / oRVV3R lR	VVV3R
 lRV	VV
VV3R lRV	VV
VV3R lRV3R lRV3R lRVV3R lRV3R lRV3R lRV3R lRVVV3R lRV3R l/pSV9  d   \        R4      hVS,          ! 4       uuR R R 4       #   + '       g   i     R # ; i)!r=   ©Ú_profile_runtime_scope)Úload_config)Úload_user_config_effective)ÚDEFAULT_INDICATOR_STYLE©Ú_get_approval_moder?   Úfullc                  ó8   <€ R \        S! S R,          4      4      /# )r5   úconfig.yaml)rL   )ÚhomerU   s   €€r	   Ú<lambda>Ú*config_get.<locals>.read.<locals>.<lambda>^   s   ø€  ¬>Ñ:TÐUYÐ\iÕUiÓ:jÓ+kÑ lr   Úmtimec                  ó    <€ R SR,          P                  4       '       d"   SR,          P                  4       P                  M^ R\        SS 4      /# )r_   r[   Úmcp_rev)ÚexistsÚstatÚst_mtimer;   )r9   r\   r8   s   €€€r	   r]   r^   _   sG   ø€  'Ø%)¨MÕ%9×$AÑ$A×$CÒ$Cð -1°=Õ,@×+FÑ+FÓ+H×+QÒ+QØIJà!*¬L¸ÀÓ,Eñ"Gr   Ú	reasoningc                  ó"   <€ \        S SSSS4      # ©N)Ú
_reasoning©Úagentr9   r   r8   r!   s   €€€€€r	   r]   r^   c   s   ø€ ¤Z°°v¸sÀJÐPSÔ%Tr   Úfastc                  ó"   <€ \        SSSS S4      # rg   )Ú_fastri   s   €€€€€r	   r]   r^   d   s   ø€ ¤ j°#°v¸uÀcÔ Jr   Úskinc                  ó,   <€ R S P                  RR4      /# )Úvaluern   Údefault©r   ©r?   s   €r	   r]   r^   e   s   ø€  ¨'¯+©+°f¸iÓ*HÑ Ir   Úthemec                  ó,   <€ R S P                  RR4      /# )rp   Ú	tui_themeÚautorr   rs   s   €r	   r]   r^   f   s   ø€  '¨7¯;©;°{ÀFÓ+KÑ!Lr   Ú	indicatorc                  ó,   <€ R SP                  RS 4      /# )rp   Útui_status_indicatorrr   )rV   r?   s   €€r	   r]   r^   g   s   ø€  g¨w¯{©{Ð;QÐSjÓ/kÑ%lr   Údetails_modec                  ó,   <€ R S P                  RR4      /# )rp   r{   Ú	collapsedrr   rs   s   €r	   r]   r^   h   s   ø€ ¨°'·+±+¸nÈkÓ2ZÑ([r   zapprovals.modec                  ó   <€ R S ! 4       /# ©rp   © rW   s   €r	   r]   r^   i   s   ø€ ¨7Ñ4FÓ4HÑ*Ir   Úapproval_modec                  ó   <€ R S ! 4       /# r   r€   rW   s   €r	   r]   r^   j   s   ø€ ¨'Ñ3EÓ3GÑ)Hr   rP   c                  ó   <€ \        SSS 4      # rg   )Ú_project)r9   r"   r8   s   €€€r	   r]   r^   k   s   ø€ ¤8¨F°F¸CÔ#@r   r   c                  ó4   <€ R \        S 4      R\        S 4      /# )r\   r?   r(   )r\   s   €r	   r]   r^   l   s   ø€  F¬C°«I°yÄ#ÀdÃ)Ñ#Lr   r   N)Úgateway.runrS   rH   rT   Úhermes_cli.config_effectiverU   Úhermes_constantsrV   Útools.approval_contextrX   r   r   r   r   r   )rS   rT   ÚgettersrV   rX   r9   r?   r\   rU   rj   r   rJ   r"   r8   r!   s      @@@@@@€€€€€€r	   ÚreadÚconfig_get.<locals>.readQ   sÚ   þ€ Ý6Ý1ÝJÝ<Ý=Ü�J×(Ñ(×3Ñ3Ó4ˆÙ# D×)Õ)Ù“-ˆCØ—g‘g˜iÓ(×.Ð.¨BˆGð ÕlØö Gð ×TÐTØ×JÐJØÔIØÔLØÕlØÔ [Ø Ô"IØÔ!HØÖ@ØÔLð#ˆGð& ˜'Ô!Ü'Ð(8Ó9Ð9Ø˜3–<“>÷1 *×)×)Ó)ús   ÁBC:Ã:D	>   rN   rJ   r   r   )ÚbusyÚverboseÚyoloÚshow_reasoning)Úsetr   r   r   r   Úgateway.session_busy_controlsrO   r$   Ú_voicer   r   rj   ÚasyncioÚ	to_thread)r   r!   r"   rO   r‹   rj   rJ   r8   s   fff  @@@r	   r   r   A   s   ýé € Ü
ˆ6ƒ{Ò<×<Ô<ÜÐ 0Ó1Ð1Ø
�*‰*�UÓ
€CÜ�cœ3×ÒÜÐ 0Ó1Ð1Ø
Ð;Ô;Ý=Ù  ¨S°&Ó9×9Ð9Ü˜
 C¨Ó0€FØ�„˜C 9Ô,´J¸vÀe½}Ìc×4RÒ4RÜÐ 0Ó1Ð1Ø
ˆg„~Ü�j #Ó&Ð&Ø/2¯~¯~¨~ˆJ× Ñ ×&Ñ& sÔ+À4€E÷"ò "ô@ ×"Ò" 4Ó(×(Ð(ñQ :ñP )ùs,   ˆA2D1Á:D-Á;A+D1Ã'AD1Ä(D/Ä)D1Ä/D1c                óþ   € V P                   P                  V P                   P                  VP                  ,          r2\	        VRR4      ;'       g    / pVP                  VP                  VP                  4      R4      # )ze``off`` / ``voice_only`` / ``all``: the session's ``/voice`` mode as the messaging handler stored it.Ú_voice_modeNÚoff)r   r   r   r   Úgetattrr   Ú_voice_key_for_sourcer    )r   r!   r   ÚliveÚmodess   &&   r	   Úsession_voice_moder�   t   s`   € à×'Ñ'×.Ñ.°
×0DÑ0D×0MÑ0MÈcÏnÉnÕ0]ˆDÜ�F˜M¨4Ó0×6Ð6°B€EØ�9‰9�V×1Ñ1°$·+±+Ó>ÀÓFÐFr   c                óR  € ^ RI Hp ^ RIHp Ve   \	        V \
        4      '       d	   V '       g   R# V! V4       Fj  p\        VR/ 4      P                  V 4      pVf   K%  \        VRR4      ;'       g    / pVP                  VP                  VP                  4      R4      R8g  u # 	  R# )z·True/False for a local session the running owner holds (its gateway ``/voice`` mode), else
None (no owner in this process, or not one of its sessions: the sidecar's env flag applies).©Ú_ACTIVE_RUNNER©Úall_authoritiesNr   r—   r˜   )
Úgateway.run_apir    Úgateway.session_authoritiesr¢   r   r   r™   r   rš   r    )r   r    r¢   r   r›   rœ   s   &     r	   Úlocal_voice_enabledr¥   {   s‘   € õ /Ý;ØÒ¤Z°
¼C×%@Ò%@Ï
ÙÙ$ ^Ö4ˆ	Ü�y *¨bÓ1×5Ñ5°jÓAˆØÔÜ˜N¨M¸4Ó@×FÐFÀBˆEØ—9‘9˜^×AÑAÀ$Ç+Á+ÓNÐPUÓVÐZ_Ñ_Ò_ñ	 5ñ
 r   c                ód  € ^ RI Hp ^ RIHp Ve   \	        V \
        4      '       d	   V '       g   R# V! V4       Fs  p\        VR/ 4      P                  V 4      pVf   K%  WP                  VP                  VP                  4      &   VP                  4        \        VP                  V4        R# 	  R# )zâThe one writer for a local session's voice mode outside ``/voice`` (wake, spoken stop): sets
and persists the owner's per-session mode. True when the running owner holds the session, else
None (the sidecar's env flag applies).rŸ   r¡   Nr   T)r£   r    r¤   r¢   r   r   r™   r   r—   rš   r    Ú_save_voice_modesÚlocal_voice_transition)r   Úmoder    r¢   r   r›   s   &&    r	   Úset_local_voice_moderª   Š   sŽ   € õ /Ý;ØÒ¤Z°
¼C×%@Ò%@Ï
ÙÙ$ ^Ö4ˆ	Ü�y *¨bÓ1×5Ñ5°jÓAˆØÔØ\`×&Ñ& ~×'KÑ'KÈDÏKÉKÓ'XÑYØ×,Ñ,Ô.Ü" 4§;¡;°Ô5Úñ 5ñ r   c                óà   € ^ RI p^ RIHp VP                  P	                  R4      pVR8X  dB   Ve<   \        V RR4      VP                  8X  d   VP                  V P                  4       R# R# R# R# )zÕA local session's voice mode went ``off``: end the push-to-talk capture it started in this
process (and drop its late callbacks), as the sidecar's ``voice.toggle off`` did. Another
session's capture is left alone.N)ÚPlatformztui_gateway.serverr˜   Úplatform)	ÚsysÚgateway.configr¬   Úmodulesr   r™   ÚLOCALÚ_stop_session_voice_captureÚchat_id)r    r©   r®   r¬   Úservers   &&   r	   r¨   r¨   œ   s]   € ó Ý'Ø�[‰[�_‰_Ð1Ó2€FØˆu„}˜Ò+´¸À
ÈDÓ0QÐU]×UcÑUcÔ0cØ×*Ñ*¨6¯>©>Ö:ñ 1dÑ+�}r   c                óV   € VP                   '       g   \        R4      hR\        W4      /# )z�The session's own ``/voice`` mode, so Ink mirrors the gateway's per-session state instead of
the sidecar's process-global ``HERMES_VOICE`` (T9).r   rp   )r   r   r�   )r   r!   s   &&r	   r“   r“   §   s*   € ð �>�>ˆ>ÜÐ 0Ó1Ð1ØÔ'¨
Ó8Ð9Ð9r   c                 óú   € ^ RI Hp VP                  '       d   ^ RIHp V! WV4      pM<\        VRR4      ;'       g(    V! VP                  R/ 4      P                  R4      4      pRRRR	R	/P                  VR
4      /# )r=   )Úparse_service_tier)Úcurrent_tierÚservice_tierNrj   rp   Úpriorityrk   Ú	ultrafastÚnormal)Úagent.fast_moder·   r   Úgateway.session_tui_configr¸   r™   r   )r   r!   r8   rj   r9   r·   r¸   Útiers   &&&&&   r	   rm   rm   ¯   ss   € Ý2Ø
‡~‡~€~Ý;Ù˜J¨VÓ4‰ä�u˜n¨dÓ3×sÐsÑ7IÈ#Ï'É'ÐRYÐ[]ÓJ^×JbÑJbÐcqÓJrÓ7sˆØ�j &¨+°{ÐC×GÑGÈÈhÓWÐXÐXr   c                 ó:  € ^ RI Hp \        V RR4      p\        V\        4      '       g\   VeX   VP
                  P                  pVP                  WsP
                  P                  VP                  ,          P                  4      pM\        V\        4      '       g
   V! VR4      pV'       d   VP                  R4      RJ d   RMT;'       g    / P                  RR	4      p^ R
IHp	 V	! VP                  R4      4      P                  RR4      p
RTRV
'       d   R/# R/# )r=   )Úresolve_reasoning_configÚreasoning_configNÚ ÚenabledFÚnoneÚeffortÚmediumr@   r?   r�   Trp   ÚshowÚhide)rˆ   rÁ   r™   r   Údictr   r   Úcurrent_reasoning_configr   r   Úrouter   rI   rA   )rj   r8   r9   r   r!   rÁ   rp   r   rÆ   rA   Úshowns   &&&&&      r	   rh   rh   ¹   sé   € Ý9Ü�EÐ-¨tÓ4€EÜ�eœT×"Ò" vÒ'9à×%Ñ%×,Ñ,ˆØ×/Ñ/°×8LÑ8L×8UÑ8UÐVY×VdÑVdÕ8e×8kÑ8kÓl‰Ü˜œt×$Ò$Ù(¨¨bÓ1ˆß §¡¨9Ó!5¸Ó!>‰VÀUÇ[À[Èb×DUÑDUÐV^Ð`hÓDi€FÝ;Ù  §¡¨Ó!3Ó4×8Ñ8Ð9IÈ4ÓP€EØ�V˜Y·%¨ÐDÐD¸VÐDÐDr   c                 ó  € ^ RI Hp V P                  R4      ;'       g6    V'       d   VP                  M VP                  R/ 4      P                  R4      pV'       g   ^ RIHp \        V! 4       4      pRVRVP                  V4      /# )r=   )Ú	git_proberN   Úterminal)Úresolve_agent_cwdÚbranch)Útui_gatewayrÏ   r   rN   Úagent.runtime_cwdrÑ   r   rÒ   )r"   r8   r9   rÏ   rN   rÑ   s   &&&   r	   r„   r„   È   sh   € Ý%Ø
�*‰*�UÓ
×
]Ð
]¯f §
¢
¸#¿'¹'À*ÈbÓ:Q×:UÑ:UÐV[Ó:\€CßÝ7ÜÑ#Ó%Ó&ˆØ�3˜ )×"2Ñ"2°3Ó"7Ð8Ð8r   c              ƒ   ó  a aaaaa	"  € 0 Rmo\        S4      S,
          RR0,
          '       gk   \        ;QJ d4    V3R lSSP                  4       ,           4       F  '       g   K   RM)	  RM%! V3R lSSP                  4       ,           4       4      '       d   \        R4      h\	        S VS4      pVP
                  '       d   S P                  P                  V4      MRp\        VRR4      ;'       g    V'       d   VP                  MRo	\        VR	R4      ;'       g    V'       d   VP                  MRo\        VR
R4      ;'       g    V'       d   VP                  MRoVV VVVV	3R lp\        P                  ! V4      G Rj  x€L
 #  L5i)Úexplicit_onlyr   r   c              3   óT   <"  € T F  p\        SV,          4      \        Jx € K  	  R # 5irg   )ÚtypeÚbool)Ú.0r:   r"   s   & €r	   Ú	<genexpr>Ú model_options.<locals>.<genexpr>Ô   s    øé € ÐNÑ8M°1”4˜˜q�	“?¬$Õ.Ó8Mùs   ƒ%(TFr   NÚproviderÚmodelÚbase_urlc                  óº  <€ ^ RI Hp  ^ RIHpHp V ! \        SP                  P                  4      4      ;_uu_ 4        V! 4       pSpVR8X  d&   ^ RIH	p V! SVP                  S
R7      ;'       g    TpT! VP                  VS
SR7      3/ S	SP                  4       ,           Uu/ uF  qfSV,          bK  	  upB uuRRR4       # u upi   + '       g   i     R# ; i)r=   rR   )Úload_picker_contextÚbuild_model_options_payloadÚcustom)Úcanonical_custom_identity)rß   Úconfig_providerrÞ   )Úcurrent_providerÚcurrent_modelÚcurrent_base_urlN)r†   rS   Úhermes_cli.inventoryrá   râ   r   r   r   Úhermes_cli.runtime_providerrä   ræ   Úwith_overridesÚkeys)rS   rá   râ   ÚctxÚselectedrä   r:   rß   r   ÚflagsrÞ   r"   rÝ   s          €€€€€€r	   ÚdiscoverÚmodel_options.<locals>.discoverÜ   sÚ   ø€ Ý6ßYÙ#¤D¨×)=Ñ)=×)HÑ)HÓ$I×JÕJÙ%Ó'ˆCØˆHØ˜8Ô#ÝQÙ4¸hÐX[×XlÑXlØ;@ôB÷ Nð NØEMð á.¨s×/AÑ/AÐS[Ø#°hð 0Bó 0@ñ rØZ_Ðbh×bmÑbmÓboÖZoÓCpÑZoÐUVÀvÈaÅyÂLÑZoÑCpñr÷ KÒJùò Dq÷ K×JÐJús#   ½2C	Á03C	Â#CÂ5C	ÃC	Ã	C	>   ÚrefreshrÖ   Úinclude_unconfigured)r‘   Úanyrì   r   r$   r   r   rj   r™   rÝ   rÞ   rß   r”   r•   )
r   r!   r"   r8   rj   rð   rß   rï   rÞ   rÝ   s
   f&f   @@@@r	   r   r   Ñ   s  ýé € Ú@€EÜˆF‹�eÕ˜y¨,Ð7×7Ô7ß‹sÔN¸ÀÇÁÃÖ8MÓN�s�sŠsÔN¸ÀÇÁÃÖ8MÓN×NÒNÜÐ 0Ó1Ð1Ü˜
 C¨Ó0€FØ/2¯~¯~¨~ˆJ× Ñ ×&Ñ& sÔ+À4€EÜ�u˜j¨$Ó/×XÐXÇv°F·O²OÐSW€HÜ�E˜7 DÓ)×OÐO¿f¨f¯lªlÈ$€EÜ�u˜j¨$Ó/×XÐXÇv°F·O²OÐSW€H÷rò rô ×"Ò" 8Ó,×,Ð,Ñ,ùsG   ˆ0F¹)FÁ%2FÂAFÃ3FÃ<!FÄFÄ'!FÅ	FÅ2FÆF	ÆF)NN)Ú__doc__r”   Ú	functoolsr   r1   r3   Úpathlibr   Úhermes_state_runtimer   r
   r$   r;   rL   r   r�   r¥   rª   r¨   r“   rm   rh   r„   r   r€   r   r	   Ú<module>rù      sf   ðÙ NÛ Ý Û Û Ý å 2òAò
õ(Pòò&0)òfGòòò$;ò:òYôEò9ô-r   