+
    lHàjÅv  ã                   óÔ  a € Rc t70 t R t^ RIt^ RIt^ RIt^RIHtHt ^RI	H
t
 ^ RIHtHt ^ RIHt ]! 4       t]P"                  t]P$                  t]P(                  P+                  ]! ^]! ^]
! R^4      4      4      RR7      t]P2                  ! R	 4       ]P4                  ! 4       t/ t] ^ k R
tRtRtRt R R lt!R t"]!! R4      R R l4       t#]!! R4      R R l4       t#R t$]!! R4      R R l4       t#]!! R4      R R l4       t#R R lt%R  R! lt&]'! 0 Rdm4      t(R# t)R$ t*R% t+R& t,R' t-R( t.R) t// R*])bR+R, bR-]*bR"R. bR/R0 bR1R2 bR3R4 bR5]+bR6],bR7]-bR8R9 bR:R; bR<R= bR>R? bR@].bRARB bRCRD bRERF RGRH RIRJ RK]//Ct0R*RLR:RMR<RM/t1]! RN4      ]RO RP l4       4       t#RQ t2RR t3RS t4]! RT4      RU RV l4       t#]! RW4      RX RY l4       t#RZ R[ lt5R\ R] lt6]! R^4      R_ R` l4       t#Ra Rb ltR# )ez·Config / projects / setup JSON-RPC handlers. Bodies are rebound onto server.py's globals
(method_ctx.bind_module) and reference them bare. ``config.set`` lives in methods_config_set.
N)ÚHandlerRegistryÚbind_module)Úenv_int)ÚDEFAULT_INDICATOR_STYLEÚINDICATOR_STYLES)Údisplay_hermes_homeÚHERMES_TUI_RPC_POOL_WORKERSztui-readiness)Úmax_workersÚthread_name_prefixc                  ó0   € \         P                  R RR7      # )FT)ÚwaitÚcancel_futures)Ú_readiness_poolÚshutdown© ó    Ú?/home/ubuntu/.hermes/hermes-agent/tui_gateway/methods_config.pyÚ<lambda>r   /   s   € œ×0Ñ0°eÈDÐ0ÔQr   g      @g      à?g      (@ié  c                ó$   € V ^8„  d   QhR\         /# )é   Úname©Ústr)Úformats   "r   Ú__annotate__r   D   s   € ÷ 	ñ 	œCñ 	r   c                ó   a € V 3R lpV# )z_``@method(name)`` (profile-scoped) whose body's uncaught exception becomes ``_err(rid, 5061)``.c                 óL   <a € R  V 3R llp\        S4      ! \        V4      4      # )c                ó0   € V ^8„  d   QhR\         R\         /# ©r   ÚparamsÚreturn©Údict)r   s   "r   r   Ú5_projects_handler.<locals>.deco.<locals>.__annotate__G   s   € ÷ 	/ñ 	/¤ð 	/¬$ñ 	/r   c                 ór   <€  S! W4      #   \          d!   p\        T R \        T4      4      u Rp?# Rp?ii ; i)iÅ  N)Ú	ExceptionÚ_errr   )Úridr   ÚeÚfns   && €r   ÚhandlerÚ0_projects_handler.<locals>.deco.<locals>.handlerG   s5   ø€ ð/Ù˜#“Ð&øÜô /Ü˜C ¤s¨1£vÓ.Õ.ûð/ús   ƒ ‹6–1«6±6)ÚmethodÚ_profile_scoped)r)   r*   r   s   f €r   ÚdecoÚ_projects_handler.<locals>.decoF   s#   ù€ ÷	/ð 	/ô
 �dŒ|œO¨GÓ4Ó5Ð5r   r   )r   r.   s   f r   Ú_projects_handlerr0   D   s   ø€ õ6ð €Kr   c                 ó>   € V P                  W\        V4      R 7       R# ))Úpreserve_unversionedN)Ú!reconcile_discovered_repos_policyÚ!_repo_discovery_policy_is_default)ÚpdbÚconnÚpolicyÚ
policy_keys   &&&&r   Ú_reconcile_repo_discoveryr9   P   s!   € Ø×)Ñ)¨$Ü?`ÐagÓ?hð *ö jr   zprojects.discover_reposc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   V   s   € ÷ Fñ F”4ð FœDñ Fr   c                óÄ  € \        V4      ;_uu_ 4       p^ RIHp \        4       pVP	                  4       ;_uu_ 4       p\        W5V\        V4      4       VP                  R4      '       d   VR,          '       d   \        WT4       \        W%VR,          R7      pRRR4       \        V RXRV/4      uuRRR4       #   + '       g   i     L*; i  + '       g   i     R# ; i)u¼   Repos for the desktop overview: scanned-from-disk (cached) âˆª session-derived. A profile whose
session store was never initialized still answers from its scan cache (``db`` is None then).©Úprojects_dbÚscanÚenabled)r6   Úinclude_cachedNÚreposÚdiscovery_policy)Ú_profile_dbÚ
hermes_clir=   Ú_repo_discovery_policyÚconnect_closingr9   Ú_repo_discovery_policy_keyÚgetÚ_scan_discovered_repos_remoteÚ_discover_repos_payloadÚ_ok)r'   r   Údbr5   r7   r6   rA   s   &&     r   Ú_rM   U   s­   € ô 
�V×	Ô	 Ý1Ü'Ó)ˆØ× Ñ ×"Ô" dÜ% c°Ô9SÐTZÓ9[Ô\ð �z‰z˜&×!Ò! f¨Y×&7Ô&7Ü-¨dÔ;Ü+¨BÈ&ÐQZÕJ[Ô\ˆE÷ #ô �3˜ %Ð);¸VÐDÓE÷ 
Ò	÷ #×"ú÷ 
×	Ð	ús(   ”)C½<B;	Á:B;	ÂCÂ;CÃCÃC	zprojects.record_reposc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   h   s   € ÷ \ñ \”4ð \œDñ \r   c                ó  € ^ RI Hp \        4       p\        V4      pVP	                  R4      p\        V\        4      '       d   \        \        V4      4      V8H  pM\        V4      p\        VR,          ;'       d    T4      pVP	                  R4      ;'       g    .  Uu. uF‡  p\        V\        4      '       g2   \        V\        4      '       g   K1  VP	                  R4      '       g   KJ  \        V\        4      '       d   VR3M"\        VR,          4      VP	                  R4      3NK‰  	  ppVP                  4       ;_uu_ 4       p	\        W)W44       V'       d   VP                  W˜RVR	7       M!VR,          '       g   VP                  W”R
7       RRR4       \        V4      ;_uu_ 4       p
\        W£R,          R7      p\!        V RVRVRV/4      uuRRR4       # u upi   + '       g   i     LX; i  + '       g   i     R# ; i)zUPersist repo roots found by the client's (desktop-side) scan; return the merged list.r<   rB   r?   rA   ÚrootNÚlabelT)Úreplacer8   )r8   )r@   Úaccepted)rD   r=   rE   rG   rH   Ú
isinstancer"   r4   Úboolr   rF   r9   Úrecord_discovered_reposÚclear_discovered_reposrC   rJ   rK   )r'   r   r5   r7   r8   ÚincomingrS   ÚitemÚpairsr6   rL   rA   s   &&          r   rM   rM   g   sª  € õ .Ü#Ó%€FÜ+¨FÓ3€JØ�z‰zÐ,Ó-€HÜ�(œD×!Ò!Ü-Ô.DÀXÓ.NÓOÐS]Ñ]‰ä4°VÓ<ˆÜ�F˜9Õ%×2Ð2¨(Ó3€HàŸ™ GÓ,×2Ð2°Ð2óXÙ2�Ü˜4¤×%Ò%¬*°T¼4×*@ô _àEIÇXÁXÈf×EUô _œZ¨¬c×2Ò2ˆd�D‰\¼¸TÀ&½\Ó9JÈDÏHÉHÐU\ÓL]Ð8^Ò^Ù2ð 
ð Xð 
×	Ñ	×	Ô	 $Ü! #¨VÔ@ßØ×'Ñ'¨¸TÈjÐ'ÕYØ˜	×"Ô"Ø×&Ñ& tÐ&ÔC÷ 
ô 
�V×	Ô	 Ü'¨À)Õ;LÔMˆÜ�3˜ %¨°XÐ?QÐSYÐZÓ[÷ 
Ò	ùòX÷ 
×	ú÷ 
×	Ð	ús1   Â.GÃGÃ+AGÅ8G!Å?G!Æ,%G4Ç!G1	Ç4H	c                ó€   € ^ RI Hp \        V 3/ VB w  rEV! VR,          \        VP	                  R4      4      4       WE3# )zG``_build_project_tree`` + profile stamping shared by the two tree RPCs.)Ústamp_profileÚprojectsÚprofile)Útui_gateway.project_treer\   Ú_build_project_treeÚ_response_profile_namerH   )rL   r   Úkwargsr\   ÚtreeÚ	active_ids   &&,   r   Ú_stamped_project_treere   �   s<   € å6Ü)¨"Ñ7°Ñ7�O€DÙ�$�zÕ"Ô$:¸6¿:¹:ÀiÓ;PÓ$QÔRØˆ?Ðr   zprojects.treec                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   Š   s   € ÷ Lñ L”4ð LœDñ Lr   c                ó’  € \        V4      ;_uu_ 4       pVf   \        V R. RRR. /4      uuRRR4       # \        Y!\        VP	                  R4      ;'       g    ^4      R\        VP	                  R4      ;'       g    R4      R	R
7      w  r4\        V RVR,          RVRVR,          /4      uuRRR4       #   + '       g   i     R# ; i)zòProject -> repo -> lane overview with counts + a few preview sessions per project, plus the
flat set of session ids claimed by any project (excluded from flat Recents). Lanes carry no
session rows; drill-in uses ``projects.project_sessions``.Nr]   rd   Úscoped_session_idsÚpreview_limitFÚsession_limitéÐ  T©ri   Úhydraterj   Úinclude_discovered)rC   rK   re   ÚintrH   )r'   r   rL   rc   rd   s   &&   r   rM   rM   ‰   sº   € ô
 
�V×	Ô	 ØŠ:Ü�s˜Z¨¨[¸$Ð@TÐVXÐYÓZ÷ 
Ò	ô 0Ø¤c¨&¯*©*°_Ó*E×*JÐ*JÈÓ&KÐUZÜ˜fŸj™j¨Ó9×AÐA¸TÓBÐW[ô]‰ˆô �3˜ T¨*Õ%5°{ÀIØ-¨tÐ4HÕ/IðKó L÷ 
×	×	Ó	ús   ”B5µAB5Á<.B5Â5C	zprojects.project_sessionsc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   ™   s   € ÷ iñ i”4ð iœDñ ir   c                óÌ  a€ \        VP                  R4      ;'       g    R4      oS'       g   \        V RR4      # \        V4      ;_uu_ 4       pVf   \	        V RR/4      uuRRR4       # \        Y!^ R\        VP                  R4      ;'       g    R	4      R
R7      w  r4\	        V R\        V3R lVR,           4       R4      /4      uuRRR4       #   + '       g   i     R# ; i)zRFully hydrated lanes for one project, from the same grouping as ``projects.tree``.Ú
project_idÚ iÇ  zproject_id requiredNÚprojectTrj   iˆ  Frl   c              3   óF   <"  € T F  qR ,          S8X  g   K  Vx € K  	  R# 5i)ÚidNr   )Ú.0Úprr   s   & €r   Ú	<genexpr>Ú_.<locals>.<genexpr>¥   s   øé € Ð)_Ñ5E°È4ÍÐT^ÑI^¯!ª!Ó5Eùs   ƒ!—
!r]   )r   rH   r&   rC   rK   re   ro   Únext)r'   r   rL   rc   Ú_activerr   s   &&   @r   rM   rM   ˜   sÁ   ø€ ô �V—Z‘Z Ó-×3Ð3°Ó4€JßÜ�C˜Ð4Ó5Ð5Ü	�V×	Ô	 ØŠ:Ü�s˜Y¨Ð-Ó.÷ 
Ò	ô .Ø a°Ü˜fŸj™j¨Ó9×AÐA¸TÓBÐW\ô^‰ˆô �3˜¤DÔ)_°T¸*Ö5EÓ)_ÐaeÓ$fÐgÓh÷ 
×	×	Ó	ús   ÁCÁ+ACÃC#	c                ó$   € V ^8„  d   QhR\         /# )r   r    r!   )r   s   "r   r   r   ª   s   € ÷ ,ñ ,”dñ ,r   c                  óH   € \        4       P                  R 4      ;'       g    / # )Údisplay©Ú	_load_cfgrH   r   r   r   Ú_display_rawr‚   ª   s   € Ü‹;�?‰?˜9Ó%×+Ð+¨Ð+r   c                ó<   € V ^8„  d   QhR\         R\         R\         /# )r   ÚkeyÚdefaultr    r   )r   s   "r   r   r   ®   s!   € ÷ .ñ .”sð .¤Sð .´cñ .r   c                ó¦   € \        \        4       P                  W4      ;'       g    R4      P                  4       P	                  4       pW29   d   V# T# )zNNormalised ``display.<key>``; unknown/garbage values read back as ``default``.rs   )r   r‚   rH   ÚstripÚlower)r„   r…   ÚallowedÚraws   &&& r   Ú_display_wordr‹   ®   sB   € ä
Œl‹n× Ñ  Ó.×4Ð4°"Ó
5×
;Ñ
;Ó
=×
CÑ
CÓ
E€CØ”.ˆ3Ð- gÐ-r   Úfullc                 ó¢   € ^ RI HpHp \        4       pVP	                  R^4      pRTR\        V4      ^8”  d   V! V^ ,          4      MRRV! 4       /# )é    )Úlist_available_providersÚnormalize_providerÚ/ÚmodelÚproviderÚunknownÚ	providers)Úhermes_cli.modelsr�   r�   Ú_resolve_modelÚsplitÚlen)r   r�   r�   r’   Úpartss   &    r   Ú_cfg_get_providerr›   ·   sQ   € ßNÜÓ€EØ�K‰K˜˜QÓ€EØ�U˜JÌÈEË
ÐUVÌÑ(:¸5À½8Ô(DÐ\eØÑ1Ó3ð5ð 5r   c           
      ó€  € \        V P                  R R4      ;'       g>    \        4       P                  R4      ;'       g    / P                  R R4      ;'       g    R4      P                  4       p\	        R VR\        V P                  R 4      4      RV P                  R4      /4      pR VR\        P                  V4      /# )Úcwdrs   ÚterminalÚcwd_explicitr^   Úbranch)r   rH   r�   r‡   Ú_completion_cwdrU   Ú	git_prober    )r   rŠ   r�   s   &  r   Ú_cfg_get_projectr£   ¿   s¡   € Ü
ˆf�j‰j˜ Ó#×_Ð_¬	«¯©¸
Ó(C×(IÐ(IÀr×'NÑ'NÈuÐVXÓ'Y×_Ð_Ð]_Ó
`×
fÑ
fÓ
h€Cô ˜5 # ~´t¸F¿J¹JÀuÓ<MÓ7NÐPYÐ[a×[eÑ[eÐfoÓ[pÐqÓ
r€CØ�3˜¤)×"2Ñ"2°3Ó"7Ð8Ð8r   c                 óF   € ^ RI Hp RV! \        4       4      ;'       g    R/# )rŽ   )Úactive_personality_nameÚvalueÚnone)Úhermes_cli.personalityr¥   r�   )r   r¥   s   & r   Ú_cfg_get_personalityr©   Ç   s    € å>ØÑ,¬Y«[Ó9×CÐC¸VÐDÐDr   c                 ó„  € \        4       p\        P                  V P                  R R4      4      ;'       g    / pVP                  R4      pV'       d?   \        V\        4      '       g)   ^ RIHp \        V! VP                  R4      4      RR4      p\        V\        4      '       dC   VP                  R4      RJpV'       d%   \        VP                  R	4      ;'       g    R
4      MRpMžVP                  R4      ;'       g    / P                  RR4      p\        V\        4      '       dA   ^ RI	H
p V! V4      ;'       g    / p	V	P                  R4      RJ d   RMV	P                  R	4      pVRJ d   RM\        T;'       g    R
4      pVP                  R4      ;'       g    / P                  RR4      '       d   RMRp
RVRV
/# )Ú
session_idrs   Úcreate_reasoning_override)Úsession_runtime_viewÚagentÚreasoning_configNr?   FÚeffortÚmediumr§   Úreasoning_effort)Úparse_reasoning_effortr   Úshow_reasoningTÚshowÚhider¦   )r�   Ú	_sessionsrH   rT   r"   Úagent.voice_turn_router­   Úgetattrr   Úhermes_constantsr³   )r   ÚcfgÚsessionr¯   r­   r?   r°   Ú
raw_effortr³   Úparsedr   s   &          r   Ú_cfg_get_reasoningr¿   Í   sp  € Ü
‹+€CÜ�m‰m˜FŸJ™J |°RÓ8Ó9×?Ð?¸R€GØ—{‘{Ð#>Ó?Ðß”zÐ"2´D×9Ò9Ý?Ü"Ñ#7¸¿¹ÀGÓ8LÓ#MÐOaÐcgÓhÐÜÐ"¤D×)Ò)Ø"×&Ñ& yÓ1¸Ð>ˆßDK”Ð%×)Ñ)¨(Ó3×?Ð?°xÔ@ÐQW‰à—g‘g˜gÓ&×,Ð,¨"×1Ñ1Ð2DÀbÓIˆ
Ü�j¤$×'Ò'Ý?Ù+¨JÓ7×=Ð=¸2ˆFØ"(§*¡*¨YÓ"7¸5Ó"@™ÀfÇjÁjÐQYÓFZˆJà%¨Ó.‘´C¸
×8NÐ8NÀhÓ4OˆØŸ™ Ó+×1Ð1¨r×6Ñ6Ð7GÈ×NÒN‰fÐTZ€GØ�V˜Y¨Ð0Ð0r   c                 ó  € \         P                  V P                  R R4      4      ;'       g    / pVP                  R4      pVe   \        VRR4      MVP                  R4      pVf   \        4       pRRRR	R	/P                  VR
4      /# )r«   rs   r®   NÚservice_tierÚcreate_service_tier_overrider¦   ÚpriorityÚfastÚ	ultrafastÚnormal)r·   rH   r¹   Ú_load_service_tier)r   r¼   r®   Útiers   &   r   Ú_cfg_get_fastrÉ   ã   s„   € ô �m‰m˜FŸJ™J |°RÓ8Ó9×?Ð?¸R€GØ�K‰K˜Ó €EØ49Ò4EŒG�E˜>¨4Ô0Ø—‘Ð;Ó<ð 	à‚|Ü!Ó#ˆØ�j &¨+°{ÐC×GÑGÈÈhÓWÐXÐXr   c                 óp   € \        R R\        4      pV'       g   \        RR\        4      R8X  d   RMRpRV/# )Úthinking_moders   Údetails_modeÚ	collapsedÚexpandedrŒ   r¦   )r‹   Ú_THINKING_MODESÚ_DETAIL_MODES)r   rŠ   s   & r   Ú_cfg_get_thinking_moderÑ   ï   s6   € Ü
˜¨¬_Ó
=€CßÜ% n°kÄ=ÓQÐU_Ô_‰fÐepˆØ�Sˆ>Ðr   c                 óÈ   € \         R ,          p VP                  4       '       d   VP                  4       P                  M^ pRTR\        4       /#   \         d    R^ /u # i ; i)zconfig.yamlÚmtimeÚmcp_rev)Ú_hermes_homeÚexistsÚstatÚst_mtimer%   Ú_compute_mcp_rev)r   Úcfg_pathrÓ   s   &  r   Ú_cfg_get_mtimerÛ   ö   s`   € Ü˜mÕ+€HðØ,4¯O©O×,=Ò,=�—‘“×(Ò(À1ˆð
 �U˜IÔ'7Ó'9Ð:Ð:øô	 ô Ø˜ˆ|Òðús   �A ¥A ÁA!Á A!r“   r^   c                 ó8   € R \        \        4      R\        4       /# )Úhomer   )r   rÕ   Ú_display_hermes_home©r   s   &r   r   r     s   € ˜v¤s¬<Ó'8¸)ÔEYÓE[Ñ\r   rt   c                 ó   € R \        4       /# )Úconfig)r�   rß   s   &r   r   r     s   € ˜H¤i£kÑ2r   Úpromptc                 ó:   € R \        4       P                  RR4      /# )râ   Úcustom_promptrs   r€   rß   s   &r   r   r     s   € ˜h¬	«¯©¸ÈÓ(LÑMr   Úskinc                 ó:   € R \        4       P                  RR4      /# )r¦   rå   r…   )r‚   rH   rß   s   &r   r   r     s   € ˜G¤\£^×%7Ñ%7¸À	Ó%JÑKr   Ú	indicatorc                 ó0   € R \        R\        \        4      /# )r¦   Útui_status_indicator)r‹   r   r   rß   s   &r   r   r   
  s   € Ø”Ð5Ô7NÔP`Óañ!cr   ÚpersonalityÚ	reasoningrÄ   Úbusyc                 ó   € R \        4       /# ©r¦   )Ú_load_busy_input_moderß   s   &r   r   r     s   € ˜GÔ%:Ó%<Ñ=r   Úapproval_modec                 ó   € R \        4       /# rî   ©Ú_load_approval_moderß   s   &r   r   r     s   €  WÔ.AÓ.CÑ$Dr   zapprovals.modec                 ó   € R \        4       /# rî   rò   rß   s   &r   r   r     s   €  gÔ/BÓ/DÑ%Er   rÌ   c                 ó(   € R \        RR\        4      /# )r¦   rÌ   rÍ   )r‹   rÐ   rß   s   &r   r   r     s   €  G¬]¸>È;ÔXeÓ-fÑ#gr   rË   Údensityc                 ób   € R \        \        4       P                  RR4      4      '       d   R/# R/# )r¦   Útui_compactFÚonÚoff)rU   r‚   rH   rß   s   &r   r   r     s)   € ˜w´´\³^×5GÑ5GÈÐW\Ó5]×0^Ò0^¨ÑjÐdiÑjr   Úthemec                 ó$   € R \        RR0 Rm4      /# )r¦   Ú	tui_themeÚauto>   rþ   ÚdarkÚlight)r‹   rß   s   &r   r   r     s   € ˜W¤m°KÀÒIbÓ&cÑdr   Ú	statusbarc                 óL   € R \        \        4       P                  RR4      4      /# )r¦   Útui_statusbarÚtop)Ú_coerce_statusbarÚ_display_cfgrH   rß   s   &r   r   r     s   €  Ô*;¼L»N×<NÑ<NÈÐ`eÓ<fÓ*gÑ hr   Úfocusc                 ót   € R \        \        4       P                  RR4      4      '       d   RMRR\        4       /# )r¦   Ú
focus_viewFrù   rú   Útool_progress)rU   r  rH   Ú_load_tool_progress_moderß   s   &r   r   r     s2   € ˜W¬d´<³>×3EÑ3EÀlÐTYÓ3Z×.[Ò.[¡dÐafØ,Ô.FÓ.HñJr   Úmousec                 óJ   € R \        \        4       P                  R4      4      /# )r¦   r   )Ú_display_mouse_trackingr�   rH   rß   s   &r   r   r     s   € ˜WÔ&=¼i»k¿o¹oÈiÓ>XÓ&YÑZr   rÓ   i•  i‰  z
config.getc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   !  s   € ÷ 
7ñ 
7”4ð 
7œDñ 
7r   c                 ó&  € VP                  R R4      p\        P                  V4      pVf   \        V RRV 24      #  \        W! V4      4      #   \         d8   pT\
        9  d   h \        T \
        T,          \        T4      4      u Rp?# Rp?ii ; i)r„   rs   Ni¢  zunknown config key: )rH   Ú_CONFIG_GETTERSr&   rK   r%   Ú_CONFIG_GET_ERRr   )r'   r   r„   Úgetterr(   s   &&   r   rM   rM     s‰   € ð �*‰*�U˜BÓ
€CÜ× Ñ  Ó%€FØ‚~Ü�C˜Ð!5°c°UÐ;Ó<Ð<ð7Ü�3˜˜v›Ó'Ð'øÜô 7Ø”oÔ%ØÜ�Cœ¨Õ-¬s°1«vÓ6Õ6ûð7ús   ½A ÁBÁ,BÂBÂBc                ó   a € V 3R lpV# )uá   Done-callback for a single-flighted probe: forget the entry (the next poll
re-probes â€” completed answers are never cached), and surface a failure nobody
waited for (every caller timed out) in the log instead of dropping it.c                 ó\  <€ \         ;_uu_ 4        \        P                  S4      V J d   \        P                  SR 4       R R R 4       V P	                  4       '       g<   V P                  4       e(   \        P                  RSV P                  4       4       R # R # R #   + '       g   i     Lc; i)Nz8readiness probe %s failed after its callers returned: %s)Ú_readiness_lockÚ_readiness_inflightrH   ÚpopÚ	cancelledÚ	exceptionÚloggerÚdebug)Úfuturer„   s   &€r   Ú_clearÚ"_readiness_cleared.<locals>._clear4  s}   ø€ ßŽ_Ü"×&Ñ& sÓ+¨vÓ5Ü#×'Ñ'¨¨TÔ2÷ ð ×Ñ×!Ò! f×&6Ñ&6Ó&8Ò&DÜ�L‰LÐSØ˜f×.Ñ.Ó0ö2ñ 'EÑ!÷ �_ús   �0BÂB+	r   )r„   r  s   f r   Ú_readiness_clearedr   0  s   ø€ õ2ð €Mr   c           	     ó  € \         ;_uu_ 4        \        P                  V4      pVRJ pV'       d   \        P	                  V4      pV\        V&   RRR4       X'       d   XP                  \        V4      4        \        T XP                  V'       d   TM\        V\        4      R7      4      #   + '       g   i     Lg; i  \        P                  P                   d+    \        P                  RY4       \!        T \"        R4      u # i ; i)uj  Run ``run_probe`` single-flighted under ``key`` on the dedicated readiness pool.

The first caller submits the probe and waits up to ``wait_seconds``; a caller that finds a
still-running probe waits the short join grace for it first â€” the Desktop fires
setup.status + setup.runtime_check from independent consumers at the same seam (boot, the
post-assignment ``setup.ready`` broadcast), and answering the retryable error at once made
both legs of one consumer transiently unknown, which its onboarding gate read as not-ready.
Fast (config-read) probes settle well inside the grace, so an overlapping poll reads the
shared result; one that outlives the grace answers a retryable error, freeing its shared RPC
worker (the probe keeps running for the first caller). A probe that outlives ``wait_seconds``
answers the same retryable error while it continues in the background.N)ÚtimeoutzNreadiness probe %s exceeded its budget (%.1fs); it continues in the backgroundz5readiness check still in progress; retrying next tick)r  r  rH   r   ÚsubmitÚadd_done_callbackr   rK   ÚresultÚminÚ_READINESS_JOIN_GRACE_SECONDSÚ
concurrentÚfuturesÚTimeoutErrorr  Úwarningr&   Ú_READINESS_IN_PROGRESS_ERR)r'   r„   Ú	run_probeÚwait_secondsr  Úowners   &&&&  r   Ú_readiness_sharer0  >  sæ   € ÷ 
ŽÜ$×(Ñ(¨Ó-ˆØ˜$�ˆßÜ$×+Ñ+¨IÓ6ˆFØ'-Ô Ñ$÷ 
÷ ð 	× Ñ Ô!3°CÓ!8Ô9ðMÜ�3˜Ÿ™¿e©lÜ&)¨,Ô8UÓ&Vð &ó Xó Yð 	Y÷ 
�ûô  ×Ñ×*Ñ*ô MÜ�‰ÐgØô	*ä�CÔ3ØKóMò 	MðMús   �A B.Á:3C Â.B>	ÃAD
Ä	D
c               óv  aaa€ \        V\        4      '       d3   \        VP                  R4      ;'       g    R4      P	                  4       MRoRoS'       dN   ^ RIHp VP                  S4      '       g&   \        V RRRVP                  R4      RRS R	2/4      # \        S4      oVVV3R
 lp\        WS3Wd4      # )a$  Shared shell of setup.status / setup.runtime_check. ``probe(profile, scoped)`` runs inside the
optional ``profile`` param's HERMES_HOME + ``.env`` secret scope (ContextVars: concurrent checks
stay isolated); ``scoped`` is the ``{"profile": ...}`` payload stamp (``{}`` for the launch
profile). An unknown profile answers ``ok=False`` (never a JSON-RPC error, never a quiet answer
for the launch profile instead). ``probe_key`` + the profile single-flight the probe, and
``wait_seconds`` bounds how long this shared-RPC worker waits for it (#65151).r^   rs   N)ÚprofilesÚokFÚerrorz	Profile 'z!' does not exist on this backend.c                  ó´   <€ \        R S e   \        S 4      MR/4      ;_uu_ 4        S! SS'       d   RS/M/ 4      uuRRR4       #   + '       g   i     R# ; i)Úprofile_homeNr^   )Ú_session_profile_runtime_scoper   )rÝ   Úprober^   s   €€€r   r-  Ú#_readiness_check.<locals>.run_probet  sD   ø€ ô ,¨^È$ÒJZ¼SÀ¼YÐ`dÐ,e×fÕfÙ˜¿' 9¨gÑ"6ÀrÓJ÷ g×f×fÓfús   ¦AÁA	)rT   r"   r   rH   r‡   rD   r2  Úprofile_existsrK   Ú_profile_homer0  )	r'   r   r8  Ú	probe_keyr.  Úprofiles_modr-  rÝ   r^   s	   &&f$$  @@r   Ú_readiness_checkr>  a  s°   ú€ ô ;EÀVÌT×:RÒ:RŒc�&—*‘*˜YÓ'×-Ð-¨2Ó.×4Ñ4Ô6ÐXZ€GØ€DßÝ7Ø×*Ñ*¨7×3Ò3Ü�s˜T 5¨)°V·Z±ZÀ	Ó5JØ$¨	°'°Ð:[Ð&\ð^ó _ð _ä˜WÓ%ˆ÷
Kô ˜C¨WÐ!5°yÓOÐOr   zsetup.statusc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r     s   € ÷ &'ñ &'”4ð &'œDñ &'r   c                óÀ   aaa€  ^ RI Ho ^ RIHo ^ RIHo VVV3R lp\        WVR\        R7      #   \         d!   p\        T R\        T4      4      u Rp?# Rp?ii ; i)	u  Loose provider check; ``profile`` (optional) scopes it to that profile's home.

For the launch profile the answer is the boot bootstrap's record (``free_tier_bootstrap``):
the call blocks up to ``SETUP_READY_WAIT_SECONDS`` for it, so a client's first poll lands after
the free-tier identity exists (or has been refused) rather than racing the mint. A record that
says ``False`` is reconciled with the config files first (``reconcile_record``): a provider
added after boot â€” the Models page, a picker key, ``hermes setup`` from a shell â€” flips it
without a restart. If the record
is still missing after the wait, or a named profile is asked about, today's live probe answers.
The record's fields ride along additively (``ready``, ``free_tier_account``, ``free_tier_route``,
``other_providers``).)Úfree_tier_route©Ú_has_any_provider_configured)Úwait_for_recordc                 ór  <€ V '       d   R MS! 4       pVfQ   V '       d   S! 4       MR pR\        S! \        V 4      R7      4      /Ve   RRRVP                  RS! 4       /CVC# / CVC# RVP                  RRRVP                  RVP                  RVP                  RVP
                  /VP                  4       CVC# )	NÚprovider_configured©Ústrict_profile_scopeÚreadyTÚfree_tier_accountrA  Úother_providersÚinference_provider)rU   rJ  rF  rA  rK  rL  Úfailure_fields)r^   ÚscopedÚrecordÚlaunchrC  rA  rD  s   &&  €€€r   r8  Ú_.<locals>.probe�  sý   ø€ ß$‘T©/Ó*;ˆFØŠ~÷
 /6™Ô*¸4�Ø-¬tÑ4PÔfjÐkrÓfsÔ4tÓ/uð "àEKÒEWð $ TÐ+>À×@XÑ@XØ-©Ó/@ðBð"ð !ð"ð "à]_ð"ð !ð"ð "ð *¨6×+EÑ+EÀwÐPTØ'¨×)AÑ)AÐCTÐV\×VlÑVlØ% v×'=Ñ'=Ø(¨&×*CÑ*Cðjð HN×G\ÑG\ÓG^ðjð ciðjð jr   Ústatus©r<  r.  i˜  N)Úhermes_cli.anon_authrA  Úhermes_cli.mainrC  Úhermes_cli.free_tier_bootstraprD  r>  Ú$_READINESS_STATUS_SHARE_WAIT_SECONDSr%   r&   r   )r'   r   r8  r(   rC  rA  rD  s   &&  @@@r   rM   rM   ~  sT   ú€ ð'Ý8Ý@ÝB÷	jô$   ¨U¸hÜ-QôSð 	Søäô 'Ü�C˜œs 1›vÓ&Õ&ûð'ús   …,2 ²A½AÁAÁAzsetup.runtime_checkc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   ©  s   € ÷ 88ñ 88”4ð 88œDñ 88r   c           
     ó\  aaaa€  ^ RI Ho ^ RIHo ^ RIHo \        VP                  R4      ;'       g    R4      P                  4       ;'       g    RoVVVV3R lp\        YTRS;'       g    R 2\        R	7      #   \         d$   p\        T R
RR\        T4      /4      u Rp?# Rp?ii ; i)uó  Readiness probe for the session a client is about to open (setup.status is True if ANY
provider auth state is discoverable): ok=False + the auth error when the model can't be served,
so UIs surface onboarding before a doomed prompt. Without ``provider`` it runs the SAME
resolver as session creation (``_resolve_agent_model_runtime``: startup model + provider pin,
then the configured fallback chain) â€” a probe that ignores the chain shows onboarding for a
backend whose sessions build fine. An explicit ``provider`` stays a strict single-provider
check so onboarding can verify the provider just connected without another provider's
fallback masking a failed connection. ``profile`` answers for THAT profile's pin and ``.env``;
unknown -> ``ok=False``.)Úresolve_runtime_provider)Úhas_usable_secretrB  r“   rs   Nc                 ó‚  <aaa€ \        4       w  r#S'       d   TS! ST;'       g    R R7      uopM\        R R 4      w  op\        S! \        V 4      R7      4      pVP                  R4      ;'       g    Rp\	        VP                  R4      ;'       g    R4      p\        4       P                  R4      pS;'       gU    T;'       gK    \        V\        4      '       d3   \	        VP                  R4      ;'       g    R4      P                  4       MRp	T	;'       g    ToVVV3R lp
V'       g   VR8X  d   VR9   d
   V
! R	V4      # VP                  R
4      p\        V4      '       d   RM"\	        T;'       g    R4      P                  4       p\        V4      '       gR   VR9   gK   S! V4      '       g=   \        VP                  R4      4      '       g   V
! RS R2VP                  R4      4      # ^ RI
Hp RRRVP                  R4      RSRVP                  R4      RVR8H  ;'       d    V! VP                  R4      4      /SC# )N)Ú	requestedÚtarget_modelrG  r“   Úsourcers   r’   c           
      ó    <€ R RRSRSRVRV /SC# )r3  Fr“   r’   r_  r4  r   )r4  ÚsrcÚblamedr’   rN  s   &&€€€r   ÚfailÚ_.<locals>.probe.<locals>.failÌ  s.   ø€ Ø˜e Z°¸À%Ø  # w°ðAØ9?ðAð Ar   Úbedrockz!No Hermes provider is configured.Úapi_keyÚcommandz No usable credentials found for Ú.)Úroute_is_welcome_hostr3  TrA  ÚnousÚbase_url>   úiam-roleúaws-sdk-default-chain>   úaws-sdkúno-key-required)Ú_resolve_startup_runtimeÚ_resolve_agent_model_runtimerU   rH   r   r�   rT   r"   r‡   ÚcallablerT  ri  )r^   rN  Ústartup_modelÚstartup_providerÚruntimerF  r“   r_  Ú	cfg_modelÚpinnedrc  rf  Úapi_key_textri  rb  r’   rC  r[  r]  rZ  s   &f            @@€€€€r   r8  rQ  ¹  s  û€ Ü.FÓ.HÑ+ˆMßØ!.Ñ0HØ'°m×6KÐ6KÀtô1M��‘wô ">¸dÀDÓ!I‘��wÜ"&Ñ'CÔY]Ð^eÓYfÔ'gÓ"hÐØ—{‘{ :Ó.×<Ð<°*ˆHÜ˜Ÿ™ XÓ.×4Ð4°"Ó5ˆFô
 "›Ÿ™¨Ó0ˆIØ÷ oð oÐ#3÷ oð oÜJTÐU^Ô`d×JeÒJeœ#˜iŸm™m¨JÓ7×=Ð=¸2Ó>×DÑDÔFÐkmð à×'Ð'˜xˆF÷A÷ (¨H¸	Ô,AØÐ"GÔGÙÐ?ÀÓHÐHØ—k‘k )Ó,ˆGÜ!)¨'×!2Ò!2™2¼¸G¿M¸MÀrÓ8J×8PÑ8PÓ8RˆLÜ˜W×%Ò%¨Ð9WÔ)WÙ(¨×6Ò6¼$¸w¿{¹{È9Ó?U×:VÒ:VÙÐ>¸v¸hÀaÐHÈ'Ï+É+ÐV^ÓJ_Ó`Ð`ÝBð ˜$ 
¨G¯K©K¸
Ó,CÀWÈeØ˜gŸk™k¨(Ó3Ø% x°6Ñ'9×'lÐ'lÑ>SÐT[×T_ÑT_Ð`jÓTkÓ>lðð ðð r   zruntime:rS  r3  Fr4  )Úhermes_cli.runtime_providerrZ  Úhermes_cli.authr[  rU  rC  r   rH   r‡   r>  Ú_READINESS_SHARE_WAIT_SECONDSr%   rK   )r'   r   r8  r(   rC  r[  r]  rZ  s   &&  @@@@r   rM   rM   ¨  s›   û€ ð.8ÝHÝ5Ý@Ü˜Ÿ
™
 :Ó.×4Ð4°"Ó5×;Ñ;Ó=×EÐEÀˆ	÷$	ð $	ôJ   ¨UÀÈÏÈÐVXÐHYÐ>ZÜ-JôLð 	Løäô 8Ü�3˜˜u g¬s°1«vÐ6Ó7Õ7ûð8ús.   †.A= µA= ÁA= Á.A= Á=B+ÂB&Â B+Â&B+c                ó<   € V ^8„  d   QhR\         R\        R\         /# )r   ÚtextÚcapr    )r   ro   )r   s   "r   r   r   ä  s!   € ÷ 	<ñ 	<œcð 	<¬ð 	<´ñ 	<r   c                ó    € ^ RI Hp V P                  R^V,          ^V,          4      pV^ 8¼  d   V RV^,            MV R^V,           pV! WAR7      # )a  Strict-scrub client text, then cap it. The scrub sees at most 3x the cap: the
first line end in [2x, 3x) cap, else a hard 2x-cap cut, so a key cut by the cap
still gets redacted but an unbounded (even single-line) RPC param cannot make
the superlinear scrub run on megabytes.©Úredact_debug_support_textÚ
N)Ú	max_chars)Úhermes_cli.debug_redactionr�  Úfind)r}  r~  r�  ÚcutÚwindows   &&   r   Ú_redact_client_textrˆ  ä  sN   € õ
 Eà
�)‰)�D˜!˜c�' 1 s¥7Ó
+€CØ # q¤ˆT�)�C˜!•G‰_¨d°9°Q¸µW¨o€FÙ$ VÔ;Ð;r   c                ó0   € V ^8„  d   QhR\         R\         /# )r   rQ   r    r   )r   s   "r   r   r   ð  s   € ÷ $ñ $œcð $¤cñ $r   c                óÐ   € RP                  R V  4       4      P                  4       R,          pRV9   d   VP                  RR4      pK  VP                  R4      P                  4       # )uZ   Alnum/._- () only, â‰¤64 chars, dot-runs and leading dots collapsed (no traversal shapes).rs   c              3   ób   "  € T F%  qP                  4       '       g
   VR 9   g   K!  Vx € K'  	  R# 5i)z._- ()N)Úisalnum)rw   Úchs   & r   ry   Ú%_safe_client_label.<locals>.<genexpr>ò  s    é € ÐH¡˜"¯©¯ª¸¸x¹—2’2£ùs   ‚/¥
/:Né@   Nz..rh  )Újoinr‡   rR   Úlstrip)rQ   Úsafes   & r   Ú_safe_client_labelr“  ð  sT   € à�7‰7ÑH¡ÓHÓH×NÑNÓPÐQTÕU€DØ
�$Œ,Ø�|‰|˜D #Ó&ŠØ�;‰;�sÓ×!Ñ!Ó#Ð#r   zdiagnostics.share_nousc                ó0   € V ^8„  d   QhR\         R\         /# r   r!   )r   s   "r   r   r   ù  s   € ÷ "Nñ "N”4ð "NœDñ "Nr   c                ó”  € ^ RI Hp  ^ RIHpHp ^ RIHp VP                  R4      p\        V\        4      '       d   ^
Tu;8:  d   R8:  g   M ^ÈpV! VRR7      pVP                  R4      p\        V\        4      '       d4   VP                  4       '       d   \        VP                  4       R	4      VR
&   VP                  R4      p	\        V	\        4      '       d!   \        V	P                  4       4      R,          MR Ft  w  r«\        V
\        4      '       d   \!        V
4      MRpV'       g   K2  \        V\        4      '       g   KJ  VP                  4       '       g   Kb  \        VR4      VRV 2&   Kv  	  V! V! VRR7      4      pVP                  R4      ;'       g    VP                  R4      pVP                  R4      pV'       g   V'       g   \#        V RRRR/4      # \#        T RRRTRTRVP                  R4      ;'       g    VP                  R4      /4      #   \$         d!   p\#        T RRRT! T4      /4      u Rp?# Rp?ii ; i)uÆ  Upload a redacted debug bundle to Nous-internal diagnostics storage â€” same collection +
force-redaction pipeline as ``hermes debug share --nous``; redaction is NOT client-controllable
and consent lives with the CALLER (privacy notice first). Structured ``ok``/``error`` envelope so
upload failures render inline. Optional: ``error_context`` (-> ``error-context.txt``),
``extra_files`` ({label -> text}), ``log_lines`` (default 200); all force-redacted.r€  )Úbuild_nous_bundleÚcollect_share_bundle)Úshare_to_nousÚ	log_linesrk   T)r™  ÚredactÚerror_contexti@  zerror-context.txtÚextra_files:Né   Nrs   i   zclient/)rš  ÚviewUrlÚview_urlrv   r3  Fr4  z/upload succeeded but returned no view URL or idÚ	upload_idÚ
expires_atÚ	expiresAtNr   )r„  r�  Úhermes_cli.debugr–  r—  Úhermes_cli.diagnostics_uploadr˜  rH   rT   ro   r   r‡   rˆ  r"   ÚlistÚitemsr“  rK   r%   )r'   r   r�  r–  r—  r˜  r™  Úbundler›  rœ  rQ   r}  Ú
safe_labelÚresrŸ  r   r(   s   &&               r   rM   rM   ø  së  € õ EðNßLÝ?Ø—J‘J˜{Ó+ˆ	Ü˜)¤S×)Ò)°"¸	Ö2IÀTÖ2IØˆIÙ%°	À$ÔGˆàŸ
™
 ?Ó3ˆÜ�m¤S×)Ò)¨m×.AÑ.A×.CÒ.CÜ*=¸m×>QÑ>QÓ>SÐUZÓ*[ˆFÐ&Ñ'à—j‘j Ó/ˆÜ<FÀ{ÔTX×<YÒ<Yœ4 × 1Ñ 1Ó 3Ó4°RÖ8Ð_aÒa‰KˆEÜ6@ÀÌ×6LÒ6LÔ+¨EÔ2ÐRTˆJß‰zœj¨¬s×3Ô3¸¿
¹
¿¼Ü1DÀTÈ7Ó1S�˜  Ð-Ó.ñ bñ Ñ-¨f¸TÔBÓCˆØ—7‘7˜9Ó%×<Ð<¨¯©°Ó)<ˆØ—G‘G˜D“Mˆ	ß§	Ü�s˜T 5¨'Ð3dÐeÓfÐfÜ�3˜˜t Z°¸;È	Ø% s§w¡w¨{Ó';×'TÐ'T¸s¿w¹wÀ|Ó?TðVó Wð 	Wøäô NÜ�3˜˜u gÑ/HÈÓ/KÐLÓMÕMûðNúsU   ˆBH ÂBH Ä/H ÅH Å=H Æ*H ÇH ÇH Ç $H ÈH ÈIÈ'IÈ<IÉIc                ó   € V ^8„  d   QhRR/# )r   r    Nr   )r   s   "r   r   r     s   € ÷ 0ñ 0˜ñ 0r   c                 ó2   € \        \        4       V RR7       R# )rM   )ÚskipN)rM   )r   Úglobals)Úservers   &r   Úregisterr¯    s   € Ü”“	˜6¨×/r   c                óŠ   € V ^8„  d   Qh/ ^ \         9   d/   \        \        \        P                  P
                  3,          ;R&   # )r   r  )Ú__conditional_annotations__r"   Útupler(  r)  ÚFuture)r   s   "r   r   r      s7   € ÷ ñ ÷` AÒ @”Tœ%¤×!3Ñ!3×!:Ñ!:Ð:Õ;Ñ @òar   >   rŒ   rÍ   Ú	truncated)8r±  Ú__doc__ÚatexitÚconcurrent.futuresr(  Ú	threadingÚ
method_ctxr   r   Ú_envr   rº   r   r   r   rÞ   Ú	_registryr,   Úprofile_scopedr-   r)  ÚThreadPoolExecutorÚmaxr&  r   r¯  ÚLockr  r  r{  r'  rW  r,  r0   r9   rM   re   r‚   r‹   Ú	frozensetrÏ   r›   r£   r©   r¿   rÉ   rÑ   rÛ   r  r  r   r0  r>  rˆ  r“  r   )r±  s   @r   Ú<module>rÁ     s"  øðöó Û Û ç 4Ý ç FÝ HáÓ€	Ø	×	Ñ	€Ø×*Ñ*€ð6 ×$Ñ$×7Ñ7Ù�A‘s˜1™gÐ&CÀQÓGÓHÓIØ&ð 8ó (€ð ‡‚ÑQÔ RØ—.’.Ó"€Ø>@Ð Ó @Ø #Ð ð !$Ð ð (,Ð $ð "Ð õ	òjñ
 Ð,Ó-ôFó .ðFñ" Ð*Ó+ô\ó ,ð\ò2ñ �?Ó#ôLó $ðLñ Ð.Ó/ôió 0ðiõ",õ.ñ Ò>Ó?€ò5ò9òEò1ò,	Yòò;ðØÐ!ðàÑ\ðð Ððð Ñ2ð	ð
 ÑMðð ÑKðð ñ cðð Ð'ðð Ð#ðð ˆMðð Ñ=ðð ÑDðð ÑEðð  Ñgð!ð" Ð+ð#ð$ Ñjð%ð& Ñdð'ð( ÑhØñ JàÑZØˆ^ñ1€ð4 ˜t _°dÐ<LÈdÐS€ñ ˆÓØô
7ó ó ð
7òò MòFPñ: ˆÓô&'ó ð&'ñR ÐÓô88ó ð88õv	<õ$ñ Ð Ó!ô"Nó "ð"N÷J0r   