+
    „WÝjÔ;  ã                  óô   € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHt ]P                  ! ]	4      t
Rt^<tRs ! R R4      t ! R R4      t ! R	 R
4      t ! R R4      tR tR tR tR tR tR tR tR tRR ltR# )u[  The background-process registry main's classic CLI reads, served by the gateway session.

On main the CLI process ran every ``terminal(background=true)`` itself, so the live-work dock,
the status bar's ``âš™ N`` segment, ``/stop`` and the dock's tail view read
``tools.process_registry`` in-process. Rewired, the processes run in the gateway: this view
answers the same calls (``list_sessions`` / ``get`` / ``count_running`` / ``kill_process`` /
``kill_all``) from the session's ``process.list`` / ``process.kill`` / ``process.stop`` verbs, so
main's dock and command code render unchanged.

Polling: the dock ticks once a second. The view only asks the gateway while it has a reason to
(a tool finished since the last poll, or a listed process is still running or recently
exited); the status bar reads the cached count and never blocks a repaint on an RPC.
)ÚannotationsN)ÚGatewayClientErrorg      ð?c                  ó    € ] tR t^tRtR tRtR# )Ú_Procz4The ``ProcessSession`` attributes main's dock reads.c                	ó  € VP                  R 4      ;'       g    RV n        VP                  R4      ;'       g    RV n        VP                  R4      V n        \	        VP                  R4      ;'       g    R4      V n        \	        VP                  R4      ;'       g    R4      V n        VP                  R4      ;'       g    RV n        VP                  R4      ;'       g    R	V n        VP                  R
4      R	8H  V n	        R# )Ú
session_idÚ ÚcommandÚ	exit_codeÚstarted_epochç        Ú	exited_atÚoutput_tailÚcompletion_reasonÚexitedÚstatusN)
ÚgetÚidr	   r
   ÚfloatÚ
started_atr   Úoutput_bufferr   r   )ÚselfÚrows   &&ÚLC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\gateway_tools.pyÚ__init__Ú_Proc.__init__"   sÄ   € Ø—'‘'˜,Ó'×-Ð-¨2ˆŒØ—w‘w˜yÓ)×/Ð/¨RˆŒØŸ™ Ó-ˆŒÜ §¡¨Ó 8× ?Ð ?¸CÓ@ˆŒÜ˜sŸw™w {Ó3×:Ð:°sÓ;ˆŒØ ŸW™W ]Ó3×9Ð9°rˆÔØ!$§¡Ð)<Ó!=×!IÐ!IÀˆÔØ—g‘g˜hÓ'¨8Ñ3ˆŽó    )r	   r   r
   r   r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__© r   r   r   r      s
   † Ù>ö4r   r   c                  óš   € ] tR t^-tR t]R 4       tR tR tRR/R lt	R t
R	 tR
 tR tR tR tR t]3R ltR tRR/R ltRR ltRtR# )ÚGatewayProcessViewc                	ó  € Wn         VP                  V n        . V n        R V n        ^ V n        RV n        \        P                  ! 4       V n        . V n	        RV n
        RV n        \        P                  ! 4       V n        RV n        RV n        R# )Tr   N)ÚagentÚ
connectionÚrowsÚdirtyÚdelegationsÚ_polledÚ	threadingÚLockÚ_lockÚ	subagentsÚ_subagents_polledÚ_subagents_seenÚ_subagents_lockÚ_tailÚ_subagents_watch_until)r   r'   s   &&r   r   ÚGatewayProcessView.__init__.   st   € ØŒ
Ø×*Ñ*ˆŒØˆŒ	ØˆŒ
ØˆÔØˆŒÜ—^’^Ó%ˆŒ
Ø!ˆŒØ!$ˆÔØ"ˆÔÜ(Ÿ~š~Ó/ˆÔØˆŒ
Ø&)ˆÖ#r   c                	ó.   € V P                   P                  # ©N)r'   r   ©r   s   &r   r   ÚGatewayProcessView.session_id=   s   € à�z‰z×$Ñ$Ð$r   c                	ó   € R V n         R# )TN)r*   r9   s   &r   Ú
mark_dirtyÚGatewayProcessView.mark_dirtyB   s	   € ØˆŽ
r   c                	ó    a€ \         ;QJ d)    V3R  lV P                   4       F  '       g   K   R# 	  R# ! V3R  lV P                   4       4      # )c              3  ó°   <"  € T FK  qP                   '       * ;'       g/    VP                  ;'       d    SVP                  ,
          \        8*  x € KM  	  R # 5ir8   )r   r   Ú_RETAIN_SECONDS)Ú.0ÚpÚnows   & €r   Ú	<genexpr>Ú2GatewayProcessView._interesting.<locals>.<genexpr>F   s=   øé € ÐmÑclÐ^_—x‘x”<×YÐY A§K¡K×$XÐ$X°C¸!¿+¹+Õ4EÌÑ4XÔYÓclùs   ƒAŸA³#ATF)Úanyr)   )r   rC   s   &fr   Ú_interestingÚGatewayProcessView._interestingE   s:   ø€ ß‹sÔmÐcg×clÒclÓm�sŒsÐmŠsÐmˆsÔmÐcg×clÒclÓmÓmÐmr   ÚforceFc               	óê  € \         P                   ! 4       pV'       gG   W P                  ,
          \        8  g*   V P                  '       g   V P	                  V4      '       g   R # V P
                  P                  RR7      '       g   R #  W n        RV n        V P                  P                  RV P                  ^R7      pT;'       g    / P                  R4      ;'       g    .  Uu. uF  p\        V4      NK  	  upV n        V P
                  P#                  4        R # u upi   \        \        3 d!   p\        P!                  RT4        R p?LMR p?ii ; i  T P
                  P#                  4        i ; i)NF©Úblockingzprocess.list©r   ÚtimeoutÚ	processeszprocess.list failed: %s)Útimer,   Ú_POLL_SECONDSr*   rG   r/   Úacquirer(   Úcallr   r   r   r)   r   ÚRuntimeErrorÚloggerÚdebugÚrelease)r   rI   rC   Úresultr   Úexcs   &$    r   ÚrefreshÚGatewayProcessView.refreshH   s  € Ü�iŠi‹kˆß˜#§¡Õ,¬}Ô<ÀTÇZÇZÀZÐSW×SdÑSdÐeh×SiÒSiÙØ�z‰z×!Ñ!¨5Ð!×1Ò1Ùð	!ØŒLØˆDŒJØ—_‘_×)Ñ)¨.ÀTÇ_Á_Ð^_Ð)Ó`ˆFØ06·°¸"×/AÑ/AÀ+Ó/N×/TÐ/TÐRTÐ/TÓUÑ/T¨œ˜sžÑ/TÑUˆDŒIð �J‰J×ÑÖ ùò	 VøÜ"¤LÐ1ô 	9Ü�L‰LÐ2°C×8Ñ8ûð	9ûð �J‰J×ÑÕ úsC   Â	AD" Ã D" Ã%DÃ9D" ÄD" Ä"EÄ3EÅ	E ÅEÅE ÅE2c                	ó®  € V P                  4        \        P                  ! 4       pV P                   Uu. uF•  pR VP                  RVP                  R,          RVP
                  '       d   RMRRVP                  RVP
                  '       d   VP                  MRR	VP                  '       d   \        WP                  ,
          4      M^ /NK—  	  up# u upi )
r   r	   :NéÈ   Nr   r   Úrunningr
   r   NÚuptime_seconds)
rZ   rP   r)   r   r	   r   r
   r   r   Úint)r   rC   rB   s   &  r   Úlist_sessionsÚ GatewayProcessView.list_sessionsY   s²   € Ø�‰ŒÜ�iŠi‹kˆð ]a×\eÒ\eógñ ]fÐWXð ˜qŸt™t Y°·	±	¸$µØ q§x§x x™8°YÀÈQÏ[É[Ø$¸Q¿X¿X¸X a×&9Ò&9È4Ø!¸a¿l¿l¸l¤3 s¯\©\Õ'9Ô#:ÐPQóSñ ]fñgð 	gùò gs   ´6CÁ+!CÂCÂ-"Cc                	óD   a€ \        V3R  lV P                   4       R4      # )c              3  óL   <"  € T F  qP                   S8X  g   K  Vx € K  	  R # 5ir8   )r   )rA   rB   Ú
process_ids   & €r   rD   Ú)GatewayProcessView.get.<locals>.<genexpr>b   s   øé € Ð@¡	˜1¯T©T°ZÑ-?—Q’Q£	ùs   ƒ$š
$N)Únextr)   )r   re   s   &fr   r   ÚGatewayProcessView.geta   s   ø€ ÜÔ@ §	¢	Ó@À$ÓGÐGr   c                ó:   € \        R V P                   4       4      # )z7Cached (the status bar repaints off the render thread).c              3  óL   "  € T F  qP                   '       d   K  ^x € K  	  R# 5i)é   N)r   )rA   rB   s   & r   rD   Ú3GatewayProcessView.count_running.<locals>.<genexpr>f   s   é € Ð8™i˜¯x­x—1’1›iùs   ‚$š
$)Úsumr)   r9   s   &r   Úcount_runningÚ GatewayProcessView.count_runningd   s   € äÑ8˜dŸišiÓ8Ó8Ð8r   c                	óÊ   €  V P                   P                  R V P                  VR7      pT P                  RR7       T#   \         d   pRRR\	        T4      /u Rp?# Rp?ii ; i)zprocess.kill)r   re   r   ÚerrorNT©rI   )r(   rS   r   r   ÚstrrZ   )r   re   Ú_kwrX   rY   s   &&,  r   Úkill_processÚGatewayProcessView.kill_processh   sa   € ð	:Ø—_‘_×)Ñ)¨.ÀTÇ_Á_ÐakÐ)ÓlˆFð 	�‰˜4ˆÔ Øˆøô "ô 	:Ø˜g w´°C³Ð9Õ9ûð	:ús   ‚(> ¾A"Á	AÁA"ÁA"c                ó"  € V P                   P                  RV P                  R7      ;'       g    / p\        VP	                  R4      ;'       g    ^ 4      V n        V P                  RR7       \        VP	                  R4      ;'       g    ^ 4      # )zZ``/stop``: the session's own processes plus its background delegations (``process.stop``).zprocess.stop©r   r+   Trr   Úkilled)r(   rS   r   r`   r   r+   rZ   )r   rt   rX   s   &, r   Úkill_allÚGatewayProcessView.kill_allp   sp   € à—‘×%Ñ% nÀÇÁÐ%ÓQ×WÐWÐUWˆÜ˜vŸz™z¨-Ó8×=Ð=¸AÓ>ˆÔØ�‰˜4ˆÔ Ü�6—:‘:˜hÓ'×,Ð,¨1Ó-Ð-r   c                óš   € V P                   '       d   V P                   ^ uqn         V# V P                  4        V P                   ^ uqn         V# )zXThe delegation half of ``/stop`` (``kill_all`` already ran it when processes were live).)r+   rz   )r   Úcounts   & r   Úinterrupt_delegationsÚ(GatewayProcessView.interrupt_delegationsw   sG   € à××ÐØ&*×&6Ñ&6¸Ð#ˆEÔ#ØˆLØ�‰ŒØ"&×"2Ñ"2°AÐˆÔØˆr   c                óð   €  V P                   P                  V P                  4      P                  ;'       g    / pTP                  R4      p\        T\        4      '       d   T# ^ #   \         d     ^ # i ; i)zPRunning background subagents (the gateway's ``session.usage.active_subagents``).Úactive_subagents)r(   Ústater   ÚusageÚ	Exceptionr   Ú
isinstancer`   )r   rƒ   Úvalues   &  r   Úactive_delegationsÚ%GatewayProcessView.active_delegations€   si   € ð	Ø—O‘O×)Ñ)¨$¯/©/Ó:×@Ñ@×FÐFÀBˆEð —	‘	Ð,Ó-ˆÜ" 5¬#×.Ò.ˆuÐ5°AÐ5øô ô 	Úð	ús   ‚5A& ¸A& Á&A5Á4A5c                óV   € \         P                   ! 4       V,           V n        RV n        R# )zžPoll ``subagent.list`` for a while even with no turn running: an off-turn spawn
(``/review``) moves neither ``busy`` nor the usage count the gate below reads.r   N)rP   r5   r1   )r   Úsecondss   &&r   Úwatch_subagentsÚ"GatewayProcessView.watch_subagentsŠ   s   € ô '+§i¢i£k°GÕ&;ˆÔ#Ø!$ˆÖr   c               ó€  € \         P                   ! 4       pT;'       g;    V P                  ;'       g'    W P                  8  ;'       g    V P                  4       pV'       dÀ   W P                  ,
          \
        8¼  d¥   V P                  P                  RR7      '       dƒ    W n        V P                  P                  RV P                  ^R7      p\        T;'       g    / P                  R4      ;'       g    . 4      V n        W n        V P                  P'                  4        V P                   Uu. uF  p\)        V4      NK  	  up#   \        \        3 dC   p\         P#                  RT4       Y P                  ,
          \$        8”  d   . T n         Rp?L�Rp?ii ; i  T P                  P'                  4        i ; iu upi )zÖThe session's live children (``subagent.list``). Asks at most once a second, and only
while a turn runs (``busy``), children were listed last time, the gateway counts some, or
an off-turn spawn asked to be watched.FrK   zsubagent.listrM   r0   zsubagent.list failed: %sN)rP   r0   r5   r‡   r1   rQ   r3   rR   r(   rS   r   Úlistr   r2   r   rT   rU   rV   r@   rW   Údict)r   ÚbusyrC   ÚwantedrX   rY   r   s   &$     r   Úsubagent_rowsÚ GatewayProcessView.subagent_rows�   s\  € ô �iŠi‹kˆØ÷ /ð /˜$Ÿ.™.÷ /ð /¨C×2MÑ2MÑ,M÷ /ð /Ø×,Ñ,Ó.ð 	ç�c×2Ñ2Õ2´mÔCÈ×H\ÑH\×HdÑHdÐnsÐHd×HtÒHtð
/Ø),Ô&ØŸ™×-Ñ-¨oÈ$Ï/É/ÐcdÐ-Óe�Ü!% v§| |°×&8Ñ&8¸Ó&E×&KÐ&KÈÓ!L�”Ø'*Ô$ð ×$Ñ$×,Ñ,Ô.Ø%)§^¢^Ó4¡^˜c”�S–	¡^Ñ4Ð4øô '¬Ð5ô (Ü—‘Ð7¸Ô=Ø×-Ñ-Õ-´Ô?Ø%'�D”Nÿøð(ûð
 ×$Ñ$×,Ñ,Õ.üÚ4s7   Â AE Ã5E Ä/F;ÅFÅ8FÆF ÆFÆF ÆF8Úfetchc               óˆ  € \         P                   ! 4       pV P                  '       d%   V P                  ^ ,          V8X  d   V P                  MRpV'       d!   V'       d,   W4^,          ,
          \        8  d   V'       d
   V^,          # R#  V P                  P	                  RV P
                  V^R7      ;'       g    / pVP                  R4      '       d   VP                  R4      MRpVe   RP                  R V 4       4      pYT3T n        T#   \        \        3 d#   p\        P                  RT4       Rp Rp?L9Rp?ii ; i)	a  The child's live transcript tail (``subagent.tail``); None when the gateway has none.
The detail view repaints every frame and reads only the cache; ``fetch`` (the monitor's
tick, on the spinner thread) asks the gateway at most once a second, failures included.Nzsubagent.tail©r   Úsubagent_idrN   Ú	availableÚtextr   c              3  ób   "  € T F%  qP                  4       '       g
   VR 9   g   K!  Vx € K'  	  R# 5i)z
	N)Úisprintable)rA   Úcs   & r   rD   Ú3GatewayProcessView.subagent_tail.<locals>.<genexpr>²   s    é € ÐQ©$ Q·-±-·/²/ÀQÈ&Á[Ÿqšq«$ùs   ‚/¥
/zsubagent.tail failed: %s)rP   r4   rQ   r(   rS   r   r   Újoinr   rT   rU   rV   )r   r—   r”   rC   ÚcachedrX   r™   rY   s   &&$     r   Úsubagent_tailÚ GatewayProcessView.subagent_tail¥   s	  € ô �iŠi‹kˆØ#ŸzŸz˜z¨d¯j©j¸­m¸{Ô.J�—’ÐPTˆßŸ C°­)¥O´mÔ$Cß &�6˜!•9Ð0¨DÐ0ð	Ø—_‘_×)Ñ)¨/ÀdÇoÁoØ6AÈ1ð *ó N÷ Tð TØQSð à)/¯©°K×)@Ò)@�6—:‘:˜fÔ%ÀdˆDØÒØ—w‘wÑQ©$ÓQÓQ�ð "¨Ð-ˆŒ
Øˆøô	 #¤LÐ1ô 	Ü�L‰LÐ3°SÔ9Ø�Dûð	ús$   Â
/D Â:D Ã/D ÄEÄD<Ä<ENc                ó  € ^ RI Hp WA,          w  rVp VR8X  dI   V P                  P                  RV P                  W#^R7      ;'       g    / pVP                  R4      R8H  p	MNV P                  P                  RV P                  V^R7      ;'       g    / p\        VP                  R	4      4      p	 RV n	        V	'       d   RVRVRVRV/# R
VP                  VR7      /#   \         d   p
R
\        T
4      /u Rp
?
# Rp
?
ii ; i)zµSteer (``subagent.steer``) or stop (``subagent.interrupt``) one child of this session, in
the shape ``delegate_tool_registry._handle_control_action`` answers: ``note`` or ``error``.)Ú_CONTROL_OUTCOMESÚsteerzsubagent.steer)r   r—   r™   rN   r   Úqueuedzsubagent.interruptr–   Úfoundrq   Nr   Úactionr—   Únote)Úsid)Útools.delegate_tool_registryr£   r(   rS   r   r   Úboolr   rs   r1   Úformat)r   r§   r—   Úmessager£   r   r¨   ÚfailurerX   ÚokrY   s   &&&&       r   Úsubagent_controlÚ#GatewayProcessView.subagent_control¹   s  € õ 	Cà 1Õ 9Ñˆ�gð
	'Ø˜Ô ØŸ™×-Ñ-Ð.>È4Ï?É?Ø:EÐ]^ð .ó `÷ fð fØceð à—Z‘Z Ó)¨XÑ5‘àŸ™×-Ñ-Ð.BÈtÏÉØ:EÈqð .ó R÷ Xð XØUWð ä˜&Ÿ*™* WÓ-Ó.‘ð "%ˆÔßØ˜f m°[À(ÈFÐTZÐ\`ÐaÐaØ˜Ÿ™¨K˜Ó8Ð9Ð9øô "ô 	'ØœS ›XÐ&Õ&ûð	'ús/   “6C Á
C Á"/C ÂC ÃC?Ã(C:Ã4C?Ã:C?)r/   r,   r3   r1   r2   r5   r4   r'   r(   r+   r*   r)   r0   r8   )r   r   r   r    r   Úpropertyr   r<   rG   rZ   ra   r   rn   ru   rz   r~   r‡   r@   r‹   r’   r    r°   r"   r#   r   r   r%   r%   -   s|   † ò*ð ñ%ó ð%òònð!˜uô !ò"gòHò9òò.òò6ð '6ô %ò5ð*°%ô ÷(:ð :r   r%   c                  ó>   € ] tR t^ÐtRtR tR tRR/R ltR
R ltR	t	R# )ÚLocalSubagentsz³This process's own subagent registry behind the view's ``subagent_*`` surface, for a CLI that
runs its agent in-process: the dock and monitor talk to one backend shape either way.c                	ó    € Wn         / V n        R # r8   )ÚcliÚ_paths)r   r¶   s   &&r   r   ÚLocalSubagents.__init__Ô   s   € ØŒØˆŽr   c               	óÖ  € ^ RI HpHp \        V P                  RR4      pVe   V! V4      R,          M. pV'       d   V! 4        Uu/ uF  qfR,          VbK  	  upM/ pV FO  pVP                  VR,          / 4      p	V	P                  R4      V	P                  R4      ;'       g    RuVR&   VR&   KQ  	  V Uu/ uF  qˆR,          VP                  R	4      bK  	  upV n        V# u upi u upi )
é    )Ú_list_payloadÚlist_active_subagentsr'   Nr0   r—   r   Ú	last_toolr   Úlive_transcript)rª   r»   r¼   Úgetattrr¶   r   r·   )
r   r�   r»   r¼   ÚparentÚentriesÚrÚliver   Úrecords
   &$        r   r’   ÚLocalSubagents.subagent_rowsØ   sé   € ßUÜ˜Ÿ™ 7¨DÓ1ˆØ8>Ò8J‘- Ó'¨Ö4ÐPRˆ÷ JQÑ-BÔ-DÓEÑ-D¨�-Õ  !Ò#Ñ-DÒEÐVXˆÛˆCØ—X‘X˜c -Õ0°"Ó5ˆFØ28·*±*¸\Ó2JÈFÏJÉJÐWbÓLc×LiÐLiÐgiÐ/ˆC�Ñ˜s ;Ó/ñ ñ RYÓYÑQXÈ#˜=Õ)¨3¯7©7Ð3DÓ+EÒEÑQXÑYˆŒØˆùò Fùò Zs   ÁC!Â6!C&r”   Fc               	óP   € ^ RI Hp V! V P                  P                  V4      4      # )rº   )Ú	read_tail)Úhermes_cli.cli_subagent_monitorrÇ   r·   r   )r   r—   r”   rÇ   s   &&$ r   r    ÚLocalSubagents.subagent_tailå   s   € Ý=Ù˜Ÿ™Ÿ™¨Ó5Ó6Ð6r   Nc                	ór   € ^ RI p^ RIHp VP                  V! WV\	        V P
                  RR4      4      4      # )rº   N)Ú_handle_control_actionr'   )Újsonrª   rË   Úloadsr¿   r¶   )r   r§   r—   r­   rÌ   rË   s   &&&&  r   r°   ÚLocalSubagents.subagent_controlé   s3   € ÛÝGØ�z‰zÑ0°ÀgÌwÐW[×W_ÑW_ÐahÐjnÓOoÓpÓqÐqr   )r·   r¶   r8   )
r   r   r   r    r!   r   r’   r    r°   r"   r#   r   r   r´   r´   Ð   s*   † ñ]òòð7°%ô 7÷rð rr   r´   c                  ó0   € ] tR t^ïtRtR t]R 4       tRtR# )Ú_OpenedSessionz²The CLI's open gateway session before any chat agent exists (``_init_agent`` builds that on the
first turn): the view's ``connection`` and ``session_id``, following the CLI's id.c                	ó"   € WuV n         V n        R # r8   ©r¶   r(   )r   r¶   r(   s   &&&r   r   Ú_OpenedSession.__init__ó   s   € Ø$'Ð!ˆŒ�$–/r   c                	ó.   € V P                   P                  # r8   )r¶   r   r9   s   &r   r   Ú_OpenedSession.session_idö   s   € à�x‰x×"Ñ"Ð"r   rÒ   N)	r   r   r   r    r!   r   r²   r   r"   r#   r   r   rÐ   rÐ   ï   s!   † ñZò4ð ñ#ó ô#r   rÐ   c                óR   € \        V RR4      e   \        V 4      s\        # Rs\        # )z4Called when the CLI's gateway-backed agent is built.r(   N)r¿   r%   Ú_view)r'   s   &r   ÚbindrØ   û   s0   € ô *1°¸ÀdÓ)KÒ)WÔ˜uÓ%€EÜ€Lð ^b€EÜ€Lr   c                ó*   € \        \        W4      4      # )zÂCalled when the CLI opens its gateway session, so ``/agents``, ``/stop``, the dock and the status
bar read the session's processes before the first turn (a resumed session's work keeps running).)rØ   rÐ   rÒ   s   &&r   Úbind_sessionrÚ     s   € ô ”˜sÓ/Ó0Ð0r   c                 óB   € \         e   \         P                  4        R # R # r8   )r×   r<   r#   r   r   r<   r<     s   € ÜÒÜ×ÑÖñ r   c                 óV   € \         p V e   V P                  P                  '       g   V # R# )z­The gateway-backed registry, or None when this process runs its own tools (not rewired) or
its gateway connection is final (a hang-up keeps the view; its next call redials).N)r×   r(   Úfinal)Úviews    r   Úprocess_viewrß     s(   € ô €DØÒ#¨D¯O©O×,A×,AÐ,Aˆ4ÐKÀtÐKr   c                 ó2   € \        4       p V e   V # ^ RIHp V# )zV``tools.process_registry.process_registry`` for main's dock, status bar and ``/stop``.©Úprocess_registry)rß   Útools.process_registryrâ   )rÞ   Úlocals     r   râ   râ     s   € ä‹>€DØÒØˆÝ@Ø€Lr   c                 ó¬   € \        4       p V e#   RV P                  4       RV P                  4       /# ^ RIHp ^ RIHp RVP                  4       RV! 4       /# )uW   The status bar's ``âš™ N`` processes and running background subagents (cached, no RPC).Úactive_background_processesÚactive_background_subagents)Úactive_countrá   )rß   rn   r‡   Útools.async_delegationrè   rã   râ   )rÞ   rè   rä   s      r   Úbackground_countsrê     sZ   € ä‹>€DØÒØ-¨t×/AÑ/AÓ/CØ-¨t×/FÑ/FÓ/HðJð 	Jå3Ý@Ø)¨5×+>Ñ+>Ó+@ÐB_ÑamÓaoÐpÐpr   c                 óÒ  € \        4       p V f   R# V P                  P                  RV P                  R7      ;'       g    / p. / r2VP	                  R4      ;'       g    .  Fx  pVP	                  R4      ;'       g    .  FV  pVP	                  R4      W5R,          &   TP                  RRRRVR,          R	VP	                  R	4      ;'       g    R
//4       KX  	  Kz  	  W#P                  3# )zä``/tools``: the gateway session's tool catalog (``tools.show``) as
``(tools, toolset_of)``: ``get_tool_definitions``-shaped rows (first description sentence) and
a name -> toolset lookup. None when the CLI is not gateway-backed.Nz
tools.showrx   ÚsectionsÚtoolsÚnameÚtypeÚfunctionÚdescriptionr   )rß   r(   rS   r   r   Úappend)rÞ   rX   rí   Ú
toolset_ofÚsectionr   s         r   Úsession_toolsrõ   (  sÞ   € ô ‹>€DØ‚|ÙØ�_‰_×!Ñ! ,¸4¿?¹?Ð!ÓK×QÐQÈr€FØ˜Bˆ:Ø—:‘:˜jÓ)×/Ð/¨RÒ/ˆØ—;‘;˜wÓ'×-Ð-¨2Ò-ˆCØ&-§k¡k°&Ó&9ˆJ˜6•{Ñ#Ø�L‰L˜& *¨j¸6À3ÀvÅ;Ø;HÈ#Ï'É'ÐR_ÓJ`×JfÐJfÐdfð;hð iö jó .ñ 0ð
 —.‘.Ð Ð r   c                 ó  € \        4       p V f   R#  V P                  P                  RV P                  R7      ;'       g    / P	                  R4      #   \
         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)z¬Rescan skills in the gateway session too (its skill-command map serves this session's
``/<skill>`` and bundle invocations); the CLI's own rescan still drives main's output.Nzskills.reloadrx   rX   zskills.reload failed: %s)rß   r(   rS   r   r   r   rU   rV   )rÞ   rY   s     r   Úreload_gateway_skillsr÷   9  sm   € ô ‹>€DØ‚|ÙðØ—‘×$Ñ$ _ÀÇÁÐ$ÓQ×WÐWÐUW×\Ñ\Ð]eÓfÐføÜô Ü�‰Ð/°Ô5Ýûðús   ’-A Á A ÁA>ÁA9Á9A>c                ó^   € ^ RI Hp V! W4       \        4        Ve   ^ RIHp V! V4       R# R# )zçMain's ``/skills`` (hub search / install / uninstall write the local skills tree), then the
gateway's rescan so an install reaches the skill map the session's turns use, and ``cli``'s copy of
the gateway's skill list is read again.)Úhandle_skills_slashN)Ú
invalidate)Úhermes_cli.skills_hubrù   r÷   Ú"hermes_cli.gateway_plugin_commandsrú   )ÚcmdÚconsoler¶   rä   rú   s   &&&  r   rù   rù   F  s*   € õ CÙ	ˆ#ÔÜÔØ
‚ÝAÙ�3Žñ r   r8   )r!   Ú
__future__r   Úloggingr-   rP   Úhermes_cli.gateway_clientr   Ú	getLoggerr   rU   rQ   r@   r×   r   r%   r´   rÐ   rØ   rÚ   r<   rß   râ   rê   rõ   r÷   rù   r#   r   r   Ú<module>r     s–   ðñõ #ã Û Û å 8à	×	Ò	˜8Ó	$€à€à€à€÷4ñ 4÷`:ñ `:÷Frñ r÷>	#ñ 	#òò1òò
Lòòqò!ò"
ö	r   