+
    „WÝjnI  ã                  ót  € R t ^ RIH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 R R ltR R	 ltR
 R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR2R R lltR R ltR R lt ! R  R!4      tR" R# ltR$ R% ltR& R' lt ! R( R)]	4      tR* R+ ltR,R-/R. R/ lltR0 R1 lt R# )3uú  Shared print/translate helpers + session-info slash handlers (``cli_commands_mixin`` split).

Moved verbatim from ``hermes_cli/cli_commands_mixin.py`` (file-line ratchet #68779): the
lazy-binding contract carries over unchanged â€” ``cli.py``-internal symbols are imported at
call time via ``from cli import ...``, so patch seams on the ``cli`` facade still intercept.
``cli_commands_mixin`` re-imports every helper moved here, so existing ``from
cli_commands_mixin import _t`` style imports keep working.
)ÚannotationsN)Úredirect_stdout)ÚStringIO©Útc               ó    € V ^8„  d   QhRRRR/# ©é   ÚlinesÚstrÚreturnÚNone© )Úformats   "ÚYC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\cli_commands_session_tools.pyÚ__annotate__r      s   € ÷ ñ �ð ˜ñ ó    c                 ó4   € ^ RI Hp V  F  pV! V4       K  	  R# )z@``_cprint`` each line (lazy import: cli.py imports this module).)Ú_cprintN)Úclir   )r
   r   Úlines   *  r   Ú_cpr      s   € åÛˆÙ�Žó r   c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r      s   € ÷ ñ �ð ˜ñ r   c                 ó.   € V  F  p\        V4       K  	  R# )zprint() each line.N)Úprint)r
   r   s   * r   Ú_prr      s   € ãˆÜˆdŽó r   c               ó    € V ^8„  d   QhRRRR/# )r	   Úkeyr   r   Úboolr   )r   s   "r   r   r   #   s   € ÷ )ñ )ˆsð )˜dñ )r   c                ó   € ^ RI Hp V! W4      # )zDcli.save_config_value, resolved lazily (cli.py imports this module).)Úsave_config_value)r   r    )r   Úvaluer    s   && r   Ú_saver"   #   s   € å%Ù˜SÓ(Ð(r   c               ó    € V ^8„  d   QhRRRR/# ©r	   Útextr   r   r   )r   s   "r   r   r   )   s   € ÷ !ñ !ˆsð !�sñ !r   c                ó"   € ^ RI HpHp V V  V 2# )z%Wrap ``text`` in the dim ANSI escape.)Ú_DIMÚ_RST)r   r'   r(   )r%   r'   r(   s   &  r   Ú_dimr)   )   s   € çØˆV�D�6˜$˜Ð Ð r   c               ó    € V ^8„  d   QhRRRR/# r$   r   )r   s   "r   r   r   /   s   € ÷ ñ �Cð ˜Cñ r   c                ó&   € R\        V 4      ,           # )zDTwo-space indented dim line (the standard slash-command hint shape).ú  )r)   ©r%   s   &r   Ú	_dim_liner.   /   s   € à”$�t“*ÕÐr   c               ó    € V ^8„  d   QhRRRR/# r$   r   )r   s   "r   r   r   4   s   € ÷ $ñ $�#ð $˜#ñ $r   c                ó"   € ^ RI HpHp V V  V 2# )z-Wrap ``text`` in the skin accent ANSI escape.)Ú_ACCENTr(   )r   r1   r(   )r%   r1   r(   s   &  r   Ú_accentr2   4   s   € ç!ØˆY�t�f˜T˜FÐ#Ð#r   c               ó    € V ^8„  d   QhRRRR/# r$   r   )r   s   "r   r   r   :   s   € ÷  ñ  �sð  ˜sñ  r   c                ó   € R\        V 4       2# )zKTwo-space indented accent line (the standard slash-command headline shape).r,   )r2   r-   s   &r   Ú_accent_liner5   :   s   € à”˜“ˆÐÐr   c               ó    € V ^8„  d   QhRRRR/# ©r	   r   r   r   r   )r   s   "r   r   r   ?   s   € ÷ .ñ .ˆCð .˜cñ .r   c                ó    € \        RV  23/ VB # )zLCatalog text for this module: ``cli.commands.<key>`` in the active language.zcli.commands.r   ©r   Úkwargss   &,r   Ú_tr;   ?   s   € äˆ}˜S˜EÐ"Ñ- fÑ-Ð-r   c               ó$   € V ^8„  d   QhRRRRRR/# )r	   r   r   ÚcountÚintr   r   )r   s   "r   r   r   D   s&   € ÷ Rñ RˆSð R˜ð R¨3ñ Rr   c                ó:   € \        T  RV^8X  d   RMR 23RV/VB # )zMPlural-aware ``_t``: ``<key>_one`` when ``count == 1``, else ``<key>_other``.Ú_ÚoneÚotherr=   )r;   )r   r=   r:   s   &&,r   Ú_tnrC   D   s+   € ä���Q ¨¤
‘u°Ð8Ð9ÑQÀÐQÈ&ÑQÐQr   c               ó    € V ^8„  d   QhRRRR/# r7   r   )r   s   "r   r   r   I   s   € ÷ )ñ )ˆSð )˜sñ )r   c                ó    € \        RV  23/ VB # )zUA ``gateway.<key>`` catalog entry the CLI shares verbatim with the messaging gateway.zgateway.r   r9   s   &,r   Ú_gtrF   I   s   € äˆx˜�uÐÑ( Ñ(Ð(r   c               ó$   € V ^8„  d   QhRRRRRR/# )r	   r%   r   Úpadr   Úlistr   )r   s   "r   r   r   N   s&   € ÷ Jñ J�ð J˜3ð J¨$ñ Jr   c                óf   € V P                  4        Uu. uF  q"'       d   V V 2MRNK  	  up# u upi )z\Each line of a (possibly multi-line) catalog value prefixed with ``pad`` (blank lines kept).Ú )Ú
splitlines)r%   rH   r   s   && r   Ú_linesrM   N   s2   € à7;·±Ô7HÓIÑ7H¨tždˆsˆe�D�6‰N¨Ò*Ñ7HÑIÐIùÒIs   “.c               ó    € V ^8„  d   QhRRRR/# )r	   ÚresultÚdictr   r   r   )r   s   "r   r   r   S   s   € ÷ Uñ U˜4ð U Dñ Ur   c           
     ón  € ^ RI Hp V P                  R4      ;p'       d$   \        \	        \        RV! V4      R7      4      !   V P                  R4      ;p'       d    \        R\        RV! V4      R7       24       V P                  R4      ;p'       d"   \        R\        R	V! V4      R7       24       R
# R
# )z`The kept / not-removed path lines of a restore result (in-process CLI and gateway client alike).)Ú_summarize_pathsÚskipped_user_editszrollback.kept_user_edits)ÚfilesÚskipped_oversizer,   zrollback.kept_oversizeÚfailed_deleteszrollback.failed_deletesN)Úhermes_cli.cli_commands_mixinrR   Úgetr   rM   rF   r   )rO   rR   ÚskippedÚoversizeÚfaileds   &    r   Ú_rollback_keptr\   S   s    € å>Ø—*‘*Ð1Ó2Ð2€wÖ2ÜŒV”CÐ2Ñ:JÈ7Ó:SÔTÓUÒVØ—:‘:Ð0Ó1Ð1€xÖ1Ü�”3Ð/Ñ7GÈÓ7QÔRÐSÐTÔUØ—‘Ð,Ó-Ð-€vÖ-Ü�”3Ð0Ñ8HÈÓ8PÔQÐRÐSÖTñ .r   c               ó    € V ^8„  d   QhRRRR/# )r	   Úmoduler   Únamer   )r   s   "r   r   r   ^   s   € ÷ ñ �3ð ˜cñ r   c                ór   €  \        \        P                  ! V 4      V4      ! V!  #   \         d    Tu # i ; i)z—``<module>.<name>(*args)`` or ``default`` when the import or the call fails (optional
subsystems: browser backends, async delegations, wake word, ...).)ÚgetattrÚ	importlibÚimport_moduleÚ	Exception)r^   r_   ÚdefaultÚargss   &&&*r   Ú_proberg   ^   s8   € ðÜ”y×.Ò.¨vÓ6¸Ô=¸tÑDÐDøÜô ØŠðús   ‚#& ¦6µ6c                  óz   € ] tR t^gtRtR tR tR R ltR tR R lt	R	 R
 lt
R R ltR R ltR R ltR tRtR# )ÚCLICommandsSessionToolsMixinz�``/stop``, ``/agents``, ``/journey``, ``/paste``, ``/copy``, ``/image``, ``/tools``,
``/profile`` handlers (moved from ``CLICommandsMixin``).c                ó  € \        V RR4      '       g   \        4       # \        V RR4      '       d0   ^ RIHp \	        R\        R4       24       V! V P                  4       ^ RIHp V! \        R	R
7      P                  4        R# )uÃ  Handle /stop â€” kill all running background processes and background (async) delegations.
Typed while a turn runs it stops that turn first, as Ctrl+C does (the registry's
``busy_policy="interrupt_then_dispatch"``; the input loop dispatches it inline, on the UI
thread). The interrupt is immediate; the background cleanup then runs on a worker thread,
since ``kill_all`` waits out each process's stop grace period and would freeze input.

See #14602.
Ú_agent_runningFÚagentN)Úrequest_hard_interruptr,   zcli.tui.interrupting)Úspawn_context_threadzcli-stop©r_   )
ra   Ú_stop_background_workÚagent.interrupt_compatrm   r   r   rl   Úagent.memory_providerrn   Ústart)Úselfrm   rn   s   &  r   Ú_handle_stop_commandÚ1CLICommandsSessionToolsMixin._handle_stop_commandm   sh   € ô �tÐ-¨u×5Ò5Ü(Ó*Ð*Ü�4˜ $×'Ò'ÝEÜ�"”QÐ-Ó.Ð/Ð0Ô1Ù" 4§:¡:Ô.Ý>ÙÔ2¸ÔD×JÑJÖLr   c                óz  € ^ RI HpHp ^ RIHp V! 4       V! 4       rTVe   VP                  RR7       VP                  4       pV Uu. uF  qwP                  R4      R8X  g   K  VNK  	  ppV Uu. uF  qwP                  R4      R8w  g   K  VNK  	  p	p\        R\        R	\        V4      R
7       24       V FV  pV! VP                  R^ 4      4      p
\        RVP                  RR4       RV
 RVP                  RR4      R,           24       KX  	  V	'       d#   \        R\        R\        V	4      R
7       24       Vf   \        4        M1VP                  4       ;p'       d   \        R\        RVR
7       24       \        V RR4      p\        RV'       d   \        R4      M
\        R4       24       R# u upi u upi )u½   Handle /agents â€” show background processes and agent status. On the gateway both run there:
the session's ``process.list`` and its usage's running-subagent count (no per-delegation rows).©Úprocess_registryÚprocess_view)Úformat_uptime_shortNT©ÚforceÚstatusÚrunningr,   zagents.running_processes©r=   Úuptime_secondsú    Ú
session_idÚ?õ    Â· ÚcommandrK   :NéP   Nzagents.recently_finishedúagents.background_delegationsrk   Fzagents.agent_runningzagents.agent_idle)Úhermes_cli.gateway_toolsry   rz   Útools.process_registryr{   ÚrefreshÚlist_sessionsrX   r   r;   ÚlenÚ_print_local_delegationsÚactive_delegationsra   )rt   Ú	_registryrz   r{   ry   ÚviewÚ	processesÚpr   ÚfinishedÚupÚn_asyncÚagent_runnings   &            r   Ú_handle_agents_commandÚ3CLICommandsSessionToolsMixin._handle_agents_command   sƒ  € ÷ 	YÝ>Ù!*£©l«n˜$ØÒØ�L‰L˜tˆLÔ$Ø$×2Ñ2Ó4ˆ	Ù'ÓH™i˜¯5©5°«?¸iÑ+G—1�1™iˆÐHÙ(ÓI™y˜!¯E©E°(«O¸yÑ,H—A�A™yˆÐIÜˆb”Ð.´c¸'³lÔCÐDÐEÔFÛˆAÙ$ Q§U¡UÐ+;¸QÓ%?Ó@ˆBÜ�$�q—u‘u˜\¨3Ó/Ð0°°R°D¸¸Q¿U¹UÀ9ÈbÓ=QÐRUÕ=VÐ<WÐXÖYñ ÷ Ü�"”RÐ2¼#¸h»-ÔHÐIÐJÔKØŠ<Ü$Õ&Ø×/Ñ/Ó1Ð1ˆWÖ1Ü�"”RÐ7¸wÔGÐHÐIÔJÜ Ð&6¸Ó>ˆÜˆb¯}”Ð*Ô+Ä"ÐEXÓBYÐZÐ[Ö\ùò IùÚIs   ÁF3Á"F3Á.F8Â
F8c               ó    € V ^8„  d   QhRRRR/# ©r	   Úcmd_originalr   r   r   r   )r   s   "r   r   Ú)CLICommandsSessionToolsMixin.__annotate__˜   s   € ÷ 8ñ 8°Cð 8¸Dñ 8r   c           	     óˆ  € ^ RI Hp \        P                  ! RRR7      pV! V4        VP	                  \
        P                  ! V4      R,          4      p \        TRR4      R9   d   TP                  T4       R# RTn
        \        P                  ! 4       p\        T4      ;_uu_ 4        TP                  T4       RRR4       \        TP                  4       P!                  R	4      4       R#   \         d     R# i ; i  + '       g   i     LL; i  \"         d%   p\        R
\%        RTR7       24        Rp?R# Rp?ii ; i)uö   Handle /journey â€” the learning timeline (see `hermes journey`). Read-only views render
Rich color that patch_stdout would swallow, so capture with forced ANSI and re-emit via
``_cprint``; ``delete``/``edit`` are interactive and keep real stdio.)Úregister_cliz/journeyF)ÚprogÚadd_helpºé   NNNÚjourney_actionTÚ
r,   zjourney.failed©Úerror)ÚdeleteÚedit)Úhermes_cli.journeyrŸ   ÚargparseÚArgumentParserÚ
parse_argsÚshlexÚsplitÚ
SystemExitra   ÚfuncÚforce_colorÚior   r   r   ÚgetvalueÚrstriprd   r;   )rt   rœ   rŸ   Úparserrf   ÚbufÚexcs   &&     r   Ú_handle_journey_commandÚ4CLICommandsSessionToolsMixin._handle_journey_command˜   sú   € õ 	4Ü×(Ò(¨jÀ5ÔIˆÙ�VÔð	Ø×$Ñ$¤U§[¢[°Ó%>¸rÕ%BÓCˆDð
	8Ü�tÐ-¨tÓ4Ð8JÔJØ—	‘	˜$”ÙØ#ˆDÔÜ—+’+“-ˆCÜ  ×%Õ%Ø—	‘	˜$”÷ &ä�—‘“×%Ñ% dÓ+Ö,øô ô 	Úð	ú÷ &×%ûô ô 	8Ü�"”RÐ(°Ô4Ð5Ð6×7Ò7ûð	8úsG   ¨,C- Á#D Á:/D Â)C?Â;0D Ã-C<Ã;C<Ã?D	Ä
D ÄEÄD<Ä<Ec           	     ó,  € ^ RI Hp V! 4       '       g    \        \        \	        R4      4      4       R# V P                  4       '       d/   \        R\	        R\        V P                  4      R7       24       R# \        \        \	        R4      4      4       R# )uà   Handle /paste â€” explicitly check clipboard for an image.

This is the reliable fallback for terminals where BracketedPaste
doesn't fire for image-only clipboard content (e.g., VSCode terminal,
Windows Terminal with WSL2).
)Úhas_clipboard_imagezpaste.no_imager,   zpaste.attached©Úindexzpaste.extract_failedN)Úhermes_cli.clipboardr¼   r   r.   r;   Ú_try_attach_clipboard_imager�   Ú_attached_images)rt   r¼   s   & r   Ú_handle_paste_commandÚ2CLICommandsSessionToolsMixin._handle_paste_command¯   sh   € õ 	=Ù"×$Ò$Ü”	œ"Ð-Ó.Ó/Ö0Ø×-Ñ-×/Ò/Ü�"”RÐ(´°D×4IÑ4IÓ0JÔKÐLÐMÖNä”	œ"Ð3Ó4Ó5Ö6r   c               ó    € V ^8„  d   QhRRRR/# r›   r   )r   s   "r   r   r�   ¾   s   € ÷ !3ñ !3°ð !3¸ñ !3r   c           	     ó@  a	a
€ ^ RI Ho	 \        V4      pV P                   Uu. uF  q3P	                  R4      R8X  g   K  VNK  	  upo
S
'       g   \        R\        R4       24      # V'       dN    \        V4      ^,
          pT^ 8  g   T\        S
4      8¼  d#   \        R\        R\        S
4      R7       24      # MP\        V	V
3R	 l\        \        S
4      ^,
          RR4       4       R4      pV^ 8  d   \        R\        R
4       24      # S	! S
V,          P	                  R4      4      pV'       g   \        R\        R4       24      #  ^ RIHpHp V! 4       '       g   V! V4      '       g4   V P                  V4       \        R\        RV^,           R7       24       R# \        R\        RV^,           R7       24       R# u upi   \         d    \        R\        R4       24      u # i ; i  \          d%   p\        R\        RTR7       24        Rp?R# Rp?ii ; i)u=   Handle /copy [number] â€” copy assistant output to clipboard.)Ú_assistant_copy_textÚroleÚ	assistantr,   zcopy.nothing_yetz
copy.usagezcopy.invalid_number)Úmaxc              3  ót   <"  € T F-  pS! SV,          P                  R 4      4      '       g   K)  Vx € K/  	  R# 5i)ÚcontentN)rX   )Ú.0ÚirÆ   rÈ   s   & €€r   Ú	<genexpr>ÚDCLICommandsSessionToolsMixin._handle_copy_command.<locals>.<genexpr>Í   s2   øé € ð NÑ#D˜aÙ/°	¸!µ×0@Ñ0@ÀÓ0K×L÷ šÓ#Dùs   ƒ&8®
8zcopy.nothing_in_responsesrË   zcopy.nothing_in_response)Úis_remote_shell_sessionÚwrite_clipboard_textzcopy.copied_osc52r½   zcopy.copiedzcopy.failedr¦   Néÿÿÿÿ)r   rÆ   Ú_command_argÚconversation_historyrX   r   r;   r>   Ú
ValueErrorr�   ÚnextÚranger¿   rÐ   rÑ   Ú_write_osc52_clipboardrd   )rt   rœ   ÚargÚmÚidxr%   rÐ   rÑ   ÚerÆ   rÈ   s   &&       @@r   Ú_handle_copy_commandÚ1CLICommandsSessionToolsMixin._handle_copy_command¾   sæ  ù€ å,Ü˜<Ó(ˆØ $× 9Ò 9ÓZÑ 9˜1¿U¹UÀ6»]ÈkÑ=Y—Q�QÑ 9ÑZˆ	ßÜ˜œBÐ1Ó2Ð3Ð4Ó5Ð5ßð4Ü˜#“h •l�ð �QŒw˜#¤ Y£Ô/Ü˜R¤Ð#8¼cÀ)»nÔ MÐNÐOÓPÐPð 0ô õ N¤5¬¨Y«¸!Õ);¸RÀÔ#Dó NØOQóSˆCà�QŒwÜ˜R¤Ð#>Ó ?Ð@ÐAÓBÐBÙ# I¨c¥N×$6Ñ$6°yÓ$AÓBˆßÜ˜œBÐ9Ó:Ð;Ð<Ó=Ð=ð	3ßZñ '×(Ò(Ñ0DÀT×0JÒ0Jà×+Ñ+¨DÔ1Ü�bœÐ/°s¸QµwÔ?Ð@ÐAÖBä�bœ˜M°°qµÔ9Ð:Ð;Ö<ùò7 [øô ô 4Ü˜R¤ <Ó 0Ð1Ð2Ó3Ò3ð4ûô, ô 	3Ü�"”R˜¨QÔ/Ð0Ð1×2Ò2ûð	3úsF   ¢G¾GÁ/G Å	G. ÅG. Å,1G. Æ G. Ç"G+Ç*G+Ç.HÇ9HÈHc               ó   € V ^8„  d   QhRR/# )r	   rœ   r   r   )r   s   "r   r   r�   á   s   € ÷ Uñ U°#ñ Ur   c           	     ó�  € ^ RI HpHpHpHpHpHp RV9   d(   VP                  R^4      ^,          P                  4       MRpV'       g   Rp	V! RV \        RV	R7       V 24       R# V! V4      w  r«V! V
4      pVf    \        \        \        R	V
R
7      4      4      # VP                  P                  4       V9  d*   \        \        \        RVP                  R7      4      4      # V P                  P!                  V4       \        R\        RVP                  R7       24       V'       d   V! RV \        RVR7       V 24       R# R# )uG   Handle /image <path> â€” attach a local image file for the next prompt.)r'   Ú_IMAGE_EXTENSIONSr(   r   Ú_resolve_attachment_pathÚ_split_path_inputÚ NrK   z/path/to/image.pngr,   zimage.usage)Úexamplezimage.not_found)Úpathzimage.unsupportedro   zimage.attachedzimage.now_type_promptr-   )r   r'   rá   r(   r   râ   rã   r¯   Ústripr;   r   r.   ÚsuffixÚlowerr_   rÁ   Úappend)rt   rœ   r'   rá   r(   r   râ   rã   Úraw_argsÚhintÚ
path_tokenÚ
_remainderÚ
image_paths   &&           r   Ú_handle_image_commandÚ2CLICommandsSessionToolsMixin._handle_image_commandá   s  € çk×kØ>AÀ\Ô>Q�L×&Ñ& t¨QÓ/°Õ2×8Ñ8Ô:ÐWYˆßØ'ˆDÙ�b˜˜œr -¸Ô>Ð?À¸vÐFÔGÙá!2°8Ó!<Ñˆ
Ù-¨jÓ9ˆ
ØÒÜ”y¤Ð$5¸JÔ!GÓHÓIÐIØ×Ñ×"Ñ"Ó$Ð,=Ô=Ü”y¤Ð$7¸j¿o¹oÔ!NÓOÓPÐPØ×Ñ×$Ñ$ ZÔ0Üˆb”Ð$¨:¯?©?Ô;Ð<Ð=Ô>ßÙ�b˜˜œrÐ"9À
ÔKÐLÈTÈFÐSÖTñ r   c               ó   € V ^8„  d   QhRR/# ©r	   Úcmdr   r   )r   s   "r   r   r�   ö   s   € ÷ -ñ -¨ñ -r   c           
     ól  € \        V4      pV'       d
   V^ ,          MRpVR9  d   V P                  4       # VR8X  d   V P                  RRR7      # VR,          pV'       g5   \        \	        RVR7      R	\	        R
VR7       2R	\	        RVR7       24      # \        \        \	        VR8X  d   RMRRP                  V4      R7      4      4       V P                  W4RR7       ^ RIH	p ^ RI
Hp \        V! V! 4       R4      4      V n        V P                  4        \        \        \	        R4      4      4       R# )zëHandle /tools [list|disable|enable]. Bare shows the tool list; ``list`` shows per-toolset
status; disable/enable save to config and reset the session so the new tool set takes
effect cleanly (no prompt-cache breakage mid-conversation).rK   rI   Údisabler   )Útools_actionÚplatformr¢   ztools.usage)Ú
subcommandr,   ztools.example_toolsetztools.example_mcpztools.disablingztools.enablingz, )Únames)r÷   rú   rø   )Ú_get_platform_tools)Úload_configztools.session_resetN>   rI   Úenablerö   )Ú_shlex_argsÚ
show_toolsÚ_run_tools_configr   r;   r   r2   ÚjoinÚhermes_cli.tools_configrû   Úhermes_cli.configrü   ÚsortedÚenabled_toolsetsÚnew_sessionr)   )rt   rô   Úpartsrù   rú   rû   rü   s   &&     r   Ú_handle_tools_commandÚ2CLICommandsSessionToolsMixin._handle_tools_commandö   s  € ô ˜CÓ ˆß!&�U˜1–X¨Bˆ
ØÐ:Ô:Ø—?‘?Ó$Ð$Ø˜ÔØ×)Ñ)°vÈÐ)ÓNÐNØ�b•	ˆßÜ”r˜-°JÔ?ØœBÐ6À:ÔNÐOÐPØœBÐ2¸zÔJÐKÐLóNð Nô 	ŒG”B¨J¸)Ô,CÑ(ÐIYØ!ŸY™Y uÓ-ô/ó 0ô 	1à×Ñ¨JÈeÐÔTÝ?Ý1Ü &Ñ':¹;»=È%Ó'PÓ QˆÔØ×ÑÔÜŒD”Ð)Ó*Ó+Ö,r   c               ó   € V ^8„  d   QhRR/# ©r	   r   r   r   )r   s   "r   r   r�     s   € ÷ *ñ *¨ñ *r   c           	     ó0  € ^ RI Hp ^ RIHp \	        V RR4      f   V! V! R/ VB 4      # \        4       p\        V4      ;_uu_ 4        V! V! R/ VB 4       RRR4       \        VP                  4       P                  4       !   R#   + '       g   i     L7; i)a
  Run ``tools_disable_enable_command``. Inside the interactive TUI its ANSI print() output
is captured (isatty=True so colors still render) and re-emitted through _cprint so
patch_stdout's StdoutProxy doesn't garble the escapes; standalone/tests call straight through.)Ú	Namespace)Útools_disable_enable_commandÚ_appNr   )
r«   r  r  r  ra   Ú_TTYBufr   r   r´   rL   )rt   Únsr  r  r·   s   &,   r   r   Ú.CLICommandsSessionToolsMixin._run_tools_config  so   € õ 	'ÝHÜ�4˜ Ó&Ò.Ù/±	±¸B±Ó@Ð@Ü‹iˆÜ˜S×!Õ!Ù(©©°R©Ô9÷ "äˆS�\‰\‹^×&Ñ&Ó(Ô)÷ "×!ús   ÁBÂB	c               ó   € V ^8„  d   QhRR/# ró   r   )r   s   "r   r   r�     s   € ÷ qñ q¨Sñ qr   c                óŠ   € ^ RI HpHp \        V! RV! RVP	                  R4      ^,          R7      4      P
                  4       R# )uF   /autoprune [on|off|later|status] â€” the low-disk auto-prune decision.©ÚCommandContextÚexecute_commandÚ	autopruner   rä   )Úsurfacerf   N)Úhermes_cli.slash_execr  r  Ú
_say_blockÚ	partitionr%   )rt   rô   r  r  s   &&  r   Ú_handle_autoprune_commandÚ6CLICommandsSessionToolsMixin._handle_autoprune_command  s4   € çIÜ‘? ;±ÀuÐSV×S`ÑS`ÐadÓSeÐfgÕShÔ0iÓj×oÑoÖpr   c           	     óÊ   € ^ RI HpHp V! RV! RR7      4      p\        R\	        RVP
                  R,          R7       2R\	        RVP
                  R	,          R
7       24       R# )z/Display active profile name and home directory.r  Úprofiler   )r  r,   zprofile.profile)r   zprofile.homeÚhome)r!  N)r  r  r  r  r;   Údata)rt   r  r  Úreplys   &   r   Ú_handle_profile_commandÚ4CLICommandsSessionToolsMixin._handle_profile_command!  sU   € çIÙ 	©>À%Ô+HÓIˆÜ�RœÐ,°e·j±jÀÕ6KÔLÐMÐNØœ˜>°·
±
¸6Õ0BÔCÐDÐEö	Gr   )r  N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ru   r˜   r¹   rÂ   rÝ   rð   r  r   r  r$  Ú__static_attributes__r   r   r   ri   ri   g   s@   † ñ@ò
Mò$]õ28ò.7õ!3õFUõ*-õ2*õqö
Gr   ri   c               ó   € V ^8„  d   QhRR/# r  r   )r   s   "r   r   r   )  s   € ÷ Jñ J˜tñ Jr   c            
     ó–  € ^ RI Hp Hp V ! 4       V! 4       r2Ve   VP                  RR7       VP	                  4        Uu. uF  qDP                  R4      R8X  g   K  VNK  	  ppVe   VP                  4       M\        RR^ 4      pV'       g    V'       g   \        R	\        R
4       24      # V'       dL   \        R	\        R\        V4      R7       24       \        R	\        RVP                  RR7      R7       24       V'       d@   Ve   VP                  4       pM^ RIHp V! RR7      p\        R	\        RVR7       24       R# R# u upi )zý``/stop``'s cleanup: kill the background processes, then interrupt the background (async)
delegations. Mid-turn it runs on a worker thread, so it prints through ``_cprint``: a plain
print() from off the input loop is buried by the prompt_toolkit redraw.rx   NTr|   r~   r   útools.async_delegationÚactive_countr,   zstop.none_runningzstop.stoppingr€   zstop.stoppedzcli.stop)Úsource)Úinterrupt_allz/stop)Úreasonzstop.interrupted_delegations)r‰   ry   rz   r‹   rŒ   rX   r�   rg   r   r;   r�   Úkill_allÚinterrupt_delegationsÚtools.async_delegationr1  )	r�   rz   ry   r‘   r“   r   r–   Úinterruptedr1  s	            r   rp   rp   )  s   € ÷ UÙ&›[©,«.�dØÒØ�‰˜4ˆÔ Ø*×8Ñ8Ô:Ó[Ñ:�Q¿e¹eÀH»oÐQZÑ>Z�qˆqÑ:€GÐ[à+/Ò+;ˆd×%Ñ%Ô'ÄÐH`ÐbpÐrsÓAt€GßŸ7Ü�RœÐ.Ó/Ð0Ð1Ó2Ð2ßÜˆb”�O¬3¨w«<Ô8Ð9Ð:Ô;Üˆb”�NÐ*:×*CÑ*CÈ:Ð*CÓ*VÔWÐXÐYÔZßØÒØ×4Ñ4Ó6‰Kå<Ù'¨wÔ7ˆKÜˆb”Ð2¸+ÔFÐGÐHÖIñ ùò \s   ¾EÁEc               ó$   € V ^8„  d   QhRRRRRR/# )r	   rO   rP   Ú	stat_onlyr   r   r   r   )r   s   "r   r   r   B  s&   € ÷ kñ k Dð k°Tð k¸dñ kr   c           	     ób  € VP                  R4      '       g1   \        RVP                  R4      ;'       g    \        R4       24      # VP                  RR4      VP                  RR4      rCVP                  R4      '       g   V'       g    V'       g   \        R\        R	4       24      # V'       d   V P                  R
V 24       V'       g   VP                  R4      '       dL   V'       gB   T P	                  T\        R4      \        VP                  R4      ;'       g    ^ 4      R7       R# R# R# )zÁRender a ``CheckpointManager.session_diff`` result (``/diff session``): this process's agent's,
or the gateway session's ``rollback.session_diff`` (``diff_lines``: its uncut body's line count).Úsuccessr,   r§   zshared.could_not_generate_diffÚstatrK   ÚdiffÚemptyzdiff.no_session_changesr¥   Ú
diff_lineszdiff.stat_hint_session)ÚtotalN)rX   r   r;   Ú_print_diff_textÚ_print_diff_bodyr>   )r   rO   r8  r;  r<  s   &&&  r   Úprint_session_diffrB  B  së   € ð �:‰:�i× Ò Ü�r˜&Ÿ*™* WÓ-×UÐU´Ð4TÓ1UÐVÐWÓXÐXØ—‘˜F BÓ'¨¯©°F¸BÓ)?ˆ$Ø‡z�z�'×Ò§4·Ü�rœ"Ð6Ó7Ð8Ð9Ó:Ð:ßØ×Ñ˜r $ ˜[Ô)ß�—
‘
˜<×(Ò(·)Ø×Ñ˜T¤2Ð&>Ó#?ÄsÈ6Ï:É:ÐVbÓKc×KhÐKhÐghÓGiÐÖjñ 3<Ñ(r   c               ó   € V ^8„  d   QhRR/# r  r   )r   s   "r   r   r   P  s   € ÷ ñ  $ñ r   c                 ó"  € \        RR. 4      p V '       g   R# V  Uu. uF  qP                  R4      R"9   g   K  VNK  	  pp\        R\        R\	        V4      R	7       24       V  EF¡  pVP                  RR
4      pRVP                  RR
4       RT RVP                  R4      ;'       g    RR,           2pVR8X  d-   VP                  R4      pVe   V\        RVR R7      ,          pM9VR8X  d3   VP                  R4      pVe   V^<8¼  d   V\        RVR R7      ,          p\        V4       \        VP                  R4      ;'       g    . 4       F±  w  rg\        V\        4      '       g   K  VP                  R4      pV'       d   \        RVR7      M
\        R4      p	R\        RV^,           VP                  RR
4      V	R7      ,           p
VP                  R 4      pVe   V
\        R!VR R7      ,          p
\        V
4       K³  	  EK¤  	  R# u upi )#uQ   This process's background (async) delegations â€” delegate_task(background=true).r.  Úlist_async_delegationsNr~   r   Ústallingr,   rˆ   r€   r„   r‚   Údelegation_idr…   ÚgoalrK   :Né<   NÚstalled_after_quiet_secondszagents.no_progressz.0f)ÚsecondsÚseconds_since_progresszagents.quietÚchildren_activityÚcurrent_toolzagents.in_tool)Útoolzagents.between_turnsz      zagents.child_lineÚ	api_calls)r¾   rP  ÚdoingÚseconds_since_activityzagents.last_activity)r   rF  )rg   rX   r   r;   r�   Ú	enumerateÚ
isinstancerP   )ÚdelegationsÚdÚ	running_dr~   r   ÚquietrÍ   ÚchildrO  rQ  ÚpartÚidles               r   rŽ   rŽ   P  sà  € äÐ1Ð3KÈRÓP€KßÙÙ'ÓV™K�q¯5©5°«?Ð>UÑ+U—�™K€IÐVÜˆ"ŒRÐ/´s¸9³~ÔFÐGÐHÔIÜˆØ—‘�x Ó%ˆØ�a—e‘e˜O¨SÓ1Ð2°$°v°h¸dÀAÇEÁEÈ&ÃM×DWÐDWÐUWÐY\ÕC]ÐB^Ð_ˆð �ZÔØ—E‘EÐ7Ó8ˆEØÒ ØœÐ/¸EÀ#¸;ÔHÕH�øØ�yÔ Ø—E‘EÐ2Ó3ˆEØÒ  U¨b¤[Øœ˜>°e¸C°[ÔBÕB�ÜˆDŒ	Ü! !§%¡%Ð(;Ó"<×"BÐ"BÀÖC‰HˆAÜ˜e¤T×*Ò*ÙØ—9‘9˜^Ó,ˆDß7;”BÐ'¨dÕ3ÄÐDZÓA[ˆEØœbÐ!4¸AÀ½EØ+0¯9©9°[À#Ó+FÈeôUõ UˆDà—9‘9Ð5Ó6ˆDØÒØœÐ1¸dÀ3¸ZÔIÕI�Ü�ŽIô Dó ùò Ws
   œH¸Hc                  ó&   € ] tR tRtRtR R ltRtR# )r  ir  z[StringIO that claims to be a TTY so ``hermes_cli.colors.color()`` still emits ANSI escapes.c               ó   € V ^8„  d   QhRR/# )r	   r   r   r   )r   s   "r   r   Ú_TTYBuf.__annotate__t  s   € ÷ ñ ˜ñ r   c                	ó   € R # )Tr   )rt   s   &r   ÚisattyÚ_TTYBuf.isattyt  s   € Ùr   r   N)r&  r'  r(  r)  r*  r`  r+  r   r   r   r  r  r  s   † Ùe÷ñ r   r  c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r   x  s   € ÷ ñ �sð ˜tñ r   c                 ó$   € \        R.V ORN5!   R# )zUprint() the lines framed by a blank line above and below (the /browser output style).rK   N)r   )r
   s   *r   r  r  x  s   € äˆÐˆUÐ�BÖr   ré   Fc               ó$   € V ^8„  d   QhRRRRRR/# )r	   rô   r   ré   r   r   r   )r   s   "r   r   r   }  s!   € ÷ )ñ )�cð ) Tð )°cñ )r   c               óÜ   € T ;'       g    RP                  4       P                  R^4      p\        V4      ^8”  d   V^,          P                  4       MRpV'       d   VP                  4       # T# )zJEverything after the slash-command word, stripped (optionally lowercased).rK   N)rç   r¯   r�   ré   )rô   ré   r  rÙ   s   &$  r   rÓ   rÓ   }  sR   € à�YˆY�B×ÑÓ×%Ñ% d¨AÓ.€EÜ! %›j¨1œnˆ%��(�.‰.Ô
°"€Cßˆ3�9‰9‹;Ð( SÐ(r   c               ó    € V ^8„  d   QhRRRR/# )r	   rô   r   r   rI   r   )r   s   "r   r   r   „  s   € ÷ 'ñ '�Sð '˜Tñ 'r   c                ó¶   €  V '       d   \         P                  ! V 4      R,          # . #   \         d%    T ;'       g    RP                  4       R,          u # i ; i)zSTokens after the command word; falls back to whitespace split on unbalanced quotes.r¢   rK   )r®   r¯   rÕ   )rô   s   &r   rþ   rþ   „  sK   € ð'ß'*Œu�{Š{˜3Ó Õ#Ð2°Ð2øÜô 'Ø—	�	�r× Ñ Ó" 2Õ&Ò&ð'ús   ‚) Š) §) ©A½AÁA)r,   )!r*  Ú
__future__r   r«   rb   r³   r®   Ú
contextlibr   r   Ú
agent.i18nr   r   r   r"   r)   r.   r2   r5   r;   rC   rF   rM   r\   rg   ri   rp   rB  rŽ   r  r  rÓ   rþ   r   r   r   Ú<module>rk     s«   ðñõ #ã Û Û 	Û Ý &Ý å õõõ)õ!õõ
$õ õ
.õ
Rõ
)÷
Jõ
Uõ÷Gñ GõDJõ2kõôDˆhô õð
)¨E÷ )÷'r   