+
    jHàj,w  ã                   óî  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHt ]P                  ! R4      tR R ltR R	 lt^tR
 R ltR R ltR@R R lltR R ltR@R R lltR R ltR R ltR R ltR R ltRR/R R lltR  R! ltR" R# ltRAR$ R% llt R@R& R' llt!R( R) lt"R* R+ lt#R, R- lt$R. R/ lt%R0R1R2R3R4R5/t&R6 R7 lt'RBR8 R9 llt(R: R; lt)R< R= lt*R> R? lt+R# )CzòTUI (ui-tui) launcher: prepared source builds and argv/env assembly.

Split out of ``hermes_cli/main.py``. Names that still live in main (``PROJECT_ROOT``, ...)
are imported lazily inside the functions that use them (avoids an import cycle).
N©ÚPath)ÚOptional)Útzhermes_cli.mainc                ó$   € V ^8„  d   QhR\         /# ©é   Úreturn©Úbool)Úformats   "Ú?/home/ubuntu/.hermes/hermes-agent/hermes_cli/main_tui_launch.pyÚ__annotate__r      s   € ÷ ,ñ ,¤ñ ,ó    c                óŒ   € \        \        V RR4      ;'       g    \        V RR4      4      ;'       d    \        V RR4      '       * # )a  --safe-mode / --ignore-user-config chat: the gateway owner freezes code defaults and runs
the turn out of process, so the profile's display.interface must not pick a surface and the
client performs no discovery. Explicit --tui forwards the flags in its session.create policy.Ú	safe_modeFÚignore_user_configÚtui)r   Úgetattr)Úargss   &r   Ú_bypass_chat_launchr      sF   € ô ”˜˜k¨5Ó1×_Ð_´W¸TÐCWÐY^Ó5_Ó`÷ ,ð ,Ü˜˜e UÓ+Ô+ð,r   c                ó\   € V ^8„  d   QhR\         \        ,          R\         \        ,          /# )r   Úpathr	   ©r   Ústr)r   s   "r   r   r       s"   € ÷ ñ ¬´­ð ¼(Ä3½-ñ r   c                 ó  € V '       g   R #  \         P                  ! \        V 4      P                  RR7      4      p\	        VP                  R4      ;'       g    R4      P                  4       ;'       g    R #   \         d     R # i ; i)Nú	utf-8-sig©ÚencodingÚ
session_idÚ )ÚjsonÚloadsr   Ú	read_textr   ÚgetÚstripÚ	Exception)r   Údatas   & r   Ú_read_tui_active_session_filer(       sl   € ßÙðÜ�zŠzœ$˜t›*×.Ñ.¸Ð.ÓDÓEˆÜ�4—8‘8˜LÓ)×/Ð/¨RÓ0×6Ñ6Ó8×@Ð@¸DÐ@øÜô Úðús   ŒAA7 ÁA7 Á4A7 Á7BÂBc                ó0   € V ^8„  d   QhR\         R\         /# )r   r   r	   ©r   )r   s   "r   r   r   .   s   € ÷ 	ñ 	¤Sð 	¬Sñ 	r   c                óÞ   € VP                  R4      '       d   \        V4      \        8:  d   V# VR\         p V P                  V4      V8X  d   V# T#   \        P
                   d    Tu # i ; i)u¶   The 22-char prefix of a canonical ``local-â€¦`` id when it names only that session (``--resume``
resolves a unique prefix back); every other id, or an ambiguous prefix, prints whole.zlocal-N)Ú
startswithÚlenÚ_SHORT_RESUME_LENÚresolve_session_idÚsqlite3ÚError)Údbr   Úshorts   && r   Ú_short_resume_idr4   .   sp   € ð × Ñ  ×*Ò*¬c°*«oÔARÔ.RØÐØÐ)Ô)Ð*€EðØ×-Ñ-¨eÓ4¸
ÔBˆuÐRÈ
ÐRøÜ�=‰=ô ØÒðús   ¸A ÁA ÁA,Á+A,c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úsessionr	   )ÚdictÚlist)r   s   "r   r   r   :   s   € ÷ ñ ¤ð ¬$ñ r   c                ó¼  € V.VP                  R4      0r2  \        P                  ! VR,          P                  R4      ;'       g    R4      p\        T\        4      '       d   TP                  R4      MRpT'       d   YS9  d   T P                  T4      MRpT'       g    T# TP                  T4       TP                  T4       K±    \        \        3 d     T# i ; i)zû*session* plus each ``/branch`` ancestor it was cut from. Main's epilogue after ``/branch`` still
named the parent and so reported the conversation's tokens; a canonical branch child is named
itself, and its copied history was billed on the ancestors.ÚidÚmodel_configz{}Ú_branched_fromNéÿÿÿÿ)
r$   r!   r"   Ú	TypeErrorÚ
ValueErrorÚ
isinstancer7   Úget_sessionÚaddÚappend)r2   r6   ÚrowsÚseenÚconfigÚ	parent_idÚparents   &&     r   Ú_branch_lineagerI   :   sÃ   € ð �˜WŸ[™[¨Ó.Ð/ˆ$Ø
ð	Ü—Z’Z  R¥§¡¨^Ó <× DÐ DÀÓEˆFô 5?¸vÄt×4LÒ4L�F—J‘JÐ/Ô0ÐRVˆ	ß.7¸IÔ<Q�—‘ 	Ô*ÐW[ˆßØð €Kð 	�‰�ÔØ�‰�FÖøô œ:Ð&ô 	Øð €Kð	ús   —.C ÁC ÃCÃCc                ó`   € V ^8„  d   QhR\         \        ,          R\         \        ,          RR/# )r   r   Úactive_session_filer	   Nr   )r   s   "r   r   r   M   s+   € ÷ 0ñ 0¬´­ð 0ÌHÔUXÍMð 0Ðeiñ 0r   c                ó  € ^ RI Hp \        V4      ;'       g    T ;'       g
    V! RR7      pV'       g   R# Rp ^ RIHp ^ RIHp V! V! 4       R,          RR	7      pVP                  V4      pV'       g    Ve   VP                  4        R# R# VP                  V4      p\        WC4      p	\        VP                  R
4      ;'       g    ^ 4      p
V
^ 8X  d    Ve   VP                  4        R# R# R" Uu/ uF  q»^ bK  	  pp\        WG4       FE  pV F<  pYË;;,          \        VP                  V R24      ;'       g    ^ 4      ,          uu&   K>  	  KG  	   Te   TP                  4        ^ RIHp T! 4       pTR#9   d   RMRT 2p\#        R\%        R4       RT	 T 24       T'       d   \#        RT RT 24       \#        RT	 24       T'       d   \#        RT 24       \#        RT
 24       \#        R\'        TP)                  4       4       RTR,           RTR,           RTR,          TR,          ,            R TR,           R!24       R# u upi   \         d     Te   TP                  4        R# R# i ; i  Te   TP                  4        i i ; i)$z/Print a shell-visible epilogue after TUI exits.)Ú_resolve_last_sessionr   )ÚsourceN)Ú	SessionDB©Úget_hermes_homeústate.dbT)Údb_pathÚ	read_onlyÚmessage_countÚinputÚoutputÚ
cache_readÚcache_writeÚ	reasoningÚ_tokens)Úget_active_profile_namer    z -p Ú
zcli.session.exit_resume_hintz
  hermes --tui --resume z  hermes --tui -c "Ú"z
Session:        zTitle:          zMessages:       zTokens:         z (in z, out z, cache z, reasoning Ú))rV   rW   rX   rY   rZ   )ÚdefaultÚcustom)Úhermes_cli.mainrM   r(   Úhermes_staterO   Úhermes_cli.configrQ   rA   ÚcloseÚget_session_titler4   Úintr$   rI   r&   Úhermes_cli.profilesr\   Úprintr   ÚsumÚvalues)r   rK   rM   Útargetr2   rO   rQ   r6   ÚtitleÚ	resume_idrU   ÚkÚtokensÚrowr\   Úactive_profileÚprofile_flags   &&               r   Ú_print_tui_exit_summaryrt   M   s|  € å5ä%Ð&9Ó:×oÐo¸j×oÐoÑLaÐinÔLoð ÷ Ùà	€BðÝ*Ý5Ù™Ó0°:Õ=ÈÔNˆØ—.‘. Ó(ˆßØð Š>Ø�H‰HŽJñ ð ×$Ñ$ VÓ,ˆÜ$ RÓ0ˆ	Ü˜GŸK™K¨Ó8×=Ð=¸AÓ>ˆØ˜AÔØð Š>Ø�H‰HŽJñ ñ !^Ó^Ñ ]˜1�Q’$Ñ ]ˆÐ^Ü" 2Ö/ˆCÛ�Ø—	œS §¡¨A¨3¨g¨Ó!7×!<Ð!<¸1Ó=Õ=•	ó ò 0ð Š>Ø�H‰HŒJõ <Ù,Ó.€NØ'Ð+@Ô@‘2ÈÈ^ÐL\ÐF]€LÜ	ˆBŒqÐ/Ó0Ð1Ð1KÈIÈ;ÐWcÐVdÐ
eÔfßÜÐ# E 7¨!¨L¨>Ð:Ô;Ü	Ð˜y˜kÐ
*Ô+ßÜÐ   Ð(Ô)Ü	Ð˜]˜OÐ
,Ô-Ü	ØÜˆv�}‰}‹ÓÐ
   f¨W¥oÐ%6°f¸VÀHÕ=MÐ<Nð OØ˜Õ%¨¨}Õ(=Õ=Ð>¸lÈ6ÐR]ÕK^ÐJ_Ð_`ð	böùò+ _øô ô ØàŠ>Ø�H‰HŽJñ ðûð Š>Ø�H‰H�Jð úsC   º;I ÂAI Ã.I Ã2IÃ=AI ÉI ÉI2ÉI5 É1I2É2I5 É5Jc                ó0   € V ^8„  d   QhR\         R\        /# )r   Úrootr	   ©r   r   )r   s   "r   r   r   €   s   € ÷ pñ pœDð p¤Tñ pr   c                 óò   € ^ RI Hp \        P                  P	                  R4      ;'       g    RP                  4       P                  4       pVR9   ;'       g!    V! V P                  RV R,          4      '       * # )é    )Úsource_product_currentÚHERMES_TUI_FORCE_BUILDr    r   Údist>   Ú1ÚonÚyesÚtrue)Úhermes_cli.source_buildrz   ÚosÚenvironr$   r%   ÚlowerrH   )rv   rz   Úforces   &  r   Ú_tui_need_rebuildr†   €   s_   € Ý>ä�Z‰Z�^‰^Ð4Ó5×;Ð;¸×BÑBÓD×JÑJÓL€EØÐ.Ñ.×oÐoÑ6LÈTÏ[É[ÐZ_ÐaeÐhnÕanÓ6oÔ2oÐor   c                óL   € V ^8„  d   QhR\         R,          R\         R,          /# )r   Úhermes_cli_dirNr	   r   )r   s   "r   r   r   ‡   s"   € ÷ 2ñ 2¤d¨T¥kð 2¼TÀD½[ñ 2r   c                ó�   € V f   \        \        4      P                  p V R,          R,          pVP                  4       '       d   V# R# )z3Find a pre-built TUI entry.js bundled in the wheel.NÚtui_distúentry.js)r   Ú__file__rH   Úis_file)rˆ   Úbundleds   & r   Ú_find_bundled_tuir�   ‡   s=   € àÒÜœh›×.Ñ.ˆØ˜zÕ)¨JÕ6€GØ—o‘o×'Ò'ˆ7Ð1¨TÐ1r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Útui_dirr	   rw   )r   s   "r   r   r   �   s   € ÷ ñ ¤Dð ¬Tñ r   c           
     óR  € \         P                  ! R4      pV'       d(   V P                  R,          P                  4       '       g   R#  \        P
                  ! VRRV P                  .\        V P                  4      RRRRRR	7       V P                  4       #   \         d     R# i ; i)
uŒ  Best-effort ``git restore`` of a missing ``ui-tui/`` (Windows AV/NTFS filters can delete
tracked files after ``hermes update``); True when the directory exists afterwards.

On Windows an antivirus / NTFS filter driver can leave tracked ``ui-tui/`` files deleted in the working
tree after ``hermes update`` (HEAD stays intact; the files just vanish â€” see issue #49145). Those files
are tracked, so ``git restore`` puts them back deterministically. Best-effort: returns False (rather
than raising) when git is unavailable, this isn't a checkout, or the restore leaves the directory still
missing â€” the caller then prints the manual-recovery message.
Úgitz.gitFÚrestorez--Tzutf-8Úreplace)ÚcwdÚcapture_outputÚtextr   ÚerrorsÚcheck)
ÚshutilÚwhichrH   ÚexistsÚ
subprocessÚrunÚnamer   ÚOSErrorÚis_dir)r‘   r“   s   & r   Ú_restore_tui_workspacer£   �   s‹   € ô �,Š,�uÓ
€Cß�w—~‘~¨Õ.×6Ñ6×8Ò8ÙðÜ�ŠØ�)˜T 7§<¡<Ð0´c¸'¿.¹.Ó6IÐZ^Ø °	Àõ	Hð
 �>‰>ÓÐøô ô Úðús   Á	>B ÂB&Â%B&c                ó(   € V ^8„  d   QhR\         RR/# )r   r‘   r	   Nr   )r   s   "r   r   r   ¥   s   € ÷ ñ ¤4ð ¨Dñ r   c                ó,  € V P                  4       '       d   R# \        V 4      '       d6   \        P                  P	                  R4      '       g   \        RV  24       R# \        RV  R2\        P                  R7       \        P                  ! ^4       R# )a  Ensure ``ui-tui/`` exists before it is used as a subprocess cwd (else ``NotADirectoryError``
/ ``WinError 267`` with no usable message): git-restore first, then abort with recovery steps.

Without this, a missing workspace falls through to ``subprocess.run(..., cwd=<missing ui-tui>)``, which
crashes with ``NotADirectoryError`` (``WinError 267`` on Windows) instead of a usable message (#49145).
We first try to self-heal via ``git restore``; only if that can't recover the directory do we abort with
concrete manual-recovery steps.
NÚHERMES_QUIETz Restored missing TUI workspace: zSError: the TUI workspace is missing from this Hermes checkout.
Expected directory: a/  
This usually means `hermes update` left tracked ui-tui files deleted.
Recovery:
  1. From the Hermes checkout, run `git restore -- ui-tui`
  2. Run `npm install --silent --no-fund --no-audit --progress=false`
  3. Retry `hermes --tui`
If the checkout is still inconsistent, run `hermes update --force`.©Úfile)	r¢   r£   r‚   rƒ   r$   ri   ÚsysÚstderrÚexit)r‘   s   &r   Ú_ensure_tui_workspacer¬   ¥   sy   € ð ‡~�~×ÒÙä˜g×&Ò&Ü�z‰z�~‰~˜n×-Ò-ÜÐ4°W°IÐ>Ô?Ùä	ð	Ø&˜ið (Nð	Nô �Z‰Zõ	ô ‡H‚HˆQ†Kr   c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úbinr	   r*   )r   s   "r   r   r   Ã   s   € ÷ ñ ”sð œsñ r   c                óÈ  € V R8X  dz   \         P                  P                  R4      pV'       dS   \         P                  P	                  V4      '       d.   \         P
                  ! V\         P                  4      '       d   V# ^ RIHp \        P                  ! W! V 4      P                  R,          R7      pV'       g&   \        RV  R24       \        P                  ! ^4       V# )zIResolve the TUI runtime through PM; an explicit bundled HERMES_NODE wins.ÚnodeÚHERMES_NODE)ÚensureÚPATH©r   z%Node.js is required for the TUI but `z¯` was not found. Install it from https://nodejs.org (run `hermes doctor` for the install hint for your OS), then retry `hermes --tui`. To keep working now, run `hermes --cli`.)r‚   rƒ   r$   r   ÚisfileÚaccessÚX_OKÚpmr²   r›   rœ   Úenvri   r©   r«   )r®   Úenv_noder²   r   s   &   r   Ú_tui_node_binr»   Ã   s™   € à
ˆf„}Ü—:‘:—>‘> -Ó0ˆßœŸ™Ÿ™ x×0Ò0´R·Y²Y¸xÌÏÉ×5QÒ5QØˆOÝÜ�<Š<˜ &¨£+§/¡/°&Õ"9Ô:€DßÜØ3°C°5ð 9Mð Mô	
ô
 	�Š�ŒØ€Kr   c                ót   € V ^8„  d   QhR\         R\        R\        \        \        ,          \         3,          /# )r   r‘   Útui_devr	   )r   r   Útupler8   r   )r   s   "r   r   r   Õ   s3   € ÷ 5Jñ 5JœDð 5J¬4ð 5J´E¼$¼s½)ÄT¸/Õ4Jñ 5Jr   c                óX  € \         P                  P                  R4      pV'       d>   V'       d6   \        RV R2\        P
                  R7       \        P                  ! ^4       V'       g�   V'       dW   \        V4      pVR,          R,          P                  4       '       d(   \        R4      R\        VR,          R,          4      .V3# \        4       pVe$   \        R4      R\        V4      .VP                  3# V'       g   \        V 4       V'       g2   \        V 4      '       g!   \        R4      R\        V R	,          4      .V 3# ^ R
IHpHpHp V P                  pV! 4       p	V! W‰R7       V'       dx   \&        P(                  ! RV	R,          R7      p
\*        P,                  ! V
RR.V R,          V	RR7       V R,          pVP/                  4       '       d   \        V4      R.V 3# V
R.V 3# V! W‰R7       \&        P(                  ! RV	R,          R7      pVR\        V R	,          4      .V 3# )uL   TUI: --dev â†’ tsx src; else node dist (HERMES_TUI_DIR prebuilt or esbuild).ÚHERMES_TUI_DIRz1Error: --dev is incompatible with HERMES_TUI_DIR=z„
The prebuilt TUI has no source code to hot-reload.
Unset HERMES_TUI_DIR (e.g. `unset HERMES_TUI_DIR`) to use --dev from a checkout.r§   r|   r‹   r°   z--expose-gczdist/entry.js)Úbuild_source_tuiÚprepare_launch_dependenciesÚsource_build_env©r¹   Únpmr³   r´   rŸ   Úbuildzpackages/hermes-inkT)r–   r¹   rš   znode_modules/.bin/tsxzsrc/entry.tsxÚstart)r‚   rƒ   r$   ri   r©   rª   r«   r   r�   r»   r   r�   rH   r¬   r†   r�   rÁ   rÂ   rÃ   r›   rœ   rž   rŸ   r�   )r‘   r½   Úext_dirÚprŽ   rÁ   rÂ   rÃ   Úproject_rootr¹   rÅ   Útsxr°   s   &&           r   Ú_make_tui_argvrÌ   Õ   sÑ  € ô �j‰j�n‰nÐ-Ó.€Gß—7ÜØ?À¸yð I_ð `ô —‘õ		ô
 	�Š�Œ÷ ßÜ�W“ˆAØ�F•
˜ZÕ'×0Ñ0×2Ò2Ü% fÓ-¨}¼cÀ!ÀfÅ*ÈzÕBYÓ>ZÐ[Ð]^Ð^Ð^ä#Ó%ˆØÒÜ! &Ó)¨=¼#¸g»,ÐGÈÏÉÐWÐW÷ Ü˜gÔ&çÔ,¨W×5Ò5Ü˜fÓ% }´c¸'ÀOÕ:SÓ6TÐUÐW^Ð^Ð^çgÑgà—>‘>€LÙ
Ó
€CÙ Õ6ßô �lŠl˜5 s¨6¥{Ô3ˆÜ�Š˜˜U GÐ,°'Ð<QÕ2QÐWZÐbfÕgØÐ/Õ/ˆØ/2¯z©z¯|ª|”�S“˜?Ð+ÐRYÐYÐYÀ#ÀwÀÐRYÐYÐYá�\Õ+Ü�<Š<˜ S¨¥[Ô1€DØ�-¤ W¨Õ%>Ó!?Ð@À'ÐIÐIr   Úsplit_non_strTc                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r   rÍ   r	   )r   r8   r   )r   s   "r   r   r     s   € ÷ 1ñ 1´ð 1ÄÄSÅ	ñ 1r   c               ó¼  € \        V \        4      '       d   V .MT p\        V\        \        34      '       g   V.p. pV F{  pV'       g   \        V\        4      '       d3   VP	                  R \        V4      P                  R4       4       4       KS  VP                  \        V4      P                  4       4       K}  	  V Uu. uF  qD'       g   K  VNK  	  up# u upi )zIFlatten str / list (comma-separated) input into stripped non-empty parts.c              3   ó@   "  € T F  qP                  4       x € K  	  R # 5i©N)r%   )Ú.0Úparts   & r   Ú	<genexpr>Ú%_split_comma_items.<locals>.<genexpr>  s   é € ÐLÑ7K¨tŸj™jŸl˜lÓ7Kùs   ‚Ú,)r@   r   r8   r¾   ÚextendÚsplitrC   r%   )ÚitemsrÍ   Ú	raw_itemsÚ
normalizedÚitems   &$   r   Ú_split_comma_itemsrÝ     s¥   € ä% e¬S×1Ò1�‘°u€IÜ�i¤$¬ ×/Ò/Ø�Kˆ	Ø€JÛˆßœJ t¬S×1Ò1Ø×ÑÑL´s¸4³y·±ÀsÔ7KÓLÖLà×Ñœc $›iŸo™oÓ/Ö0ñ	 ñ
 (Ó0™Z�T«4�DˆD™ZÑ0Ð0ùÒ0s   Ã	CÃCc                óF   € V ^8„  d   QhR\         R\        \        ,          /# )r   Útoolsetsr	   )Úobjectr8   r   )r   s   "r   r   r     s"   € ÷ Uñ U¤fð U´´cµñ Ur   c                ó”   €  ^ RI Hp V! V 4      ;'       g    . #   \        \        3 d    T '       d   \	        T RR7      u # . u # i ; i)zCNormalize argparse/Fire-style toolset input for the TUI subprocess.)Ú_normalize_toolsetsF)rÍ   )Úhermes_cli.oneshotrâ   ÚAttributeErrorÚImportErrorrÝ   )rß   râ   s   & r   Ú_normalize_tui_toolsetsræ     sJ   € ðUÝ:Ù" 8Ó,×2Ð2°Ð2øÜœKÐ(ô UßDLÔ! (¸%Ô@ÒTÐRTÒTðUús   ‚ — šA³AÁAÁAc                ó:   € V ^8„  d   QhR\         \        ,          /# r   )r   rg   )r   s   "r   r   r   $  s   € ÷ ñ ¤8¬C¥=ñ r   c                 ó|  € Rp V  Fv  p \        VRRR7      ;_uu_ 4       pVP                  4       P                  4       pRRR4       XR8X  d    R# T'       g   KU   \        T4      pT^ 8:  d   Kj  TR8¼  d    R# Tu # 	  R#   + '       g   i     LK; i  \        \        3 d     K£  i ; i  \         d     Kµ  i ; i)zðContainer memory limit in bytes, or None if unconstrained (v2 ``memory.max``, then v1).

V8 is NOT cgroup-aware: a flat 8GB heap grows past a smaller container limit
and the OOM-killer SIGKILLs Node with no breadcrumb (bare ``stdin EOF``).
Úrr   r   NÚmax)z/sys/fs/cgroup/memory.maxz+/sys/fs/cgroup/memory/memory.limit_in_bytesl           )ÚopenÚreadr%   r¡   r?   rg   )Ú
candidatesr   ÚfÚrawÚlimits        r   Ú_read_cgroup_memory_limitrñ   $  sµ   € ð€Jó ˆð	Ü�d˜C¨+×6Õ6¸!Ø—f‘f“h—n‘nÓ&�÷ 7ð �%Œ<ÚßÙð	Ü˜“HˆEð �AŒ:ÙØ�WÔÚØŠñ% ñ& ÷# 7×6ûäœÐ$ô 	Úð	ûô ô 	Úð	ús?   ‰BŸB¾BÁB,ÂBÂBÂBÂB)Â(B)Â,B;Â:B;c                ó0   € V ^8„  d   QhR\         R\         /# )r   Ú
default_mbr	   )rg   )r   s   "r   r   r   D  s   € ÷ :ñ :¤Sð :´Cñ :r   c                óš   € \        4       pV'       g   V # VR,          p\        VR,          4      pW08¼  d   V # VR8”  d   \        RV4      # T# )zõV8 ``--max-old-space-size`` (MB) that fits the container: ``default_mb`` when unconstrained,
else 75% of the cgroup limit (headroom for non-heap RSS + the gateway child), floored at
1536MB when the container is > 2GB (below that V8 GC-thrashes).g      è?i   i   i   )rñ   rg   rê   )ró   rð   Úlimit_mbÚsizeds   &   r   Ú_resolve_tui_heap_mbr÷   D  sS   € ô &Ó'€EßØÐØ˜Õ%€HÜ�˜4•Ó €EØÔØÐð  (¨$œŒ3ˆt�UÓÐ9°EÐ9r   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r   r¹   r	   )r   r7   r   )r   s   "r   r   r   T  s   € ÷ 	!ñ 	!”x¤•~ð 	!´ñ 	!r   c                ó|  € ^ RI Hp  \        P                  ! 4       #   \         d”    T ;'       g    / P                  R4      ;'       g*    \        P                  P                  R4      ;'       g    RP                  4       pT'       d$   \        T4      P                  4       '       d   Tu # \        T4      u # i ; i)z=Return a stable cwd value for the Node TUI child environment.©ÚPROJECT_ROOTÚPWDr    )rb   rû   r‚   ÚgetcwdÚFileNotFoundErrorr$   rƒ   r%   r   r¢   r   )r¹   rû   Ú	candidates   &  r   Ú_safe_tui_cwdr   T  s…   € å,ð!Ü�yŠy‹{ÐøÜô !Ø—i�i˜R—_‘_ UÓ+×JÐJ¬r¯z©z¯~©~¸eÓ/D×JÐJÈ×QÑQÓSˆ	ßœ˜i›×/Ñ/×1Ò1ØÒÜ�<Ó Ò ð	!ús,   ˆ �B;±B;Á
&B;Á1B;Â
!B;Â-B;Â:B;c                ó(   € V ^8„  d   QhR\         RR/# )r   r¹   r	   N©r7   )r   s   "r   r   r   `  s   € ÷ .ñ .œtð .¨ñ .r   c                óä  € ^ RI Hp \        V P                  R4      ;'       g    R4      P	                  4       pV'       d    \        V4      P                  4       '       g   \        V4      V R&   \        V P                  R4      ;'       g    R4      P	                  4       pV'       d    \        V4      P                  4       '       g   \        V 4      V R&   \        V P                  R4      ;'       g    R4      P	                  4       p\        P                  P                  V4      '       dy   \        V4      pVP                  4       '       g   \        V R,          4      V,          pVP                  4       ;'       d&    \        P                  ! V\        P                  4      pM/\        \         P"                  ! W@P                  R4      R7      4      pV'       g   \$        P&                  V R&   R# R# )	zMSeed/repair Python-related env vars shared by CLI and dashboard TUI launches.rú   ÚHERMES_PYTHON_SRC_ROOTr    Ú
HERMES_CWDÚHERMES_PYTHONr³   r´   N)rb   rû   r   r$   r%   r   r¢   r   r‚   r   ÚdirnameÚis_absoluter�   r¶   r·   r   r›   rœ   r©   Ú
executable)r¹   rû   Úsrc_rootr–   ÚpythonÚpython_pathÚpython_is_executables   &      r   Ú_apply_tui_python_envr  `  sU  € å,Ü�3—7‘7Ð3Ó4×:Ð:¸Ó;×AÑAÓC€Hßœ4 ›>×0Ñ0×2Ò2Ü(+¨LÓ(9ˆÐ$Ñ%ä
ˆc�g‰g�lÓ#×)Ð) rÓ
*×
0Ñ
0Ó
2€Cß”d˜3“i×&Ñ&×(Ò(Ü)¨#Ó.ˆˆLÑä�—‘˜Ó)×/Ð/¨RÓ0×6Ñ6Ó8€FÜ	‡w�w‡��v×ÒÜ˜6“lˆØ×&Ñ&×(Ò(Ü˜s <Õ0Ó1°KÕ?ˆKØ*×2Ñ2Ó4×XÐX¼¿ºÀ;ÔPR×PWÑPWÓ9XÑä#¤F§L¢L°¿g¹gÀf»oÔ$NÓOÐßÜ"Ÿ~™~ˆˆOÓñ  r   c                ó$   € V ^8„  d   QhR\         /# r   r  )r   s   "r   r   r   w  s   € ÷ ñ œTñ r   c                 ó~  € Rp  ^ RI HpHpHpHp V! 4       pV'       d0   V! V4       ^ RIpVP                  W%3RRR7      P                  4        ^ RIH	p V! V! 4       R,          R7      p V '       g   \        P                  ! ^4       V #   \         d)   p\        R	T 2\        P                  R
7        Rp?LNRp?ii ; i)zgCreate the ``--worktree`` checkout for a TUI launch (prune + async pack maintenance); exits on failure.N)Ú_git_repo_rootÚ_maintain_pack_healthÚ_prune_stale_worktreesÚ_setup_worktreezpack-maintenanceT)rl   r   r    ÚdaemonrP   rR   )Ú	retain_dbu#   âœ— Failed to create TUI worktree: r§   )Úclir  r  r  r  Ú	threadingÚThreadrÇ   rd   rQ   r&   ri   r©   rª   r«   )	Úwt_infor  r  r  r  ÚrepoÚ
_threadingrQ   Úexcs	            r   Ú_setup_tui_worktreer  w  s¬   € à€GðLßfÓfÙÓˆßÙ" 4Ô(ó +à×ÑØ,°7ÐASÐ\`ð ó bßbgÑbgÔbiÝ5ñ "©OÓ,=À
Õ,JÔKˆ÷ Ü�Š�ŒØ€Nøô	 ô LÜÐ3°C°5Ð9ÄÇ
Á
×KÒKûðLús   „B	 ŸA
B	 Â	B<ÂB7Â7B<c                ó0   € V ^8„  d   QhR\         R\        /# )r   r  r	   )r7   r   )r   s   "r   r   r   �  s   € ÷ #ñ #¬Tð #´dñ #r   c                óÞ  € ^ RI Hp ^ RIHp ^ RIHpHp V P                  R4      pV'       d    \        V4      P                  4       '       g   R#  \        V! 4       R,          4      pV! WeRR7      '       d   R# V! V4      '       d   R# V! We4      '       d   R# ^ R	IHp V! V 4       \        T4      P!                  4       '       * #   \         d    \        P                  R
TRR7        R# i ; i)aÞ  Remove the ``--tui -w`` checkout on quit when nothing still needs it (N8) -> True if gone.

Kept when the gateway has queued or started work for a session inside it (quitting only
detaches the viewer), still schedules work for one (an active loop, heartbeat or goal
continuation, or a cron job bound to it), another viewer still holds one, or another process
still works in it; and by ``_cleanup_worktree`` when it is dirty, holds unpushed commits or
something no branch keeps.
rP   )Ú_still_in_use)Ú_retained_tree_is_liveÚ_tree_still_servedr   FrR   T)Úpending_only)Ú_cleanup_worktreez'TUI worktree cleanup failed; keeping %s©Úexc_info)rd   rQ   Úhermes_cli.worktree_exitr!  Úhermes_cli.worktree_opsr"  r#  r$   r   r¢   r   r  r%  r&   ÚloggerÚdebugr�   )r  rQ   r!  r"  r#  r   rS   r%  s   &       r   Ú_remove_idle_clean_tui_worktreer,  �  sÀ   € õ 2Ý6ßRà�;‰;�vÓ€Dß”t˜D“z×(Ñ(×*Ò*ÙðÜ‘oÓ'¨*Õ4Ó5ˆÙ! '¸d×CÓCÙÙ˜×ÒÙá˜g×,Ò,ÙÝ)Ù˜'Ô"ô �D‹z× Ñ Ó"Ô"Ð"øô ô Ü�‰Ð>ÀÈtˆÔTÚðús$   Á'C Á9C Â	C ÂC Ã#C,Ã+C,c                ól   € V ^8„  d   QhR\         R\        \        ,          R\        \        ,          RR/# )r   r¹   ÚmodelÚresume_session_idr	   N)r7   r   r   )r   s   "r   r   r   ±  s2   € ÷ ñ œtð ¬H´S­Mð ÌhÔWZÍmð Ð`dñ r   c                ób  a a€ ^ RI Ho \        ;QJ d     V V3R lR
 4       F  '       g   K   RM	  RM! V V3R lR
 4       4      pV'       dc   V'       gY   V'       gO   S P                  RR4      P	                  4       '       g'   \        R\        P                  R7       \        ^4      hR	# R	# R	# R	# )züA --safe-mode / --ignore-user-config session reads no profile default model, so the owner
refuses its session.create without one (bare invalid_params). Say so before the TUI starts,
as classic chat does; a resume reuses the frozen route and needs none.©Úis_truthy_valuec              3   óR   <"  € T F  pS! SP                  V4      4      x € K  	  R # 5irÑ   )r$   )rÒ   r    r¹   r2  s   & €€r   rÔ   Ú(_require_bypass_model.<locals>.<genexpr>¶  s#   øé € ÐnÑ<m°D‘ §¡¨£×/Ð/Ó<mùs   ƒ$'TFÚHERMES_MODELr    zÞError: --safe-mode / --ignore-user-config (or HERMES_IGNORE_USER_CONFIG=1) read no profile default model: pass --model explicitly.
  Example: hermes --tui --safe-mode --provider openrouter --model anthropic/claude-sonnet-4r§   N)ÚHERMES_SAFE_MODEÚHERMES_IGNORE_USER_CONFIG)	Úutilsr2  Úanyr$   r%   ri   r©   rª   Ú
SystemExit)r¹   r.  r/  Úbypassr2  s   f&& @r   Ú_require_bypass_modelr<  ±  s|   ù€ õ &ß‹SÕnÑ<mÓn�S�SŠSÕnÑ<mÓnÓn€Fß×'·¸#¿'¹'À.ÐRTÓ:U×:[Ñ:[×:]Ò:]Üð lô —:‘:õ	ô ˜‹mÐñ ;^±Ñ'�vr   Úapi_keyz	--api-keyÚbase_urlz
--base-urlrZ   z--reasoningc                ó   € V ^8„  d   QhRR/# ©r   r	   N© )r   s   "r   r   r   Å  s   € ÷ ñ ¨4ñ r   c           	      ó.  € \         P                  4        UUu. uF  w  r\        WR 4      '       g   K  VNK  	  pppV'       dL   \        RRP	                  V4       RRP	                  V4       R2\
        P                  R7       \        ^4      hR # u uppi )Nz"Error: Unsupported --tui options: z, zP. No session was started.
  Use classic chat for this launch: hermes chat --cli Ú z] ...
  Or set model.base_url / agent.reasoning_effort in config.yaml (/reasoning in the TUI).r§   )Ú_TUI_UNFORWARDEDrÙ   r   ri   Újoinr©   rª   r:  )r   r    ÚflagÚflagss   &   r   Ú_refuse_unforwarded_tui_flagsrH  Å  sŽ   € Ü$4×$:Ñ$:Ô$<ÔZÑ$<‘j�dÄÈÐTX×@Y�TˆTÑ$<€EÑZßÜÐ2°4·9±9¸UÓ3CÐ2Dð EGØGJÇxÁxÐPUÃÐFWð Xiðiô —:‘:õ	ô ˜‹mÐñ ùó [s
   ˜B³Bc                 óˆ  € V ^8„  d   QhR\         \        ,          R\        R\         \        ,          R\         \        ,          R\         \        ,          R\        R\        R\         \        ,          R	\        R
\         \        ,          R\         \        ,          R\        R\        R\        R\         \        ,          R\        /# )r   r/  r½   Únative_moder.  Úproviderrß   ÚskillsÚverboseÚquietÚqueryÚimageÚworktreeÚcheckpointsÚpass_session_idÚ	max_turnsÚaccept_hooks)r   r   r   rà   rg   )r   s   "r   r   r   Ï  sà   € ÷ Pñ PÜ¤•}ðPÜ6:ðPÜQYÔZ^ÕQ_ðPä”C�=ðPô ”s�mðPô /5ðPô FLðPô ”d�^ð	Pô ,0ð	Pô AIÌÅð	Pô
 ”C�=ðPô
 ,0ðPô
 GKðPô ðPô /7´s­mðPô SWñPr   c                ó”  € ^ RI Hp VR,          p^ RIp^ RIHp V! RRR7      p\        VW04       \        V4      VR&   ^ R	IHp  V! VV 4        ^ RIHp T! TR7       TP)                  RRR7      w  pp\*        P,                  ! T4       TTR&   TP/                  RT'       d   RMR4       TfU    ^ RIHp ^ RIHp T! 4       P7                  R/ 4      p\9        T\:        4      '       d   T! TP7                  RR4      4      MRpT'       d   RMRTR&   RpT'       d#   \=        4       pTR,          TR&   TR,          TR&   \?        TP7                  R 4      ;'       g    R!4      R!8X  d   TR,          ;TR&   TR"&   MTPA                  R"R4       \C        T4       ^ R#I"H#p \H        PJ                  ! T! 4       4      TR$&   R%pT'       dP   \9        T\L        \N        34      '       d   R&PQ                  \S        T4      4      M\?        T4      PU                  4       pR'T3R(T3R)T3R*T3R+R&PQ                  \W        T4      4      3R,T3R-T	3R.T
3R/T'       d   RMR3R0T'       d   RMR3R1Te   \?        T4      MR3R2T'       d   R3MT'       d   R4MR3R5T'       d   RMR33 F  w  p p!T!'       g   K  T!TT &   K  	  TP7                  R6R%4      PY                  4       p"\Z        ;QJ d    R7 T" 4       F  '       g   K   RM	  RM! R7 T" 4       4      '       g   T"P]                  R8\_        4        24       R9PQ                  T"4      TR6&   TPA                  R:R4       T '       d   T TR:&   \a        TT4      w  p#p$Rp%  \b        Pd                  ! T#\?        T$4      TR;7      p%T%RG9   d   \i        T T4       \k        T4      ;'       g    T p&\l        Pn                  ! \p        4      ;_uu_ 4        \*        Pr                  ! T4       RRR4       T'       d   T%RG9   d   ^ R<I:H;p' T'! T4       ^ R=I:H<p( T'       d   T(! T\        4      '       d   RpT'       d   \{        T4      '       d   RpT'       d_   T&'       d2   ^ R>IH>p) ^ R?I?H@p* T*! TR@,          TR,          T&T)! 4       RA,          4       \        RBTR,           2\        P                  R7       T%^*8X  d   ^ RCIAHBp+ \        RD4       T+! RE.RRF7       \        P†                  ! T%4       R#   \        \        3 d0   p\        R
T 2\        P                  R7       \        ^4      RhRp?ii ; i  \"         d    \$        P'                  RRR7        ELûi ; i  \"         d    Rp ELji ; i  \f         d    ^‚p% ELõi ; i  + '       g   i     EL¡; i  \k        T4      ;'       g    T p&\l        Pn                  ! \p        4      ;_uu_ 4        \*        Pr                  ! T4       RRR4       M  + '       g   i     M; iT'       d   T%RG9   d   ^ R<I:H;p' T'! T4       ^ R=I:H<p( T'       d   T(! T\        4      '       d   RpT'       d   \{        T4      '       d   RpT'       d`   T&'       d2   ^ R>IH>p) ^ R?I?H@p* T*! TR@,          TR,          T&T)! 4       RA,          4       \        RBTR,           2\        P                  R7       i i ; i)Hz%Replace current process with the TUI.rú   zui-tuiN)Úbuild_subprocess_envFT)Úscrub_secretsÚinherit_profile_homer  )Úconfigure_tui_attachmentzError: r§   )Úapply_terminal_config_to_envrÄ   z5Failed to apply terminal config bridge for TUI launchr&  zhermes-tui-active-session-z.json)ÚprefixÚsuffixÚHERMES_TUI_ACTIVE_SESSION_FILEÚNODE_ENVÚdevelopmentÚ
production©Úload_configr1  ÚdisplayÚ
tui_nativer}   Ú0ÚHERMES_TUI_NATIVEr   ÚTERMINAL_CWDÚTERMINAL_ENVÚlocalÚHERMES_TUI_CWD)Úshell_client_envÚHERMES_TUI_CLIENT_ENVr    rÖ   r5  ÚHERMES_INFERENCE_MODELÚHERMES_TUI_PROVIDERÚHERMES_INFERENCE_PROVIDERÚHERMES_TUI_TOOLSETSÚHERMES_TUI_SKILLSÚHERMES_TUI_QUERYÚHERMES_TUI_IMAGEÚHERMES_TUI_CHECKPOINTSÚHERMES_TUI_PASS_SESSION_IDÚHERMES_TUI_MAX_TURNSÚHERMES_TUI_TOOL_PROGRESSrM  ÚoffÚHERMES_ACCEPT_HOOKSÚNODE_OPTIONSc              3   óD   "  € T F  qP                   ! R 4      x € K  	  R# 5i)ú--max-old-space-size=N)r,   )rÒ   r   s   & r   rÔ   Ú_launch_tui.<locals>.<genexpr>+  s   é € ÐF¹g¸�|Š|Ð3×4Ð4»gùs   ‚ r}  rC  ÚHERMES_TUI_RESUME)r–   r¹   )Úask_exit_choice)Úapply_exit_choicerP   )Ú_retain_worktree_for_sessionÚ	repo_rootrR   z$Worktree retained for this session: )Úrelaunchu   
â˜¤ Launching update...
Úupdate)Úpreserve_inherited>   ry   é‚   )Drb   rû   ÚtempfileÚtools.environments.localrW  r<  r   Ú hermes_cli.shared_session_attachrZ  r?   ÚRuntimeErrorri   r©   rª   r:  rd   r[  r&   r*  r+  Úmkstempr‚   re   Ú
setdefaultrc  r8  r2  r$   r@   r7   r  r   Úpopr  Úhermes_cli.gateway_chatrl  r!   Údumpsr8   r¾   rE  rÝ   r%   ræ   rØ   r9  rC   r÷   rÌ   rž   ÚcallÚKeyboardInterruptrt   r(   Ú
contextlibÚsuppressr¡   Úunlinkr(  r€  r�  r,  rQ   r)  r‚  Úhermes_cli.relaunchr„  r«   ),r/  r½   rJ  r.  rK  rß   rL  rM  rN  rO  rP  rQ  rR  rS  rT  rU  rû   r‘   rˆ  rW  r¹   rZ  r  r[  Úactive_session_fdrK   rc  r2  rd  r  rl  Úskills_valueÚkeyÚvaluer[   Úargvr–   ÚcodeÚattached_sessionr€  r�  rQ   r‚  r„  s,   &&&&&&&&&&&&&&&&                            r   Ú_launch_tuirž  Ï  sÛ  € õ -Ø˜XÕ%€Gãõ >Ù
¨UÈÔ
N€CÜ˜#˜uÔ8ô
 & cÓ*€CˆÑÝIð&Ù  Ð&7Ô8ð]ÝBÙ$¨Õ-ð .6×-=Ñ-=Ø+°Gð .>ó .=Ñ*ÐÐ*ä‡H‚HÐÔØ,?€CÐ(Ñ)Ø‡N�N�:·™}¸\ÔJØÒð	 Ý5Ý-Ù!“m×'Ñ'¨	°2Ó6ˆGÜOYÐZaÔcg×OhÒOh™/¨'¯+©+°lÀEÓ*JÔKÐnsˆK÷ '2™s°s€CÐÑà€GßÜ%Ó'ˆØ# F�OˆˆLÑØ% f�oˆˆNÑô
 ˆ3�7‰7�>Ó"×-Ð- gÓ.°'Ô9Ø69¸,Õ6GÐGˆˆNÑ˜cÐ"2Ò3à�‰Ð  $Ô'ä˜#Ôõ 9Ü#'§:¢:Ñ.>Ó.@Ó#A€CÐÑ à€Lßä4>¸vÌÌeÀ}×4UÒ4UˆC�H‰HÔ'¨Ó/Ô0Ô[^Ð_eÓ[f×[lÑ[lÓ[nð 	ð 
˜ÐÐ":¸EÐ!BØ	 Ð)Ð,GÈÐ+RØ	 §¡Ô)@ÀÓ)JÓ KÐLØ	˜lÐ+Ø	˜UÐ#Ð&8¸%Ð%@Ø	!¯+¡3¸4Ð@Ø	%¯o¡sÀ4ÐHØ	°9Ò3H¤ Y¤ÈdÐSØ	#·'¡YÏ¹uÐSWÐXØ	§|¡¸Ð>ó
@‰
ˆˆU÷ ‰5ØˆC�‹Hñ
@ð$ �g‰g�n bÓ)×/Ñ/Ó1€Gß‹3ÑF¹gÓF�3�3Š3ÑF¹gÓF×FÒFØ�‰Ð.Ô/CÓ/EÐ.FÐGÔHØŸ(™( 7Ó+€CˆÑð
 ‡G�GÐ Ô&ßØ#4ˆÐÑ ä˜w¨Ó0�I€Dˆ#Ø€Dð]ð	Ü—?’? 4¬S°«X¸3Ô?ˆDð �8ÔÜ#Ð$5Ð7JÔKä8Ð9LÓM×bÐbÐQbÐÜ× Ò ¤×)Õ)Ü�IŠIÐ)Ô*÷ *ç�t˜xÔ'Ý@Ù˜GÔ$Ý>ßÑ(¨´%×8Ò8ØˆGßÔ6°w×?Ò?ØˆGß÷  õ >ÝPÙ,¨W°[Õ-AÀ7È6Å?ÐTdÙ-<Ó->ÀÕ-KôMäÐ8¸À½Ð8IÐJÔQT×Q[ÑQ[Õ\ð ˆr„zÝ0ÜÐ+Ô,Ù�(�°Õ6ä‡H‚HˆT†Nøôo œÐ%ô &Ü�˜�uˆo¤C§J¡JÕ/Ü˜‹m Ð%ûð&ûô ô ]Ü�‰ÐLÐW[ˆ×\ð]ûô ô 	 Ø‹Kð	 ûô@ !ô 	Ø‹Dð	ú÷ *×)Ð)ûô 9Ð9LÓM×bÐbÐQbÐÜ× Ò ¤×)Õ)Ü�IŠIÐ)Ô*÷ *×)×)Ð)úç�t˜xÔ'Ý@Ù˜GÔ$Ý>ßÑ(¨´%×8Ò8ØˆGßÔ6°w×?Ò?ØˆGß÷  õ >ÝPÙ,¨W°[Õ-AÀ7È6Å?ÐTdÙ-<Ó->ÀÕ-KôMäÐ8¸À½Ð8IÐJÔQT×Q[ÑQ[Ö\ð ús°   Á	S1 ÁT4 Â0AU Í*"U1 ÎV ÏVÓ1T1Ô*T,Ô,T1Ô4"UÕUÕU.Õ-U.Õ1VÕ>V ÖVÖV ÖV	Ö8[×W1	×(	[×1X×<[Ø"[Ø/[Ù	[Ù[Ù'[Ù/A[c                ó   € V ^8„  d   QhRR/# r@  rA  )r   s   "r   r   r   b  s   € ÷ @ñ @˜tñ @r   c                 ó  € \         P                  P                  R4      '       d   R# \        P                  ! \
        4      ;_uu_ 4        ^ RIHp  V ! 4       \         P                  R&   RRR4       R#   + '       g   i     R# ; i)u™  Pin the active kanban board into ``HERMES_KANBAN_BOARD`` so in-process tools and shelled-out
``hermes kanban`` calls agree even if a concurrent ``boards switch`` flips the file mid-turn.

Without this, in-process tools (``kanban_*``) and shelled-out CLI calls (``hermes kanban â€¦``) resolve
the board on different paths: the env-pin if set, otherwise the global ``<root>/kanban/current`` file. A
concurrent ``hermes kanban boards switch`` from another session can flip the file mid-turn, so the same
chat sees its tool calls hit board A while its shell calls hit board B (#20074). Pinning at chat boot
mirrors what the dispatcher already does for spawned workers.
ÚHERMES_KANBAN_BOARDN©Úget_current_board)r‚   rƒ   r$   r“  r”  r&   Úhermes_cli.kanban_dbr£  r¢  s    r   Ú_pin_kanban_board_envr¥  b  sP   € ô 
‡z�z‡~�~Ð+×,Ò,ÙÜ	×	Ò	œY×	'Õ	'Ý:Ù,=Ó,?Œ�
‰
Ð(Ñ)÷ 
(×	'×	'Ò	'ús   Á
A3Á3B	c                ó   € V ^8„  d   QhRR/# r@  rA  )r   s   "r   r   r   s  s   € ÷  ñ   dñ  r   c                 ó¢   € \         P                  ! \        4      ;_uu_ 4        ^ RIHp  V ! RR7       RRR4       R#   + '       g   i     R# ; i)z¥Seed ``~/.hermes/skills/`` with the bundled library (idempotent, milliseconds when synced).
Failures are swallowed: skills are an enhancement, not a hard dependency.©Úsync_skillsT)rN  N)r“  r”  r&   Útools.skills_syncr©  r¨  s    r   Ú_sync_bundled_skills_quietlyr«  s  s/   € ô 
×	Ò	œY×	'Õ	'Ý1Ù˜$Õ÷ 
(×	'×	'Ò	'ús	   £=½A	c                ó$   € V ^8„  d   QhR\         /# r   r
   )r   s   "r   r   r   {  s   € ÷ ñ œdñ r   c                óŠ  € \        V RR4      '       d   R# \        V RR4      '       g   \        V RR4      '       d   R#  \        P                  P                  4       '       d%   \        P                  P                  4       '       g   R#  \        P                  P                  R4      R8X  d   R#  ^ RI	H
p T! 4       P                  R	/ 4      ;'       g    / P                  R
R4      p\        T\        4      ;'       d"    TP                  4       P                  4       R8H  #   \
         d     R# i ; i  \
         d     R# i ; i)u—  Decide whether to launch the TUI: ``--cli`` â†’ classic; ``--tui`` â†’ TUI; no TTY â†’ classic;
``HERMES_TUI=1`` â†’ TUI; ``display.interface`` config; default classic.

The TTY gate is load-bearing: ambient preferences must never hijack a piped
``hermes chat -q`` (kanban workers, cron) â€” the Ink no-TTY bail-out exits 0 and
the worker dies with a protocol violation. Explicit ``--tui`` still bails out.
r  Fr   re  TÚ
HERMES_TUIr}   rb  rd  Ú	interface)r   r©   ÚstdinÚisattyÚstdoutr&   r‚   rƒ   r$   rd   rc  r@   r   r%   r„   )r   rc  Úifaces   &  r   Ú_resolve_use_tuir´  {  s  € ô ˆt�U˜E×"Ò"ÙÜˆt�U˜E×"Ò"¤g¨d°LÀ%×&HÒ&HÙðÜ—	‘	× Ñ ×"Ò"¤s§z¡z×'8Ñ'8×':Ò':Ùð (;ô 
‡z�z‡~�~�lÓ# sÔ*ÙðÝ1Ù“×"Ñ" 9¨bÓ1×7Ð7°R×<Ñ<¸[È%ÓPˆÜ˜%¤Ó%×HÐH¨%¯+©+«-×*=Ñ*=Ó*?À5Ñ*HÐHøô ô Úðûô ô Úðús5   ¿#D! Á##D! Â1#D3 Ã)D3 Ã?!D3 Ä!D0Ä/D0Ä3EÅErÑ   )i    )NFNNNNNNFNNFFFNF),Ú__doc__Úloggingr“  r!   r‚   r›   r0   rž   r©   Úpathlibr   Útypingr   Ú
agent.i18nr   Ú	getLoggerr*  r   r(   r.   r4   rI   rt   r†   r�   r£   r¬   r»   rÌ   rÝ   ræ   rñ   r÷   r   r  r  r,  r<  rD  rH  rž  r¥  r«  r´  rA  r   r   Ú<module>r»     sì   ðñó Û Û Û 	Û Û Û Û 
å Ý Ý ð 
×	Ò	Ð,Ó	-€õ,õð Ð õ	õ÷&0õfp÷2õõ,õ<õ$5Jðp1°t÷ 1õUõ÷@:÷ 	!õ.õ.õ2#õBð" ˜{¨J¸ÀkÐS`ÐaÐ õ÷Põf@õ" ÷r   