+
    jHàjØ? ã            	      óP  € R t ^ RIH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t^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHtHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ RI H!t! ^ RI"H#t# ^ RI$H%t% ^ RI&H't' ^ RI(H)t) ^ RI*H+t+H,t, ^ RI-H.t.H/t/ ^ RI0H1t1H2t2 ]Pf                  ! R4      t4R/t5RR0RR1RR2/t6/ ]7Pq                  R3R4      C]7Pq                  R4R4      CRR/Ct9/ ]7Pq                  R5R64      C]7Pq                  R7R84      CRR9/Ct:/ ]7Pq                  R:R4      C]7Pq                  R;R4      Ct;/ ]7Pq                  R<R4      C]7Pq                  R=R4      Ct<RP{                  4       t>R R  lt?R! R" lt@R>R# R$ lltAR% R& ltBR' R( ltCR) R* ltDR+ R, ltE ! R- R.])]%]']+]#4      tFR# )?aa  Gateway slash-command handlers for GatewayRunner: lifted out of ``gateway/run.py`` into a mixin
so ``self._handle_*_command`` keeps resolving via the MRO.  Cohesive clusters live in the sibling
mixins (``slash_commands_model/_session/_status/_goals``); this module keeps the shared helpers plus
the one-off commands.  run.py helpers are imported lazily.)ÚannotationsN)Údatetime)ÚPath)ÚOptionalÚUnion©Út)ÚHomeChannelÚPlatformÚPlatformConfigÚpersist_home_channel)ÚEphemeralReply)ÚMessageEvent)ÚAsyncSessionStore)ÚTranscriptReadError)ÚGatewayGoalCommandsMixin)ÚGatewayModelCommandsMixin)ÚGatewaySessionCommandsMixin)ÚGatewayLoginCommandsMixin)ÚGatewayStatusCommandsMixinÚhistory_unreadable)Úatomic_config_writeÚcfg_get)Úatomic_json_writeÚis_truthy_valuezgateway.runÚqueueÚsteerÚ	interruptÚstagedÚallÚsessionÚttsTFÚalwaysaü  
import os, subprocess, sys
output_path, exit_code_path, cmd = sys.argv[1], sys.argv[2], sys.argv[3:]
env = dict(os.environ, PYTHONUNBUFFERED="1")
with open(output_path, "wb") as f:
    rc = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT, env=env).wait(timeout=3600)
# Temp + replace: the gateway watcher polls the exit code and reads an empty file as failure.
with open(exit_code_path + ".tmp", "w", encoding="utf-8") as f:
    f.write(str(rc))
os.replace(exit_code_path + ".tmp", exit_code_path)
c               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚrootÚdictÚkeysÚstrÚreturn© )Úformats   "Ú;/home/ubuntu/.hermes/hermes-agent/gateway/slash_commands.pyÚ__annotate__r-   S   s!   € ÷ ñ �tð  Cð ¨Dñ ó    c                óz   € V F4  p\        V P                  V4      \        4      '       g   / W&   W,          p K6  	  V # )zSWalk/create ``root[k1][k2]...`` as dicts, replacing any non-dict value on the path.)Ú
isinstanceÚgetr&   )r%   r'   Úks   &* r,   Ú_nested_dictr3   S   s6   € ãˆÜ˜$Ÿ(™( 1›+¤t×,Ò,ØˆD‰GØ�wŠñ ð €Kr.   c               ó$   € V ^8„  d   QhRRRRRR/# )r$   Úconfig_pathr   r'   Útupler)   ÚNoner*   )r+   s   "r,   r-   r-   \   s!   € ÷ *ñ *¨ð *°Eð *ÀTñ *r.   c                ó`   € ^ RI Hp V! V 4      pVEv rVV\        V.VO5!  V&   \        W4       R# )zºSet one leaf through a strict raw round-trip. The behavioral read is fail-open (``{}``) and
expanded, so writing it back wipes the file after a read error and persists ``${VAR}`` values.©Úread_user_config_rawN)Úhermes_cli.configr:   r3   r   )r5   r'   Úvaluer:   ÚrawÚparentsÚleafs   &&&    r,   Ú_write_raw_config_leafr@   \   s4   € õ 7Ù
˜{Ó
+€CØ�N€WØ(-„L�Ð�wÓ Ñ%Ü˜Ö)r.   c               ó$   € V ^8„  d   QhRRRRRR/# )r$   Útextr(   ÚlimitÚintr)   r*   )r+   s   "r,   r-   r-   f   s!   € ÷ ?ñ ?�3ð ?˜sð ?¨Cñ ?r.   c                óJ   € V R V \        V 4      V8”  d	   R,           # R,           # )Nz...Ú ©Úlen)rB   rC   s   &&r,   Ú_previewrI   f   s&   € Ø��ˆ<¤C¨£I°Ô$5˜5Õ>Ð>¸2Õ>Ð>r.   c               ó   € V ^8„  d   QhRR/# )r$   Úcommandr(   r*   )r+   s   "r,   r-   r-   j   s   € ÷ Uñ U�cñ Ur.   c                ó2   € ^ RI HpHp V! W! RRR/VB 4      # )zGRun *command* through the shared slash executor on the gateway surface.)ÚCommandContextÚexecute_commandÚsurfaceÚgatewayr*   )Úhermes_cli.slash_execrM   rN   )rK   Ú
ctx_kwargsrM   rN   s   &,  r,   Ú_executerS   j   s   € çEÙ˜7 NÑ$S¸9Ð$SÈ
Ñ$SÓTÐTr.   c               ó    € V ^8„  d   QhRRRR/# ©r$   Úeventr   r)   r&   r*   )r+   s   "r,   r-   r-   p   s   € ÷ ñ  <ð °Dñ r.   c           
     ó  € V P                   pRVP                  '       d   VP                  P                  MRRVP                  RVP                  /pVP
                  RJ dD   RVR&   TP                  R
 Uu/ uF"  p\        W4      '       g   K  V\        W4      bK$  	  up4       RVP                  3RV P                  3R	\        VR	R4      33pTP                  V UUu/ uF  w  r5V'       g   K  W5bK  	  upp4       V# u upi u uppi )a  Requester routing info so the new gateway process can notify them once back online.
``profile`` is persisted so the notice leaves through the requester's own profile bot after the
restart (a bare platform lookup would resolve the default profile's adapter).ÚplatformNÚchat_idÚ	chat_typeTÚdelivered_via_upstream_relayÚ	thread_idÚ
message_idÚprofile)Úuser_idÚscope_id)
ÚsourcerX   r<   rY   rZ   r[   ÚupdateÚgetattrr\   r]   )rV   ra   Údatar2   ÚoptionalÚvs   &     r,   Ú_restart_notify_payloadrg   p   só   € ð �\‰\€FØ°··°˜Ÿ™×-Ò-ÀdØ�v—~‘~ {°F×4DÑ4DðF€Dà×*Ñ*¨dÓ2Ø/3ˆÐ+Ñ,Ø�‰Ñ4KÓbÑ4K¨qÌwÐW]×OaÔ*�Qœ Ó*Ò*Ñ4KÑbÔcØ˜f×.Ñ.Ð/°,À×@PÑ@PÐ1QØœG F¨I°tÓ<Ð=ð?€Hà‡K�K¡(Ô0¡(™$˜!¬a”�’¡(Ò0Ô1Ø€Kùò	 cùó 1s   Á5C?ÂC?ÃD
Ã/D
c               ó   € V ^8„  d   QhRR/# ©r$   r)   r7   r*   )r+   s   "r,   r-   r-   €   s   € ÷ iñ iÀtñ ir.   c                ó  € ^ RI p^ RIp\        P                  R8X  du   ^ RIHp VP                  ! \        P                  R\        \        V4      \        V4      \        P                  RRRR.
3R	VP                  R
VP                  /V! 4       B  R# RP                  R V  4       4      pRV R\        P                  ! \        V4      4       R\        P                  ! \        V4      R,           4       R\        P                  ! \        V4      R,           4       R\        P                  ! \        V4      4       2
pVP                  R4      pV'       d   VRRV.MRRV.p	VP                  W”P                  VP                  RR7       R# )u,  Spawn ``hermes update --gateway`` detached so it survives the gateway restart it may trigger.
setsid is portable (works where ``systemd-run --user`` lacks a D-Bus session); ``--gateway``
enables file-based IPC so interactive prompts are forwarded; PYTHONUNBUFFERED lets the gateway
stream output live.  Windows has no setsid: an inline helper runs the updater as a module under
this interpreter (not venv\Scripts\hermes.exe â€” that shim holds its own file open, and the
update must replace it), redirects both outputs to one file and writes the exit code.NÚwin32)Úwindows_detach_popen_kwargsz-cz-mzhermes_cli.mainrb   z	--gatewayÚstdoutÚstderrÚ c              3  óN   "  € T F  p\         P                  ! V4      x € K  	  R # 5i©N)ÚshlexÚquote)Ú.0Úparts   & r,   Ú	<genexpr>Ú)_spawn_detached_update.<locals>.<genexpr>�   s   é € ÐG¹J°DœeŸkšk¨$×/Ð/»Jùs   ‚#%zPYTHONUNBUFFERED=1 z update --gateway > z" 2>&1; rc=$?; printf '%s' "$rc" > ú.tmpz
 && mv -f ÚsetsidÚbashT)rm   rn   Ústart_new_session)ÚshutilÚ
subprocessÚsysrX   Úhermes_cli._subprocess_compatrl   ÚPopenÚ
executableÚ_WINDOWS_UPDATE_HELPERr(   ÚDEVNULLÚjoinrr   rs   Úwhich)
Ú
hermes_cmdÚoutput_pathÚexit_code_pathr|   r}   rl   Úhermes_cmd_strÚ
update_cmdÚ
setsid_binÚargvs
   &&&       r,   Ú_spawn_detached_updater�   €   sm  € ó ÛÜ
‡|�|�wÔÝMØ×ÒÜ�^‰^˜TÔ#9¼3¸{Ó;KÌSÐQ_ÓM`Ü�^‰^˜TÐ#4°hÀðMñ	cð ×%Ñ%ð	cð /9×.@Ñ.@ð	cñ E`ÓDaò	cñ 	Ø—X‘XÑG¹JÓGÓG€Nà
˜nÐ-ð .Ü�kŠkœ#˜kÓ*Ó+Ð,ð -(ô ).¯ª´C¸Ó4GÈ&Õ4PÓ(QÐ'RØ
”U—[’[¤ ^Ó!4°vÕ!=Ó>Ð?¸qÄÇÂÌSÐQ_ÓM`ÓAaÐ@bð	dð ð —‘˜hÓ'€Jß5?ˆJ˜  jÑ1ÀfÈdÐT^ÐE_€DØ×Ñ�T×"4Ñ"4¸Z×=OÑ=OÐcgÐÖhr.   c               ó   € V ^8„  d   QhRR/# )r$   r)   úOptional[str]r*   )r+   s   "r,   r-   r-       s   € ÷ 
1ñ 
1¨ñ 
1r.   c                ó  € \        V RR4      pV'       g   R# \        V RR4      \        P                  8H  ;'       d7    \        V RR4      ;'       d"    \        V4      \        V P                  4      8H  pV'       d   R# \        V4      # )ac  The thread id /sethome should persist on the home target, or None.  Slack thread-per-message
keying stamps a top-level message's own id as ``source.thread_id`` (a session key, not a
location); persisting it would pin HOME to that ephemeral thread.  A thread id equal to the
message's own id is synthetic and dropped; a real thread (id = parent's) is kept.r\   NrX   r]   )rc   r
   ÚSLACKr(   r]   )ra   r\   Ú	synthetics   &  r,   Ú_home_thread_from_sourcer“       s|   € ô
 ˜ ¨TÓ2€IßÙÜ˜ ¨TÓ2´h·n±nÑD÷ >ð >ÌÐQWÐYeÐgkÓIl÷ >ð >Ü˜“^¤s¨6×+<Ñ+<Ó'=Ñ=ð çˆ4Ð0¤# i£.Ð0r.   c                  óš  € ] tR t^­t$ RtR]R&   RR/R R lltR R	 lt]R
 R l4       t	R R lt
R R ltR R ltRiR ltR R ltR R ltR R ltR R lt]R R l4       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R0 R1 ltR2 R3 ltR4 R5 ltR6 R7 ltR8 R9 lt R: R; lt!R< R= lt"R> R? lt#]RjR@ RA ll4       t$RB RC lt%RD RE lt&RF RG lt'RH RI lt(RJ RK lt)RL RM lt*RN RO lt+RP RQ lt,RR RS lt-RT RU lt.RV RW lt/RX RY lt0RZ R[ lt1R\ R] lt2R^ R_ lt3R` Ra lt4Rb Rc lt5Rd Re lt6Rf Rg lt7Rht8R# )kÚGatewaySlashCommandsMixinz`In-session slash-command handlers for GatewayRunner (plus the helpers the sibling mixins share).r   Úasync_session_storeÚlockless_fallbackFc               ó    € V ^8„  d   QhRRRR/# )r$   Úsession_keyr(   r—   Úboolr*   )r+   s   "r,   r-   Ú&GatewaySlashCommandsMixin.__annotate__¸   s   € ÷ dñ d¨Sð dÈñ dr.   c               óš  € \        V RR4      p\        V RR4      pVe   Vf   V'       g   R#  V'       d&   V;_uu_ 4        VP                  V4      pRRR4       MVP                  V4      p \        X\        \
        34      '       d   V'       d
   V^ ,          # R# T;'       g    R#   + '       g   i     LK; i  \         d     R# i ; i)a’  Peek the cached AIAgent for *session_key* without evicting it, or None. Entries are
``(agent, signature, ...)`` tuples (bare agents from test doubles accepted). Historical callers
read the cache ONLY under ``_agent_cache_lock`` and got None when a fixture that skipped
``__init__`` had no lock; the manual codex ``/compress`` path was the one exception that read
lock-free (``lockless_fallback=True``).Ú_agent_cacheNÚ_agent_cache_lock)rc   r1   Ú	Exceptionr0   r6   Úlist)Úselfr™   r—   ÚcacheÚlockÚentrys   &&$   r,   Ú_cached_agent_forÚ+GatewaySlashCommandsMixin._cached_agent_for¸   s¯   € ô ˜˜n¨dÓ3ˆÜ�tÐ0°$Ó7ˆØŠ=˜Tš\×2CÙð	ßß’TØ!ŸI™I kÓ2�E÷ �Tð Ÿ	™	 +Ó.‘ô 1;¸5Ä5Ì$À-×0PÒ0PŸE��a•Ðc tÐcÐV[×VcÐVcÐ_cÐc÷ —Tûô ô 	Úð	ús:   ®B; ¶
B; Á B(ÁB; ÁB; Â(B8	Â3B; Â8B; Â;C
Ã	C
c               ó   € V ^8„  d   QhRR/# )r$   r™   r(   r*   )r+   s   "r,   r-   r›   Ì   s   € ÷ 3ñ 3¨sñ 3r.   c                ó|   € ^ RI Hp V P                  P                  V4      pVe   W2Jd   V# V P	                  V4      # )z—The live running agent for *session_key*, else the cached one, else None. The pending
sentinel (a run that is starting) never counts as a usable agent.)Ú_AGENT_PENDING_SENTINEL)Úgateway.runr©   Ú_running_agentsr1   r¥   )r¡   r™   r©   Úagents   &&  r,   Ú_resident_agent_forÚ-GatewaySlashCommandsMixin._resident_agent_forÌ   s>   € õ 	8Ø×$Ñ$×(Ñ(¨Ó5ˆØÒ Ó!EØˆLØ×%Ñ% kÓ2Ð2r.   c               ó   € V ^8„  d   QhRR/# ©r$   r)   r(   r*   )r+   s   "r,   r-   r›   Ö   s   € ÷ gñ g¨3ñ gr.   c                 	ó2   € ^ RI Hp  V ! \        R4      R7      # )é    ©Úformat_session_db_unavailablez,gateway.shared.session_db_unavailable_prefix)Úprefix)Úhermes_stater´   r   r³   s    r,   Ú_session_db_unavailable_replyÚ7GatewaySlashCommandsMixin._session_db_unavailable_replyÕ   s   € å>Ù,´AÐ6dÓ4eÔfÐfr.   c               ó   € V ^8„  d   QhRR/# ©r$   rV   r   r*   )r+   s   "r,   r-   r›   Ú   s   € ÷ cñ c \ñ cr.   c                óX   € V P                  VP                  V P                  V4      4      # )z?Thread/reply metadata for an outbound send anchored on *event*.)Ú_thread_metadata_for_sourcera   Ú_reply_anchor_for_event©r¡   rV   s   &&r,   Ú_reply_metadataÚ)GatewaySlashCommandsMixin._reply_metadataÚ   s%   € à×/Ñ/°·±¸d×>ZÑ>ZÐ[`Ó>aÓbÐbr.   c               ó   € V ^8„  d   QhRR/# rº   r*   )r+   s   "r,   r-   r›   Þ   s   € ÷ dñ d¨,ñ dr.   c                ó–   € VP                   '       g   R# V P                  VP                   4      V P                  VP                   4      3# )uº   ``(adapter, session_key)`` for the event's source, either None when no source. The source's
OWN transport (profile-aware, fail-closed) â€” ``self.adapters`` is the default profile's map.)NN)ra   Ú_delivery_adapter_forÚ_session_key_for_sourcer¾   s   &&r,   Ú_adapter_and_key_forÚ.GatewaySlashCommandsMixin._adapter_and_key_forÞ   s?   € ð �|�|ˆ|ØÐØ×)Ñ)¨%¯,©,Ó7¸×9UÑ9UÐV[×VbÑVbÓ9cÐcÐcr.   c               ó$   € V ^8„  d   QhRRRRRR/# )r$   rV   r   rB   r(   r)   r*   )r+   s   "r,   r-   r›   å   s&   € ÷ nñ n°ð nÀSð nÈSñ nr.   c           
     	óL   € ^ RI Hp V! V\        \        VRR4      RR4      4      # )r²   )Ú_telegramize_command_mentionsra   NrX   )rª   rÉ   rc   )r¡   rV   rB   rÉ   s   &&& r,   Ú_telegramized_command_replyÚ5GatewaySlashCommandsMixin._telegramized_command_replyå   s'   € Ý=Ù,¨T´7¼7À5È(ÐTXÓ;YÐ[eÐgkÓ3lÓmÐmr.   Nc                ó‚  € ^ RI HpHp ^ RIHp ^ RIHp ^ RIHp Ve	   V! W4      MRpT! V'       d   VP                  V! V 4      RR7      MV! 4       4      pVR,          '       g   R# VP                  4        U	U
u/ uF-  w  ršV	P                  R	4      '       g   K  V	\        R	4      R V
bK/  	  pp	p
V! RR
R/VB # u up
p	i )zbA CheckpointManager from a local session's frozen policy, else gateway config; None when disabled.)Ú_checkpoint_agent_kwargsÚ_load_gateway_config)Úactive_authority)Úpolicy_for_source)ÚCheckpointManagerNF)ÚsecretsÚcheckpoints_enabledÚcheckpoint_ÚenabledTr*   )rª   rÍ   rÎ   Úgateway.session_authoritiesrÏ   Úgateway.session_policyrÐ   Útools.checkpoint_managerrÑ   ÚconfigÚitemsÚ
startswithrH   )r¡   ra   rÍ   rÎ   rÏ   rÐ   rÑ   ÚpolicyÚcpr2   rf   Úfieldss   &&          r,   Ú_checkpoint_managerÚ-GatewaySlashCommandsMixin._checkpoint_manageré   s¯   € çNÝ@Ý<Ý>Ø4:Ò4FÑ" 4Ô0ÈDˆÙ%×^d f§m¡mÑ4DÀTÓ4JÐTY mÔ&ZÙ+?Ó+AóCˆàÐ'×(Ô(Ùà8:¿¹¼
Ôb¹
±°ÀaÇlÁlÐS`×FaÔ+�!”C˜Ó&Ð'Ð(¨!Ò+¹
ˆÑbÙ Ñ8¨Ð8°Ñ8Ð8ùó cs   Á;B;ÂB;c               ó    € V ^8„  d   QhRRRR/# )r$   Úsectionr(   rV   r   r*   )r+   s   "r,   r-   r›   ø   s   € ÷ ñ ¨cð ¸,ñ r.   c                ó”   a aaaa€ ^ RI Hp ^ RIHo V! 4       R,          oS P	                  VP
                  4      oR VVVV V3R llpV# )a  ``set_mode_fn`` for /memory and /skills: persist ``<section>.write_approval``. Raw read is
correct for the write-back round-trip (merged defaults must not be persisted back to the
user's file); the cached agent is dropped so the setting takes effect next message.)Ú_gateway_config_homer9   úconfig.yamlc               ó   € V ^8„  d   QhRR/# )r$   rÕ   rš   r*   )r+   s   "r,   r-   ÚFGatewaySlashCommandsMixin._write_approval_setter.<locals>.__annotate__  s   € ÷ 	2ñ 	2 4ñ 	2r.   c                óŽ   <€ S! S4      p\        V 4      VP                  S/ 4      R &   \        SV4       SP                  S4       R# )Úwrite_approvalN)rš   Ú
setdefaultr   Ú_evict_cached_agent)rÕ   Úuser_configr5   r:   râ   r¡   r™   s   & €€€€€r,   Ú_set_approvalÚGGatewaySlashCommandsMixin._write_approval_setter.<locals>._set_approval  sC   ø€ Ù.¨{Ó;ˆKÜDHÈÃMˆK×"Ñ" 7¨BÓ/Ð0@ÑAÜ ¨[Ô9ð
 ×$Ñ$ [Ö1r.   )rª   rä   r;   r:   rÄ   ra   )r¡   râ   rV   rä   rí   r5   r:   r™   s   ff&  @@@r,   Ú_write_approval_setterÚ0GatewaySlashCommandsMixin._write_approval_setterø   s@   ü€ õ 	5õ 	;Ù*Ó,¨}Õ<ˆØ×2Ñ2°5·<±<Ó@ˆ÷	2ô 	2ð Ðr.   c               ó$   € V ^8„  d   QhRRRRRR/# )r$   rV   r   Úconfirmation_textr(   Úverbr*   )r+   s   "r,   r-   r›     s#   € ÷ ñ ¸,ð Ð[^ð Ðfiñ r.   c           	   ƒ  ó®  "  € VP                   pV P                  V4      pV'       d   VP                  VP                  4       \	        VRR4      RJd   V# V'       d8    VP                  VP                  W!P                  RRRR/R7      G Rj  x€L
  R# R#  L  \         d/   p\        P                  RY4P                  TRR	7        Rp?R# Rp?ii ; i5i)
a  Return *confirmation_text* for normal delivery, or push it on native-streaming adapters
(WeCom msgtype:"stream"), which need it sent directly with control-lane metadata (reliable
proactive send, not the finalized reply stream). ``is not True``: mocks auto-create attrs.ÚSUPPORTS_NATIVE_STREAMINGFTÚis_approval_promptÚforce_proactive_send)Úreply_toÚmetadataNz)Failed to send /%s confirmation to %s: %s©Úexc_info)
ra   rÃ   Úresume_typing_for_chatrY   rc   Úsendr]   rŸ   ÚloggerÚwarning)r¡   rV   rò   ró   ra   ÚadapterÚexcs   &&&&   r,   Ú_deliver_approval_confirmationÚ8GatewaySlashCommandsMixin._deliver_approval_confirmation  sÖ   é € ð —‘ˆØ×,Ñ,¨VÓ4ˆßØ×*Ñ*¨6¯>©>Ô:Ü�7Ð7¸Ó?ÀtÓKØ$Ð$ßð3Ø—l‘lØ—N‘NÐ$5×@PÑ@PØ2°DÐ:PÐRVÐWð #ó Y÷ Yð Yó ñYøô ô 3Ü—‘ÐJÈD×R`ÑR`Ø"¨Tð ÷ 3ð 3áûð3üsB   ‚ACÁ/B ÂBÂB ÂCÂB ÂCÂ$#CÃCÃCÃCc               ó   € V ^8„  d   QhRR/# r°   r*   )r+   s   "r,   r-   r›   "  s   € ÷ ]ñ ]°Sñ ]r.   c                óˆ   € \        V RR4      '       d   V P                  P                  V4      MRpVe   \        VRR4      # R# )záThe prefix users can always type to reach Hermes commands (adapter ``typed_command_prefix``,
default "/"). Slack and Matrix use "!" because typed "/" is blocked/reserved there; their
adapters rewrite "!command" to "/command".ÚadaptersNÚtyped_command_prefixÚ/)rc   r  r1   )r¡   rX   r   s   && r,   Ú_typed_command_prefix_forÚ3GatewaySlashCommandsMixin._typed_command_prefix_for"  sD   € ô 29¸¸zÈ4×1PÒ1P�$—-‘-×#Ñ# HÔ-ÐVZˆØ@GÒ@SŒw�wÐ 6¸Ó<Ð\ÐY\Ð\r.   c               ó   € V ^8„  d   QhRR/# r°   r*   )r+   s   "r,   r-   r›   )  s   € ÷ >ñ >˜sñ >r.   c                	óX   € ^ RI Hp V! R\        \        P                  ! 4       4      4      # )r²   )Úterminal_envÚTERMINAL_CWD)Útools.terminal_scoper  r(   r   Úhome)r¡   r  s   & r,   Ú_terminal_cwdÚ'GatewaySlashCommandsMixin._terminal_cwd)  s   € Ý5Ù˜N¬C´·	²	³Ó,<Ó=Ð=r.   c               ó   € V ^8„  d   QhRR/# rº   r*   )r+   s   "r,   r-   r›   .  s   € ÷ cñ c lñ cr.   c                óf   € ^ RI HpHp V! 4       R,          V! V P                  P                  4      3# )zR``(config.yaml path, platform config key)`` for the per-platform display settings.)rä   Ú_platform_config_keyrå   )rª   rä   r  ra   rX   )rV   rä   r  s   &  r,   Ú_display_config_targetÚ0GatewaySlashCommandsMixin._display_config_target-  s+   € ÷ 	KÙ#Ó%¨Õ5Ñ7KÈEÏLÉL×LaÑLaÓ7bÐbÐbr.   c               ó    € V ^8„  d   QhRRRR/# ©r$   rV   r   r)   r(   r*   )r+   s   "r,   r-   r›   3  s   € ÷ Oñ O°<ð OÀCñ Or.   c              ƒ  ó6  "  € ^ RI Hp \        VRR4      pR;rE\        \        V RR4      RR4      '       d\   \        VRR4      ;'       g    RP                  4       p ^ R	IHp V! V P                  V4      4      ;_uu_ 4        V! 4       pRRR4       \        RR
VRV/R7      pRP                  \        RVP                  R,          R7      \        RVP                  R,          R7      .4      #   + '       g   i     Ll; i  \         d    T! 4       p Lƒi ; i5i)uX  Handle /profile â€” show the profile serving this source and its home.  On a multiplexed
gateway the process-level profile is the multiplexer's own ("default" in every chat), so
with ``multiplex_profiles`` on report ``source.profile`` and resolve home under that
profile's runtime scope; when off the stamp is ignored, mirroring ``_run_agent``.)Údisplay_hermes_homera   NrF   rÙ   Úmultiplex_profilesFr^   )Ú_profile_runtime_scopeÚprofile_nameÚhome_display©ÚoptionsÚ
zgateway.profile.header)r^   zgateway.profile.homer  )r  )Úhermes_constantsr  rc   Ústriprª   r  Ú _resolve_profile_home_for_sourcerŸ   rS   r„   r   rd   )r¡   rV   r  ra   r  Údisplayr  Úreplys   &&      r,   Ú_handle_profile_commandÚ1GatewaySlashCommandsMixin._handle_profile_command3  sü   é € õ
 	9Ü˜ ¨$Ó/ˆØ!#Ð#ˆÜ”7˜4 ¨4Ó0Ð2FÈ×NÒNÜ# F¨I°rÓ:×@Ð@¸b×GÑGÓIˆLð0Ý>Ù+¨D×,QÑ,QÐRXÓ,Y×ZÕZÙ1Ó3�G÷ [ô ˜¨^¸\È>Ð[bÐ,cÔdˆØ�y‰yœ!Ð4¸e¿j¹jÈÕ>SÔTÜÐ2¸¿¹ÀFÕ9KÔLðNó Oð 	O÷ [×Zûäô 0Ù-Ó/’ð0üsU   ‚ADÁDÁ%D ÂC.Â
D ÂADÃ.C>	Ã9D Ã=DÃ>D ÄDÄDÄDÄDc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   J  s   € ÷ Kñ K°,ð KÀ3ñ Kr.   c              ƒ  ó  "  € ^ RI Hp VP                  pV! W4      pV'       d)   VP                  '       d   VP                  P                  MRpV'       d   VP
                  MR;'       g    RP                  4       p\        VR9   d   RMR4      pV'       d   VP                  MR;'       g    Rp\        RWWVR	7      p	VP                  '       g   V	\        R
4      ,           # VP                  V4      '       d   V	\        R4      ,           # \        \        P                  RR.\        VP                  4      ,           4      4      p
V
'       d   RP!                  R V
 4       4      M
\        R4      pV	\        RVR7      ,           # 5i)u\   Handle /whoami â€” platform, DM-vs-group scope, tier and runnable commands (always allowed).©Úpolicy_for_runner_sourceÚ?rF   Údmzgateway.whoami.scope_dmzgateway.whoami.scope_groupNzgateway.whoami.header)rX   Úscoper_   z gateway.whoami.tier_unrestrictedzgateway.whoami.tier_adminÚhelpÚwhoamiú, c              3  ó,   "  € T F
  pR V 2x € K  	  R# 5i)r  Nr*   )rt   Úcs   & r,   rv   ÚCGatewaySlashCommandsMixin._handle_whoami_command.<locals>.<genexpr>[  s   é € Ð ;±(¨Q 1 Q C¥³(ùó   ‚úgateway.shared.none_markerzgateway.whoami.tier_user)Úcommands>   rF   r/  ÚdirectÚprivate)Úgateway.slash_accessr-  ra   rX   r<   rZ   Úlowerr   r_   rÕ   Úis_adminr    r&   ÚfromkeysÚsortedÚuser_allowed_commandsr„   )r¡   rV   r-  ra   rÜ   rX   rZ   r0  r_   ÚheadÚrunnableÚrunnable_strs   &&          r,   Ú_handle_whoami_commandÚ0GatewaySlashCommandsMixin._handle_whoami_commandJ  s&  é € åAØ—‘ˆÙ)¨$Ó7ˆß,2°v··°�6—?‘?×(Ò(ÈCˆß*0�f×&Ò&°b×AÐA¸T×HÑHÓJˆ	Ü¨yÐ<[Ô/[Ñ+Ða}Ó~ˆß%+�6—>’>°×=Ð=¸#ˆÜÐ(°8ÐRYÔZˆØ�~�~ˆ~Øœ!Ð>Ó?Õ?Ð?Ø�?‰?˜7×#Ò#Øœ!Ð7Ó8Õ8Ð8ô œŸ™ v¨xÐ&8¼6À&×B^ÑB^Ó;_Õ&_Ó`Óaˆß?G�t—y‘yÑ ;±(Ó ;Ô;ÌQÐOkÓMlˆØ”aÐ2¸\ÔJÕJÐJùs*   ‚4F·FÁFÁ,,FÂFÂ.AFÃ:BFc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   ^  s   € ÷ '7ñ '7°,ð '7À3ñ '7r.   c              ƒ  óh  "  € ^ RI Hp VP                  ;'       g    RP                  4       P	                  R4      pVP                  R4      '       d   V\        R4      R P	                  4       pR;rE\        V'       d   \        P                  ! V4      M. 4      pV FK  pVR8X  d   \        Wd4      pK  VP                  R4      '       d   VP                  R^4      ^,          pKI  Tp M	   \        P                  ! W#4      G Rj  x€L
 pTR8X  d    T'       d   \        P                   ! RT4      MRp
T
'       d\   T
P#                  ^4      p T P%                  YT4      G Rj  x€L
 '       d*   TP'                  4       R,           \        RTR7      ,           p\        T4      R8”  d!   TR,          R,           \        R4      ,           pT;'       g    \        R4      #  LÔ  \         d   p	\        R	T	R
7      u Rp	?	# Rp	?	ii ; i LŸ  \         d!   p	\(        P+                  RT	4        Rp	?	L”Rp	?	ii ; i5i)uª   Handle /kanban â€” delegate to the shared kanban CLI (DB work in a thread pool). Allowed
while an agent runs: the board is profile-agnostic and never touches agent state.)Ú	run_slashrF   r  ÚkanbanNz--boardz--board=Ú=zgateway.kanban.error_prefix©ÚerrorÚcreatezCreated\s+(t_[0-9a-f]+)\br"  z gateway.kanban.subscribed_suffix)Útask_idz'kanban create auto-subscribe failed: %siØ  :NiØ  Nzgateway.kanban.truncated_suffixzgateway.kanban.no_output)Úhermes_cli.kanbanrI  rB   r$  ÚlstriprÛ   rH   Úiterrr   ÚsplitÚnextÚasyncioÚ	to_threadrŸ   r   ÚreÚsearchÚgroupÚ_kanban_auto_subscribeÚrstriprþ   rÿ   )r¡   rV   rI  rB   Úrequested_boardÚactionÚtokensÚtokÚoutputr  ÚmrO  s   &&          r,   Ú_handle_kanban_commandÚ0GatewaySlashCommandsMixin._handle_kanban_command^  sË  é € õ 	0ð —
‘
× Ð ˜b×'Ñ'Ó)×0Ñ0°Ó5ˆØ�?‰?˜8×$Ò$Øœ˜H›˜Ð'×.Ñ.Ó0ˆDØ#'Ð'ˆÜ¯4”e—k’k $Ô'°RÓ8ˆÛˆCØ�iÔÜ"& vÓ"?’Ø—‘ 
×+Ò+Ø"%§)¡)¨C°Ó"3°AÕ"6’à�Ùñ ð	?Ü"×,Ò,¨YÓ=×=ˆFð @FÈÔ?Q×V\ŒB�IŠIÐ2°FÔ;ÐbfˆßØ—g‘g˜a“jˆGðOØ×4Ñ4°UÀ_ÓU×UÖUØ#Ÿ]™]›_¨tÕ3´aÐ8ZÐdkÔ6lÕl�Fô
 ˆv‹;˜ÔØ˜E•] TÕ)¬AÐ.OÓ,PÕPˆFØ×6Ð6œÐ5Ó6Ð6ñ' >øÜô 	?ÜÐ2¸#Ô>Õ>ûð	?úñ Vøäô OÜ—‘ÐHÈ#×NÑNûðOüs©   ‚AH2ÁA7H2Ã!H2Ã-G ÄGÄG ÄH2Ä H2Ä;H2ÅH Å"HÅ#	H Å-)H Æ8H2ÇH2ÇG ÇG?Ç(G:Ç4G?Ç5H2Ç:G?Ç?H2ÈH ÈH/ÈH*È%H2È*H/È/H2c               ó$   € V ^8„  d   QhRRRRRR/# )r$   rV   r   rO  r(   r)   rš   r*   )r+   s   "r,   r-   r›   ‡  s"   € ÷ #ñ #°,ð #Èð #Ðbfñ #r.   c              ƒ  ó  a aaaaaa	a
a"  € VP                   oR V3R llo\        SRR4      p\        VR4      '       d   VP                  M\	        T;'       g    R4      P                  4       o
S! R4      S! R4      uooS P                  V4      ;'       g    Ro	\        S	\        4      '       d   S'       d   S	P                  RS4       S
'       d	   S'       g   R	# VVVV	V
VV V3R
 lp\        P                  ! V4      G Rj  x€L
  R#  L5i)z�Subscribe the event's chat to *task_id* notifications (notify+wake). False when the
source has no platform/chat to route back to.c               ó    € V ^8„  d   QhRRRR/# )r$   Únamer(   r)   r�   r*   )r+   s   "r,   r-   ÚFGatewaySlashCommandsMixin._kanban_auto_subscribe.<locals>.__annotate__Œ  s   € ÷ 	@ñ 	@˜ð 	@ ñ 	@r.   c                óX   <€ \        \        SV R 4      ;'       g    R 4      ;'       g    R# )rF   N)r(   rc   )rg  ra   s   &€r,   Ú_fieldÚ@GatewaySlashCommandsMixin._kanban_auto_subscribe.<locals>._fieldŒ  s'   ø€ Ü”w˜v t¨RÓ0×6Ð6°BÓ7×?Ð?¸4Ð?r.   rX   Nr<   rF   rY   rZ   Fc                 ó^  <€ ^ RI Hp  ^ RI Hp ^ RI Hp VP	                  S	R7      p TP                  TSSSSS! R4      S! R4      S! R4      S! R4      ;'       g&    \        S
R	R
4      ;'       g    S
P                  4       RSR7       VP                  4        R
#   TP                  4        i ; i)r²   )Ú	kanban_db)Úkanban_db_connect)Úkanban_db_notify)Úboardr\   r_   Úuser_id_altr^   Ú_kanban_notifier_profileNznotify+wake)
rO  rX   rY   rZ   r\   r_   rq  Únotifier_profileÚdelivery_modeÚdelivery_metadata)	Ú
hermes_clirm  rn  ro  ÚconnectÚadd_notify_subrc   Ú_active_profile_nameÚclose)Ú_kbÚ_kbcÚ_kbnÚconnrj  rY   rZ   ru  Úplatform_strr\  r¡   rO  s       €€€€€€€€r,   Ú_subÚ>GatewaySlashCommandsMixin._kanban_auto_subscribe.<locals>._sub—  sº   ø€ Ý3Ý<Ý;Ø—<‘< o�<Ó6ˆDðØ×#Ñ#Ø '°LÈ'Ð]fÙ$ [Ó1¹6À)Ó;Lñ !' }Ó 5Ù%+¨IÓ%6÷  &Ið  &I¼'À$ÐHbÐdhÓ:i÷  &Ið  &IÐmq÷  nGñ  nGó  nIà"/ÐCTð $ô 	Vð —
‘
–ø�—
‘
•ús   §3B ÁB Á0B ÂB,T)ra   rc   Úhasattrr<   r(   r=  r¿   r0   r&   rê   rU  rV  )r¡   rV   rO  r\  rX   r€  rj  rY   rZ   ru  r  ra   s   f&ff  @@@@@@r,   rZ  Ú0GatewaySlashCommandsMixin._kanban_auto_subscribe‡  s×   ÿøé € ð —‘ˆ÷	@ð 	@ä˜6 :¨tÓ4ˆÜ*1°(¸G×*DÒ*D˜ŸšÌ#ÈhÏnÈnÐZ\ÓJ]×dÑdÓfˆÙ# IÓ.±°{Ó0CÐˆ�Ø ×0Ñ0°Ó7×?Ð?¸4ÐÜÐ'¬×.Ò.·9Ø×(Ñ(¨°iÔ@ß§Ù÷	ô 	ô$ ×Ò Ó%×%Ð%Ùñ 	&ùs0   ‹ADÁ=DÂ DÂ9DÃDÃ(DÄD
ÄDc               ó    € V ^8„  d   QhRRRR/# ©r$   rV   r   r)   zstr | EphemeralReplyr*   )r+   s   "r,   r-   r›   ¬  s   € ÷ ?+ñ ?+°ð ?+ÐAUñ ?+r.   c              ƒ  óh  a aa"  € ^ RI HpHo VP                  oS P                  P                  S4      G Rj  x€L
 pVP                  pS P                  V4      G Rj  x€L
  R VV V3R llpS P                  P                  V4      pWbJ d<   V! VR4      G Rj  x€L
  \        P                  RV4       \        \        R4      4      # V'       d&   V! VR4      G Rj  x€L
  \        \        R	4      4      # S P                  SV4      pS P                  SV4      pS P!                  SV4      p	W˜8X  d   R
MRp
V	'       du   S P#                  S4      '       d^   V	 F  pV! Wº4      G Rj  x€L
  K  	  \        P                  RW¤\%        V	4      RP'                  V	4      4       \        \        R	4      4      # ^ RIHp T! TR\-        \/        VRR4      ;'       g    R4      R7      '       d   \        \        R	4      4      # \/        S R/ 4      P                  SP0                  4      p V'       dF   \3        VR4      '       d4   VP5                  SP6                  S P9                  V4      4      G Rj  x€L
  \        R4      #  ELA EL ELæ EL¦ EL! L  \:         d    \        P=                  RRR7        L@i ; i5i)aM  Handle /stop command - interrupt a running agent.  A truly hung agent (blocked thread
never checking _interrupt_requested) is caught by the early intercept in _handle_message();
this handler runs via normal dispatch or as a fallback, and force-cleans the session lock in
all cases.  The session is preserved so the user can continue.)r©   Ú_INTERRUPT_REASON_STOPNc               ó$   € V ^8„  d   QhRRRRRR/# )r$   Úkeyr(   Úinvalidation_reasonr)   r7   r*   )r+   s   "r,   r-   ÚDGatewaySlashCommandsMixin._handle_stop_command.<locals>.__annotate__·  s!   € ÷ 	9ñ 	9˜Sð 	9°sð 	9¸tñ 	9r.   c              “  óN   <"  € SP                  V SSVR 7      G Rj  x€L
  R#  L5i))Úinterrupt_reasonrŠ  N)Ú_interrupt_and_clear_session)r‰  rŠ  r‡  r¡   ra   s   &&€€€r,   Ú_stopÚ=GatewaySlashCommandsMixin._handle_stop_command.<locals>._stop·  s.   øé € Ø×3Ñ3Ø�VÐ.DØ$7ð 4ó 9÷ 9ô 9ùs   ƒ%œ#�%Ústop_command_pendingu2   STOP (pending) for session %s â€” sentinel clearedzgateway.stop.stopped_pendingÚstop_command_handlerzgateway.stop.stoppedÚstop_command_thread_siblingÚstop_command_chat_scopeu-   STOP (%s) by %s â€” interrupted %d run(s): %sr3  )Úinterrupt_for_sessionÚstop_commandÚ
session_idrF   )r™   ÚreasonÚparent_session_idr  Ú_stop_typing_with_metadataz4Failed to clear typing on /stop with no active agentTrú   zgateway.stop.no_active)rª   r©   r‡  ra   r–   Úget_or_create_sessionr™   Ú_hm_stop_owner_turnr«   r1   rþ   Úinfor   r   Ú_same_chat_runsÚ_sibling_thread_run_keysÚ_chat_scoped_run_keysÚ_is_user_authorized_for_sourcerH   r„   Útools.async_delegationr•  r(   rc   rX   r‚  rš  rY   r¿   rŸ   Údebug)r¡   rV   r©   Úsession_entryr™   r�  r¬   ÚrunsÚsibling_keysÚfallback_keysr˜  Úfallback_keyr•  r   r‡  ra   s   f&            @@r,   Ú_handle_stop_commandÚ.GatewaySlashCommandsMixin._handle_stop_command¬  sj  úé € ÷
 	PØ—‘ˆØ"×6Ñ6×LÑLÈVÓT×TˆØ#×/Ñ/ˆØ×&Ñ& {Ó3×3Ð3÷	9ò 	9ð ×$Ñ$×(Ñ(¨Ó5ˆØÓ+Ù˜Ð%;Ó<×<Ð<Ü�K‰KÐLÈkÔZÜ!¤!Ð$BÓ"CÓDÐDßÙ˜Ð%;Ó<×<Ð<Ü!¤!Ð$:Ó";Ó<Ð<ð ×#Ñ# F¨KÓ8ˆØ×4Ñ4°V¸TÓBˆØ×2Ñ2°6¸4Ó@ˆð
 Ô,ñ *à*ð 	÷
 ˜T×@Ñ@À×HÒHÛ -�Ù˜LÓ1×1Ò1ñ !.ä�K‰KÐGØ¬S°Ó-?ÀÇÁÈ=ÓAYô[ä!¤!Ð$:Ó";Ó<Ð<õ 	AÙ ¨[ÀÜ36´w¸}ÈlÐ\^Ó7_×7eÐ7eÐceÓ3f÷hó hä!¤!Ð$:Ó";Ó<Ð<ô
 ˜$ 
¨BÓ/×3Ñ3°F·O±OÓDˆð	`ßœ7 7Ð,H×IÒIØ×8Ñ8¸¿¹È×I]ÑI]Ð^cÓIdÓe×eÐeô Ð)Ó*Ð*òq Uâ3ò =ò =ò* 2ñ$ føÜô 	`Ü�L‰LÐOÐZ^ˆLÖ_ð	`üs®   …3J2¸I9¹$J2ÁI<Á;J2ÂI?Â5J2ÃJ2ÃJÃAJ2Ä=J2ÅJ2Å$JÅ%A.J2ÇJ2Ç&:J2È!AJ
 É)JÉ*J
 É.J2É<J2É?J2ÊJ2ÊJ2ÊJ
 Ê
"J/Ê,J2Ê.J/Ê/J2c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   í  s   € ÷ +8ñ +8°Lð +8ÀSñ +8r.   c              ƒ  óê  a"  € \        VRR4      ;'       g    RP                  4       P                  ^R7      pV'       dE   V^ ,          P                  4       P	                  R4      P                  R4      '       d
   VR,          pV'       d
   V^ ,          MRP                  4       p\        V4      ^8”  d   V^,          P                  4       MRo\        V R/ 4      ;'       g    / pVR8X  Ed@   R	P                  \        R
 V P                   4       4      4      ;'       g    \        R4      p\        R4      \        RVR7      .pVP                  4        F   w  rxVP                  R4      '       dN   VP                  R4      ;'       g    \        R4      p	VP                  \        RVP                  V	R7      4       Ki  VP                  \        RVP                  VP                  R^ 4      R7      4       K¢  	  RP                  Yd'       d   . ,           4      # \        R4      .,           4      # VR)9  d   \        R4      # S'       g   \        RVR7      # \        V3R l\         P"                  P%                  4        4       R4      p
V
f   \        RSR 7      # V
P                  pW¤9   pT;'       d!    \'        WJ,          P                  R4      4      pVR8X  dT   V'       g   \        R!VR 7      # V'       d   \        R"VR 7      # V P)                  V
\        R#4      R$7       \        R%VR 7      # V'       g   \        R&VR 7      # V'       g   \        R'VR 7      # V P+                  V
4       \        R(VR 7      # 5i)*u¦   Handle ``/platform list|pause|resume [name]`` â€” inspect and manually control failed/paused
adapters (pause stops the reconnect watcher; resume re-queues for retry).ÚcontentrF   )Úmaxsplitr  rX   :é   NNr    Ú_failed_platformsr3  c              3  ó8   "  € T F  qP                   x € K  	  R # 5irq   )r<   )rt   Úps   & r,   rv   ÚEGatewaySlashCommandsMixin._handle_platform_command.<locals>.<genexpr>ø  s   é € Ð(H¹-°Q¯®»-ùó   ‚r8  zgateway.platform.headerzgateway.platform.connected)Ú	platformsÚpausedÚpause_reasonzgateway.platform.reason_defaultzgateway.platform.item_paused)rg  r˜  zgateway.platform.item_retryingÚattempts)rg  r¸  r"  zgateway.platform.none_failedÚpausezgateway.platform.usagezgateway.platform.usage_action)r]  c              3  óh   <"  € T F'  qP                   P                  4       S8X  g   K#  Vx € K)  	  R # 5irq   )r<   r=  )rt   r²  Útargets   & €r,   rv   r³    s%   øé € Ð_Ñ$A˜qÇWÁWÇ]Á]Ã_ÐX^ÑE^ŸšÓ$Aùs   ƒ 2¨
2Nzgateway.platform.unknown©rg  z!gateway.platform.not_queued_pausezgateway.platform.already_pausedzgateway.platform.reason_manual)r˜  zgateway.platform.pausedz"gateway.platform.not_queued_resumez!gateway.platform.already_retryingzgateway.platform.resumed>   r¹  Úresume)rc   r$  rS  r=  rQ  rÛ   rH   r„   r@  r  r   rÚ   r1   Úappendr<   rT  r
   Ú__members__Úvaluesrš   Ú_pause_failed_platformÚ_resume_paused_platform)r¡   rV   Úpartsr]  ÚfailedÚ	connectedÚlinesr²  r�  r˜  rX   rg  Úqueuedr¶  r»  s   &&            @r,   Ú_handle_platform_commandÚ2GatewaySlashCommandsMixin._handle_platform_commandí  sÆ  øé € ô ˜ 	¨2Ó.×4Ð4°"×;Ñ;Ó=×CÑCÈQÐCÓOˆß�U˜1•X—^‘^Ó%×,Ñ,¨SÓ1×<Ñ<¸Z×HÒHØ˜"•IˆEß#�%˜–(¨×6Ñ6Ó8ˆÜ%(¨£Z°!¤^��q•—‘Ô!¸ˆÜ˜Ð2°BÓ7×=Ð=¸2ˆØ�VÕØŸ	™	¤&Ñ(H¸$¿-º-Ó(HÓ"HÓI×lÐlÌQÐOkÓMlˆIÜÐ0Ó1´1Ð5QÐ]fÔ3gÐhˆEØ!Ÿ<™<ž>‘�Ø—8‘8˜H×%Ò%Ø!ŸX™X nÓ5×]Ð]¼Ð;\Ó9]�FØ—L‘L¤Ð#AÈÏÉÐX^Ô!_Ö`à—L‘L¤Ð#CÈ!Ï'É'Ð\`×\dÑ\dÐeoÐqrÓ\sÔ!tÖuñ *ð —9‘9˜U®F bÕ\Ó]Ð]¼Ð;YÓ9ZÐ8[Õ\Ó]Ð]ØÐ,Ô,ÜÐ-Ó.Ð.ßÜÐ4¸VÔDÐDäÔ_¤H×$8Ñ$8×$?Ñ$?Ô$AÓ_ÐaeÓfˆØÒÜÐ/°fÔ=Ð=Ø�~‰~ˆØÑ#ˆØ×@Ð@œD Õ!1×!5Ñ!5°hÓ!?Ó@ˆØ�WÔßÜÐ<À4ÔHÐHßÜÐ:ÀÔFÐFØ×'Ñ'¨¼Ð;[Ó9\Ð'Ô]ÜÐ.°TÔ:Ð:ßÜÐ9ÀÔEÐEßÜÐ8¸tÔDÐDØ×$Ñ$ XÔ.ÜÐ+°$Ô7Ð7ùsQ   ƒ=M3Á:M3Á<M3ÂAM3Ã#<M3Ä A'M3ÆB>M3ÉA(M3Ê0/M3Ë M3Ë5=M3Ì3M3Í+M3c               ó    € V ^8„  d   QhRRRR/# r…  r*   )r+   s   "r,   r-   r›     s   € ÷ :?ñ :?°<ð :?ÐDXñ :?r.   c              ƒ  ó(  a aa"  € ^ RI Ho S P                  S4      '       d`   SP                  p\        P                  RV'       d)   VP                  '       d   VP                  P                  MRSP                  4       R# S P                  '       g   S P                  '       d:   S P                  4       pV'       d   \        RVR7      # \        \        R4      4      # R V3R	 llpR
 VV 3R llpR V3R llpV! RVR4      G Rj  x€L
  V! RVR4      G Rj  x€L
  S P                  4       p^ RIHpHp	 V	! 4       ;'       g    V! 4       p
S P#                  V
'       * V
R7       V'       d   \        RVR7      # \        \        R4      4      #  L… Lu5i)zFHandle /restart command - drain active work, then restart the gateway.)Ú_hermes_homeuo   Ignoring redelivered /restart (platform=%s, update_id=%s) â€” already processed by a previous gateway instance.r.  rF   zgateway.draining©Úcountzgateway.restart.in_progressc               ó$   € V ^8„  d   QhRRRRRR/# )r$   rg  r(   Úlabelr)   r7   r*   )r+   s   "r,   r-   ÚGGatewaySlashCommandsMixin._handle_restart_command.<locals>.__annotate__+  s&   € ÷ 	Iñ 	I cð 	I¸ð 	IÀñ 	Ir.   c              “  óØ   <"  €  \         P                  ! \        SV ,          V! 4       R R7      G R j  x€L
  R #  L  \         d"   p\        P                  RY#4        R p?R # R p?ii ; i5i)N)ÚindentzFailed to write restart %s: %s)rU  rV  r   rŸ   rþ   r£  )rg  ÚbuildrÐ  ÚerÌ  s   &&& €r,   Ú_write_markerÚHGatewaySlashCommandsMixin._handle_restart_command.<locals>._write_marker+  sT   øé € ðIÜ×'Ò'Ô(9¸<È$Õ;NÑPUÓPWÐ`dÔe×eÔeøÜô IÜ—‘Ð=¸u×HÒHûðIüs7   ƒA*…-; ²9³; ·A*¹; »A'ÁA"ÁA*Á"A'Á'A*c               ó   € V ^8„  d   QhRR/# ©r$   r)   r&   r*   )r+   s   "r,   r-   rÑ  1  s   € ÷ 	ñ 	 ñ 	r.   c                 ó&  <€ \        S4      p SP                  e   \        SP                  4      MSP                  P                  p \        P
                  ! SP                  VR7      Sn        V #   \         d    SP                  Sn         T # i ; i)N)r]   )rg   r]   r(   ra   ÚdataclassesÚreplaceÚ_restart_command_sourcerŸ   )rd   ÚmidrV   r¡   s     €€r,   Ú_notify_payloadÚJGatewaySlashCommandsMixin._handle_restart_command.<locals>._notify_payload1  s|   ø€ Ü*¨5Ó1ˆDØ+0×+;Ñ+;Ò+G”#�e×&Ñ&Ô'ÈUÏ\É\×MdÑMdˆCð<Ü/:×/BÒ/BÀ5Ç<Á<Ð\_Ô/`�Ô,ð ˆKøô ô <Ø/4¯|©|�Õ,ØˆKð<ús   Á'A0 Á0BÂBc               ó   € V ^8„  d   QhRR/# rÙ  r*   )r+   s   "r,   r-   rÑ  :  s   € ÷ 	ñ 	 ñ 	r.   c                 óì   <€ R SP                   P                  '       d!   SP                   P                  P                  MRR\        P                  ! 4       /p SP                  e   SP                  V R&   V # )rX   NÚrequested_atÚ	update_id)ra   rX   r<   ÚtimeÚplatform_update_id)rd   rV   s    €r,   Ú_dedup_payloadÚIGatewaySlashCommandsMixin._handle_restart_command.<locals>._dedup_payload:  s]   ø€ à¸u¿|¹|×?T×?TÐ?T §¡× 5Ñ 5× ;Ò ;ÐZ^Ø"¤D§I¢I£Kð1ˆDà×'Ñ'Ò3Ø$)×$<Ñ$<��[Ñ!ØˆKr.   z.restart_notify.jsonznotify fileNz.restart_last_processed.jsonzdedup marker)Úis_container_restart_contextÚis_gateway_supervisor_process)ÚdetachedÚvia_servicezgateway.restart.restarting)rª   rÌ  Ú_is_stale_restart_redeliveryra   rþ   r�  rX   r<   ræ  Ú_restart_requestedÚ	_drainingÚ_running_agent_countr   r   Úgateway.restartré  rê  Úrequest_restart)r¡   rV   ÚsrcrÎ  rÖ  rß  rç  Úactive_agentsré  rê  rì  rÌ  s   ff         @r,   Ú_handle_restart_commandÚ1GatewaySlashCommandsMixin._handle_restart_command  sX  úé € å,ð ×,Ñ,¨U×3Ò3Ø—,‘,ˆCÜ�K‰Kð Lç.1°c·l·l°l˜Ÿ™×*Ò*ÈØ×0Ñ0ô2ñ Ø×"×"Ð" d§n§n nØ×-Ñ-Ó/ˆEß9>”1Ð'¨uÔ5ÐtÄNÔSTÐUrÓSsÓDtÐt÷	Ið 	I÷	ñ 	÷	ð 	ñ Ð2°OÀ]ÓS×SÐSñ Ð:¸NÈNÓ[×[Ð[Ø×1Ñ1Ó3ˆ÷ 	`Ù3Ó5×WÐWÑ9UÓ9WˆØ×Ñ¨+¤oÀ;ÐÔO÷ ÜÐ'¨}Ô=Ð=ÜœaÐ <Ó=Ó>Ð>ñ# 	Tñ 	\ùsO   …AFÁFÁ:FÂFÂ&FÂ>A
FÄFÄ	FÄFÄ)FÅ'FÅ-"FÆFc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   V  s   € ÷ ñ °\ð Àcñ r.   c              ƒ  óö   "  € ^ RI Hp \        RVP                  4       R7      P                  pVP                  4       P                  4       '       d&   V! 4       '       d   ^ RIHp V! WP                  4       V# 5i)uN   Handle /autoprune â€” the low-disk auto-prune decision (same text as the CLI).)ÚansweredÚ	autoprune)Úargs)Úclear_local_auto_prune_notice)	Úhermes_cli.prune_advisorrù  rS   Úget_command_argsrB   r$  Úgateway.run_housekeeping_diskrü  ra   )r¡   rV   rù  r'  rü  s   &&   r,   Ú_handle_autoprune_commandÚ3GatewaySlashCommandsMixin._handle_autoprune_commandV  sU   é € å5Ü˜¨5×+AÑ+AÓ+CÔD×IÑIˆØ×!Ñ!Ó#×)Ñ)×+Ò+±·
²
ÝSÙ)¨$·±Ô=Øˆùs   ‚AA9ÁA9c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   _  s   € ÷ (ñ (°<ð (ÀCñ (r.   c              ƒ  ó4   "  € \        R4      P                  # 5i)u:   Handle /version â€” show the running Hermes Agent version.Úversion)rS   rB   r¾   s   &&r,   Ú_handle_version_commandÚ1GatewaySlashCommandsMixin._handle_version_command_  s   é € ä˜	Ó"×'Ñ'Ð'ùs   ‚c               ó    € V ^8„  d   QhRRRR/# rU   r*   )r+   s   "r,   r-   r›   c  s   € ÷ ñ  lð °tñ r.   c                óØ   € ^ RI Hp VP                  pV! W4      pVP                  '       d>   TP	                  V'       d   VP
                  MR4      '       g   RRR0VP                  m/# / # )zÿ``allowed_commands`` for /help and /commands when the caller is a gated non-admin:
the slash-access floor + ``user_allowed_commands`` (mirrors /whoami), so the catalog
never advertises commands ``_check_slash_access`` would refuse. Admins / ungated -> {}.r,  NÚallowed_commandsr1  r2  )r<  r-  ra   rÕ   r>  r_   rA  )r¡   rV   r-  ra   rÜ   s   &&   r,   Ú_catalog_optionsÚ*GatewaySlashCommandsMixin._catalog_optionsc  s]   € õ 	BØ—‘ˆñ *¨$Ó7ˆØ�>�>ˆ> &§/¡/ÇF°&·.².ÐPT×"UÒ"UØ&¨°Ð(Y¸F×<XÑ<XÐ(YÐZÐZØˆ	r.   c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   p  s   € ÷ Pñ P°ð PÀñ Pr.   c           	   ƒ  óv   "  € V P                  V\        RV P                  V4      R7      P                  4      # 5i)z/Handle /help command - list available commands.r1  r   )rÊ   rS   r
  rB   r¾   s   &&r,   Ú_handle_help_commandÚ.GatewaySlashCommandsMixin._handle_help_commandp  s7   é € à×/Ñ/Ø”8˜F¨D×,AÑ,AÀ%Ó,HÔI×NÑNóPð 	Pùs   ‚79c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   u  s   € ÷ Cñ C°Lð CÀSñ Cr.   c              ƒ  	óü   "  € VP                   P                  \        P                  8X  d   ^M^pRV/V P	                  V4      Cp\        RVP                  4       VR7      pV P                  WP                  4      # 5i)é   Ú	page_sizer9  )rû  r!  )	ra   rX   r
   ÚTELEGRAMr
  rS   rþ  rÊ   rB   )r¡   rV   r  r!  r'  s   &&   r,   Ú_handle_commands_commandÚ2GatewaySlashCommandsMixin._handle_commands_commandu  si   é € àŸ,™,×/Ñ/´8×3DÑ3DÔD‘BÈ"ˆ	Ø 	ÐJ¨T×-BÑ-BÀ5Ó-IÐJˆÜ˜¨%×*@Ñ*@Ó*BÈGÔTˆØ×/Ñ/°·z±zÓBÐBùs   ‚A:A<c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   |  s   € ÷ (Nñ (N°Lð (NÀSñ (Nr.   c              ƒ  óœ  "  € ^ RI HpHp VP                  pVP                  '       d   VP                  P
                  MRpVP                  pVP                  ;'       g    TpVP                  f   \        R\        R4      R7      # \        VRR4      R	J pV'       d¸   \        V R
R4      p	\        V	4      '       d	   V	! V4      MRp
\        V
RR4      pVP                  R\        P                  \        P                  09   g=   \        VRR4      '       d*   \        V4      '       d   V! VP                  4      '       g   \        R\        R4      R7      # \        V4      p\        VP                  \!        V4      Y|\        VRR4      '       d   \!        VP"                  4      MR\        VRR4      '       d   \!        VP$                  4      MRR7      p \'        WØ'       * R7        ^ RIHp T! T! T4      \!        T4      4       T! T! T4      \!        T;'       g    R4      4       T P2                  P4                  P7                  TP                  \9        T'       * R7      4      pTTn        \        RYvR7      #   \(         d   p\        RTR7      u Rp?# Rp?ii ; i  \(         d!   p\.        P1                  RT4        Rp?LžRp?ii ; i5i)zOHandle /sethome command -- set the current chat as the platform's home channel.)Ú_home_target_env_varÚ_home_thread_env_varÚunknownNzgateway.set_home.save_failedz%gateway.set_home.err_missing_platformrL  r[   FTÚ_intake_adapter_forÚfronts_platformr_   z*gateway.set_home.err_relay_unauthenticatedr`   )rX   rY   rg  r\   r_   r`   )Úenabled_if_new)Úsave_env_valuerF   z7Home config saved but legacy env persistence failed: %s©rÕ   zgateway.set_home.success)rg  rY   )rª   r  r  ra   rX   r<   rY   Ú	chat_namer   rc   Úcallabler
   ÚLOCALÚRELAYr“   r	   r(   r_   r`   r   rŸ   r;   r  rþ   rÿ   rÙ   rµ  rê   r   Úhome_channel)r¡   rV   r  r  ra   Úplatform_namerY   r!  Ú	via_relayÚadapter_for_sourceÚrelay_adapterr  r\   r  rÕ  r  Úplatform_configs   &&               r,   Ú_handle_set_home_commandÚ2GatewaySlashCommandsMixin._handle_set_home_command|  s6  é € çJØ—‘ˆØ17··°˜Ÿ™×-Ò-ÀiˆØ—.‘.ˆØ×$Ñ$×/Ð/¨ˆ	Ø�?‰?Ò"ÜÐ3¼1Ð=dÓ;eÔfÐfÜ˜FÐ$BÀEÓJÈdÐRˆ	ßÜ!(¨Ð/DÀdÓ!KÐÜ:BÐCU×:VÒ:VÑ.¨vÔ6Ð\`ˆMÜ% mÐ5FÈÓMˆOØ—‘ D¬(¯.©.¼(¿.¹.Ð#IÔIÜ" 6¨9°d×;Ò;Ü# O×4Ò4¹OÈFÏOÉO×<\Ò<\ÜÐ7¼qÐAmÓ?nÔoÐoÜ,¨VÓ4ˆ	ÜØ—_‘_¬c°'«lÀÜ+2°6¸9Àd×+KÒ+K”C˜Ÿ™Ô'ÐQUÜ-4°V¸ZÈ×-NÒ-N”S˜Ÿ™Ô)ÐTXôZˆð	>Ü  ´mÕDð	YÝ8ÙÑ/°Ó>ÄÀGÃÔMÙÑ/°Ó>ÄÀIÇOÀOÐQSÓ@TÔUð
 Ÿ+™+×/Ñ/×:Ñ:¸6¿?¹?ÌNÐgpÔcpÔLqÓrˆØ'+ˆÔ$ÜÐ+°)ÔMÐMøô ô 	>ÜÐ3¸1Ô=Õ=ûð	>ûô ô 	YÜ�N‰NÐTÐVW×XÑXûð	Yüso   ‚AKÁ CKÄ?BKÇI9 Ç&4J ÈJ È&AKÉ9JÊJÊJÊKÊJÊKÊK	Ê)KÊ?KËK	Ë	Kc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   ¦  s   € ÷ 5Nñ 5N°ð 5NÀ#ñ 5Nr.   c           	   ƒ  óR  a aaaa"  € SP                  4       P                  4       P                  4       pSP                  P                  oS P                  SP                  4      oS P                  SP                  4      oR VVVV V3R llpV\        9   d#   \        V,          w  rEV! V4       \        V4      # VR 9   d   S P                  S4      G Rj  x€L
 # VR8X  d   S P                  S4      G Rj  x€L
 # VR8X  Ed    S P                  P                  SR4      pVR!9   d   \        RV 24      MTp\        R	VR
7      .pS P                  S4      pV'       d$   \        SR4      '       d   SP                  V4      MRp	V	'       dˆ   V\        RV	R,          R7      \        RV	R,          R7      .,          pV	R,           FK  p
V
P                  R4      '       d   \        R4      MRpVP!                  \        RV
R,          VR7      4       KM  	  RP#                  V4      # S P                  P                  SR4      R8H  pT! V'       d   RMR4       \        V'       d   RMR4      pSRJ;'       d    \        SR4      pV'       d   \        R4      MRp\        RWßR7      #  ELÌ EL¯5i)"z8Handle /voice [on|off|tts|channel|leave|status] command.c               ó    € V ^8„  d   QhRRRR/# )r$   Úmoder(   r)   r7   r*   )r+   s   "r,   r-   ÚEGatewaySlashCommandsMixin._handle_voice_command.<locals>.__annotate__±  s   € ÷ 
	Sñ 
	S˜Cð 
	S Dñ 
	Sr.   c                óî   <€ V SP                   S&   SP                  4        ^ RIHp V! SP                  V 4       S'       g   R# V R8X  d   SP                  SSRR7       R# SP                  SSRR7       R# )r²   )Úlocal_voice_transitionNÚoffT)Údisabledr   )Ú_voice_modeÚ_save_voice_modesÚgateway.session_configr3  ra   Ú_set_adapter_auto_tts_disabledÚ_set_adapter_auto_tts_enabled)r0  r3  r   rY   rV   r¡   Ú	voice_keys   & €€€€€r,   Ú	_set_modeÚBGatewaySlashCommandsMixin._handle_voice_command.<locals>._set_mode±  sg   ø€ Ø*.ˆD×Ñ˜YÑ'Ø×"Ñ"Ô$ÝEÙ" 5§<¡<°Ô6ßÙØ�uŒ}Ø×3Ñ3°G¸WÈtÐ3ÖTà×2Ñ2°7¸GÈTÐ2ÖRr.   NÚleaveÚstatusr4  Ú
voice_onlyzgateway.voice.label_zgateway.voice.status_mode)rÐ  Úget_voice_channel_infozgateway.voice.status_channelÚchannel_name)Úchannelz!gateway.voice.status_participantsÚmember_countrÍ  ÚmembersÚis_speakingzgateway.voice.speakingrF   zgateway.voice.status_memberÚdisplay_name)rg  r?  r"  zgateway.voice.enabled_shortzgateway.voice.disabled_shortÚjoin_voice_channelzgateway.voice.help_channelszgateway.voice.help)ÚtoggleÚchannels>   r„   rC  )r4  r@  r   )rþ  r$  r=  ra   rY   Ú_voice_key_for_sourcerÃ   Ú_VOICE_MODE_BY_ARGr   Ú_handle_voice_channel_joinÚ_handle_voice_channel_leaver6  r1   Ú_get_guild_idr‚  rA  r¾  r„   )r¡   rV   rû  r<  r0  Ú	reply_keyrÐ  rÆ  Úguild_idr�  ra  r?  Ú
turning_onÚtoggle_lineÚsupports_voice_channelsrJ  r   rY   r;  s   ff              @@@r,   Ú_handle_voice_commandÚ/GatewaySlashCommandsMixin._handle_voice_command¦  sZ  üé € à×%Ñ%Ó'×-Ñ-Ó/×5Ñ5Ó7ˆØ—,‘,×&Ñ&ˆð
 ×.Ñ.¨u¯|©|Ó<ˆ	Ø×,Ñ,¨U¯\©\Ó:ˆ÷
	Sô 
	Sð Ô%Ô%Ü0°Õ6‰OˆDÙ�dŒOÜ�Y“<ÐØÐ&Ô&Ø×8Ñ8¸Ó?×?Ð?Ø�7Œ?Ø×9Ñ9¸%Ó@×@Ð@Ø�8ÕØ×#Ñ#×'Ñ'¨	°5Ó9ˆDØ8<Ð@\Ô8\”AÐ,¨T¨FÐ3Ô4ÐbfˆEÜÐ2¸%Ô@ÐAˆEØ×)Ñ)¨%Ó0ˆHß?GÌGÐT[Ð]u×LvÒLv�7×1Ñ1°(Ô;ð  }AˆDßØœ!Ð:ÀDÈÕDXÔYÜÐ?ÀtÈNÕG[Ô\ð^õ ^�à˜iŸ˜�AØ<=¿E¹EÀ-×<PÒ<PœQÐ7Ô8ÐVX�FØ—L‘L¤Ð#@ÀqÈÕGXÐagÔ!hÖiñ )ð —9‘9˜UÓ#Ð#ð ×%Ñ%×)Ñ)¨)°UÓ;¸uÑDˆ
Ù§*‘,°%Ô8Ü¿Ñ5ÐIgÓhˆð #*°Ð"5×"`Ð"`¼'À'ÐK_Ó:`Ðß7N”1Ð2Ô3ÐTVˆÜÐ%¨kÔMÐMò3 @â@ùs>   ‡CJ'ÃJ!ÃJ'Ã5J$Ã6BJ'Æ	C J'É
'J'É2J'ÊJ'Ê$J'c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   Ý  s   € ÷ )ñ )°Lð )ÀSñ )r.   c           
   ƒ  óò  "  € ^ RI Hp V P                  VP                  4      pVf   \	        R4      # V P                  4       pVP                  4       P                  4       P                  4       p\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      pRP                  R V 4       4      pVP                  4       pV'       d   V'       d   V# VP                  V4      p	V'       g   V! W”4      p
V'       d   V RV
 2# T
# V	'       g   \	        R	VR
7      #  \        V4      ^,
          p^ Tu;8:  d   \        V	4      8  g   M \	        R\        V	4      R7      # W›,          R,          pVP!                  WLV'       * R7      pVR,          '       g   \	        RVR,          R7      # \	        RVR,          VR,          R7      p\"         F‹  w  ppVP%                  V4      ;'       g    . pV'       g   K+  \        V4      ^8”  d   R\        V4      ^,
           R2MRpVR\	        VRP                  VR,          4      V,           R7      ,           ,          pK�  	  V#   \         d    Tp Lýi ; i5i)uD   Handle /rollback command â€” list or restore filesystem checkpoints.)Úformat_checkpoint_listzgateway.rollback.not_enabledc              3  óF   "  € T F  qP                  4       R9   x € K  	  R# 5i©ú--allN)r\  z--force©r=  ©rt   r_  s   & r,   rv   ÚEGatewaySlashCommandsMixin._handle_rollback_command.<locals>.<genexpr>æ  s   é € ÐPÉÀ#Ÿ)™)›+Ð)=Ö=Ëùs   ‚!TFro   c              3  óR   "  € T F  qP                  4       R9  g   K  Vx € K  	  R# 5ir[  r]  r^  s   & r,   rv   r_  ç  s   é € ÐX¡f˜s·	±	³ÐCWÑ0W—s’s£fùs   ‚'�
'r"  zgateway.rollback.none_found)Úcwdzgateway.rollback.invalid_number)ÚmaxÚhash)ÚsafeÚsuccesszgateway.rollback.restore_failedrM  rL  zgateway.rollback.restoredÚrestored_tor˜  )rc  r˜  z (+Ú)rF   r3  :Né   N)Úfiles)rØ   rY  rß   ra   r   r  rþ  r$  rS  Úanyr„   Úunsupported_backend_reasonÚlist_checkpointsrD   rH   Ú
ValueErrorÚrestoreÚ_ROLLBACK_SKIP_LINESr1   )r¡   rV   rY  Úmgrra  r^  Úrestore_allÚargr˜  ÚcheckpointsÚlistingÚidxÚtarget_hashÚresultÚmsgÚ
result_keyÚi18n_keyri  Úmores   &&                 r,   Ú_handle_rollback_commandÚ2GatewaySlashCommandsMixin._handle_rollback_commandÝ  s  é € åCØ×&Ñ& u§|¡|Ó4ˆØŠ;ÜÐ3Ó4Ð4Ø× Ñ Ó"ˆà×'Ñ'Ó)×/Ñ/Ó1×7Ñ7Ó9ˆß“cÑPÉÓP—c—c’cÑPÉÓPÓPˆØ�h‰hÑX¡fÓXÓXˆð ×/Ñ/Ó1ˆß—cØˆMØ×*Ñ*¨3Ó/ˆßÙ,¨[Ó>ˆGß-3�f�X˜R ˜yÐ)Ð@¸Ð@ßÜÐ2¸Ô<Ð<ð	3Ü�c“(˜Q•,ˆCð ˜Ö.œc +Ó.Ö.ÜÐ:ÄÀKÓ@PÔQÐQØ%Õ*¨6Õ2ˆKØ—‘˜S¸´O�ÓDˆØ�i× Ô ÜÐ6¸fÀW½oÔNÐNÜÐ+°&¸Õ2GÐPVÐW_ÕP`Ôaˆß$8Ñ ˆJ˜Ø—J‘J˜zÓ*×0Ð0¨bˆEß‰uÜ25°e³*¸q´.˜œS ›Z¨!�^Ð,¨AÑ.Àb�Ø�tœa °·	±	¸%À½)Ó0DÀtÕ0KÔLÕLÕL’ñ	 %9ð
 ˆ
øô ô 	ØŠKð	üs]   ‚A7I7Á:I7ÂAI7ÃI7ÃI7Ã6 I7ÄI7Ä%I$ Ä7B9I7Ç1I7Ç>A&I7É$I4É1I7É3I4É4I7c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›     s   € ÷ ;ñ ;°ð ;Àñ ;r.   c              ƒ  ó(  "  € VP                  4       P                  4       P                  4        Uu. uF  q"P                  4       NK  	  pp\	        RR0\        V4      ,          4      pRpV F  p\        P                  We4      pK  	  V P                  4       pVR8X  do   V P                  VP                  4      pVf   \        R4      # VP                  4       ;p	'       d   V	# \        P                  ! VP                  V4      G Rj  x€L
 p
M%^ RIHp \        P                  ! W·V4      G Rj  x€L
 p
V
P                  R4      '       g0   \        R	V
P                  R
4      ;'       g    \        R4      R7      # V P%                  W¤4      # u upi  L† Lb5i)u”   Handle /diff â€” show git changes in the working directory.  Diff body is truncated hard
here (chat is not a pager); platform senders clamp further.z--statÚstatÚworkingr    Nzgateway.diff.not_enabled)Úcollect_working_diffre  zgateway.diff.failedrM  zgateway.diff.err_defaultrL  )rþ  r$  rS  r=  rš   ÚsetÚ_DIFF_MODE_BY_ARGr1   r  rß   ra   r   rk  rU  rV  Úsession_diffÚtools.working_diffr‚  Ú_render_diff_result)r¡   rV   Úarû  Ú	stat_onlyr0  Úlowra  rp  r˜  rw  r‚  s   &&          r,   Ú_handle_diff_commandÚ.GatewaySlashCommandsMixin._handle_diff_command  sR  é € ð $)×#9Ñ#9Ó#;×#AÑ#AÓ#C×#IÑ#IÔ#KÓLÑ#K˜a—‘–	Ñ#KˆÐLÜ˜( FÐ+¬c°$«iÕ7Ó8ˆ	ØˆÛˆCÜ$×(Ñ(¨Ó3ŠDñ à× Ñ Ó"ˆØ�9Ôà×*Ñ*¨5¯<©<Ó8ˆCØŠ{ÜÐ3Ó4Ð4Ø×7Ñ7Ó9Ð9ˆvÖ9Ø�Ü"×,Ò,¨S×-=Ñ-=¸sÓC×C‰Få?Ü"×,Ò,Ð-AÈÓM×MˆFØ�z‰z˜)×$Ò$ÜÐ*°&·*±*¸WÓ2E×2fÐ2fÌÐKeÓIfÔgÐgØ×'Ñ'¨Ó:Ð:ùò' Mñ Dñ NùsA   ‚/F±F	Á	BFÃ!&FÄFÄ%FÄ-FÄ.FÅ	FÅ'(FÆFc               ó$   € V ^8„  d   QhRRRRRR/# )r$   rw  r&   r‰  rš   r)   r(   r*   )r+   s   "r,   r-   r›      s!   € ÷  ñ  ¨$ð  ¸4ð  ÀCñ  r.   c                ó’  € VP                  RR4      pVP                  RR4      pVP                  R. 4      pVP                  R4      '       g   V'       g   V'       g   V'       g   \        R4      # . pV'       d   VP                  RV R24       V'       dq   R	P                  R
 VR,           4       4      p\	        V4      ^8”  d   \        R\	        V4      ^,
          R7      MRpVP                  \        R4       RV V R24       V'       g)   V'       d!   VP                  V P                  V4      4       RP                  V4      # )zZRender a working/session diff result: stat block, untracked list, fenced (truncated) diff.r€  rF   ÚdiffÚ	untrackedÚemptyzgateway.diff.no_changesz```
ú
```r"  c              3  ó,   "  € T F
  pR V 2x € K  	  R# 5i)z+ Nr*   )rt   Úrels   & r,   rv   Ú@GatewaySlashCommandsMixin._render_diff_result.<locals>.<genexpr>+  s   é € ÐC±N¨S  3 %�j³Nùr7  :Nr  Nzgateway.diff.more_untrackedrÍ  zgateway.diff.untracked_labelz
```
ú

)r1   r   r¾  r„   rH   Ú_fenced_truncated_diff)	r¡   rw  r‰  r€  r�  r�  ÚoutÚshownr{  s	   &&&      r,   r‡  Ú-GatewaySlashCommandsMixin._render_diff_result   s  € à�z‰z˜& "Ó%ˆØ�z‰z˜& "Ó%ˆØ—J‘J˜{¨BÓ/ˆ	Ø�:‰:�g×Ò§t·DÇÜÐ.Ó/Ð/ØˆßØ�J‰J˜˜t˜f EÐ*Ô+ßØ—I‘IÑC°I¸c¶NÓCÓCˆEÜRUÐV_ÓR`ÐceÔRe”1Ð2¼#¸i».È2Õ:MÕNÐkmˆDØ�J‰Jœ!Ð:Ó;Ð<¸GÀEÀ7È4È&ÐPUÐVÔWßŸTØ�J‰J�t×2Ñ2°4Ó8Ô9Ø�{‰{˜3ÓÐr.   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r$   r�  r(   Ú	max_linesrD   Ú	max_charsr)   r*   )r+   s   "r,   r-   r›   3  s)   € ÷ -ñ - Sð -°Sð -È#ð -ÐY\ñ -r.   c                óô   € V P                  4       p\        V4      V8„  pV'       d   RP                  VRV 4      p \        V 4      V8”  d   V RV p RpRpV'       d   \        R\        V4      R7      pRV  V R2# )	z9Fence a diff body, truncating to messaging-friendly size.r"  NTrF   zgateway.diff.truncated_note)rÆ  z```diff
r’  )Ú
splitlinesrH   r„   r   )r�  rœ  r�  Ú
diff_linesÚ	truncatedÚnotes   &&&   r,   r—  Ú0GatewaySlashCommandsMixin._fenced_truncated_diff2  s   € ð —_‘_Ó&ˆ
Ü˜
“O iÑ/ˆ	ßØ—9‘9˜Z¨
¨Ð3Ó4ˆDÜˆt‹9�yÔ Ø˜
˜Ð#ˆDØˆIØˆßÜÐ2¼#¸j»/ÔJˆDØ˜4˜&   eÐ,Ð,r.   c               ó   € V ^8„  d   QhRR/# ri   r*   )r+   s   "r,   r-   r›   A  s   € ÷ ?ñ ?¨dñ ?r.   c                ó²   € \         P                  ! V4      pV P                  P                  V4       VP	                  V P                  P
                  4       R# )zXFire-and-forget *coro*, keeping a strong ref in ``_background_tasks`` until it finishes.N)rU  Úcreate_taskÚ_background_tasksÚaddÚadd_done_callbackÚdiscard)r¡   ÚcoroÚtasks   && r,   Ú_track_background_taskÚ0GatewaySlashCommandsMixin._track_background_taskA  s@   € ä×"Ò" 4Ó(ˆØ×Ñ×"Ñ" 4Ô(Ø×Ñ˜t×5Ñ5×=Ñ=Ö>r.   c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   G  s   € ÷ Zñ Z°lð ZÀsñ Zr.   c              ƒ  ó   "  € VP                  4       P                  4       pV'       g   \        R4      # R\        P                  ! 4       P                  R4       R\        P                  ! ^4      P                  4        2pT P                  T P                  Y!P                  Y0P                  V4      \        VP                  ;'       g    . 4      \        VP                  ;'       g    . 4      R7      4       \        R\!        V4      VR7      # 5i)u¤   Handle /bg <prompt> â€” run a prompt in a background thread with its own session; the
result is sent to the same chat without touching the active session's history.zgateway.background.usageÚbg_z%H%M%SÚ_)Úevent_message_idÚ
media_urlsÚmedia_typeszgateway.background.started)ÚpreviewrO  )rþ  r$  r   r   ÚnowÚstrftimeÚosÚurandomÚhexr­  Ú_run_background_taskra   r½   r    r´  rµ  rI   )r¡   rV   ÚpromptrO  s   &&  r,   Ú_handle_background_commandÚ4GatewaySlashCommandsMixin._handle_background_commandG  sÞ   é € ð ×'Ñ'Ó)×/Ñ/Ó1ˆßÜÐ/Ó0Ð0ØœŸš›×/Ñ/°Ó9Ð:¸!¼B¿JºJÀq»M×<MÑ<MÓ<OÐ;PÐQˆØ×#Ñ# D×$=Ñ$=Ø—L‘L '×<XÑ<XÐY^Ó<_ä˜E×,Ñ,×2Ð2°Ó3ÄÀe×FWÑFW×F]ÐF]Ð[]ÓA^ð %>ó %`ô 	aô Ð-´xÀÓ7GÐQXÔYÐYùs   ‚C$DÃ''Dc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   T  s   € ÷ 49ñ 49¨|ð 49Àñ 49r.   c           	   ƒ  óä  aa	a
aaaaa"  € VP                  4       P                  4       oS'       g   \        R4      # VP                  oV P                  P                  S4      G Rj  x€L
 p V P                  P                  VP                  4      G Rj  x€L
 pT'       g   \        R4      #  T P                  SR7      w  rETP                  R4      '       g   \        R4      # RT/R Uu/ uF  qfTP                  T4      bK  	  upCRTP                  /Co\        T4      o
 T P                  T P                  S4      4      oT P!                  T4      oT P#                  S4      o	\%        S4      oR	 TT	T
TTTTT3R
 llpT P'                  T! 4       4       \        RSR7      #  EL< EL  \         d    \        4       u # i ; i  \         d    R/ rT ELi ; iu upi   \         d    Ro Lªi ; i5i)uå   Handle /btw <question> â€” one-shot auxiliary LLM call on a transcript snapshot; live history
is never touched (alternation + prompt cache intact, current turn keeps running). Unlike /bg,
which spawns a fresh contextless session.zgateway.btw.usageNzgateway.btw.no_history)ra   Úapi_keyzgateway.btw.no_providerÚmodelr—  c               ó   € V ^8„  d   QhRR/# ri   r*   )r+   s   "r,   r-   ÚCGatewaySlashCommandsMixin._handle_btw_command.<locals>.__annotate__z  s   € ÷ 	Uñ 	U¨$ñ 	Ur.   c               “  ó~  <"  € ^ RI Hp   \        P                  ! V S
SSSR7      G Rj  x€L
 p\	        RS	T;'       g    RR7      pSe)   SP                  SP                  VSR
7      G Rj  x€L
  R# R#  LJ  \
         d8   p\        P                  RT4       \	        RS	\        T4      R	7      p Rp?LmRp?ii ; i LO5i)r²   )Úanswer_side_question)Úparent_agentÚmain_runtimeNzgateway.btw.answerrF   )r¶  Úanswerz/btw side question failed: %szgateway.btw.failed)r¶  rM  )rù   )Úagent.side_questionrÇ  rU  rV  r   rŸ   rþ   rÿ   r(   rý   rY   )rÇ  rÊ  r'  rÕ  Ú_thread_metadatar   Úhistory_snapshotrÉ  rÈ  r¶  Úquestionra   s       €€€€€€€€r,   Ú_run_side_questionÚIGatewaySlashCommandsMixin._handle_btw_command.<locals>._run_side_questionz  s·   øé € Ý@ðOÜ&×0Ò0Ø(¨(Ð4DØ!-¸Lô J÷ J�ô Ð.¸ÈÏÈÐRTÔU�ð Ò"Ø—l‘l 6§>¡>°5ÐCS�lÓT×TÒTñ #ñJøô ô OÜ—‘Ð>ÀÔBÜÐ.¸ÄsÈ1ÃvÔN•ûðOúñ UùsO   ƒB=‹A6 ©A4ªA6 ¾A6 Á%B=Á+B;Á,B=Á4A6 Á6B8Â-B3Â.B=Â3B8Â8B=zgateway.btw.started©r¶  )ÚproviderÚbase_urlrÂ  Úapi_mode)rþ  r$  r   ra   r–   r›  Úload_transcriptr—  r   r   Ú_resolve_session_agent_runtimerŸ   r1   r    r¥   rÄ   r¿   rÃ   rI   r­  )r¡   rV   r¤  ÚhistoryrÃ  Úrtr2   rÏ  rÌ  r   rÍ  rÉ  rÈ  r¶  rÎ  ra   s   &&      @@@@@@@@r,   Ú_handle_btw_commandÚ-GatewaySlashCommandsMixin._handle_btw_commandT  s×  ÿé € ð ×)Ñ)Ó+×1Ñ1Ó3ˆßÜÐ(Ó)Ð)Ø—‘ˆØ"×6Ñ6×LÑLÈVÓT×Tˆð	(Ø ×4Ñ4×DÑDÀ]×E]ÑE]Ó^×^ˆG÷ ÜÐ-Ó.Ð.ð	!Ø×;Ñ;À6Ð;ÓJ‰IˆEð �v‰v�i× Ò ÜÐ.Ó/Ð/à�Uð
á%TÓUÑ%T �"—&‘&˜“)Š|Ñ%TÑUð
ð ˜-×2Ñ2ñ
ˆô
   ›=Ðð	 Ø×1Ñ1°$×2NÑ2NÈvÓ2VÓWˆLð  ×/Ñ/°Ó6ÐØ×,Ñ,¨VÓ4ˆÜ˜8Ó$ˆ÷	U÷ 	Uð 	×#Ñ#Ñ$6Ó$8Ô9ÜÐ&°Ô8Ð8òY Uâ^øÜ"ô 	(Ü%Ó'Ò'ð	(ûô ô 	!Ø˜b“2ð	!üò Vøô ô 	 ØŠLð	 üs©   ŠAG0Á&F"Á'G0Á,(F( ÂF%ÂF( ÂG0Â!G0Â-G ÃG0ÃG0Ã*GÄG0Ä" G ÅA!G0Æ%F( Æ(G Æ=G0Æ?G Ç G0ÇGÇG0ÇGÇG0ÇG-Ç*G0Ç,G-Ç-G0c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   Š  s   € ÷ Rñ R°,ð RÀ3ñ Rr.   c           	   ƒ  óú   "  € ^ RI Hp ^ RIHp ^ RIHp V! VP                  VP                  4       P                  4       P                  4       V! 4       V P                  RV4      R7      pVe   V# \        R4      # 5i)u    Handle /memory â€” review pending memory writes + toggle the approval gate. Entries are small
enough to review inline, so the full flow works on every platform.©Úhandle_pending_subcommand©ré   )Úload_on_disk_storeÚmemory)Úmemory_storeÚset_mode_fnz!gateway.memory.unknown_subcommand)Ú"hermes_cli.write_approval_commandsrÞ  Útoolsré   Útools.memory_toolrà  ÚMEMORYrþ  r$  rS  rï   r   )r¡   rV   rÞ  Úwarà  r˜  s   &&    r,   Ú_handle_memory_commandÚ0GatewaySlashCommandsMixin._handle_memory_commandŠ  so   é € õ 	QÝ.Ý8ñ (Ø�I‰I�u×-Ñ-Ó/×5Ñ5Ó7×=Ñ=Ó?ÑN`ÓNbØ×3Ñ3°H¸eÓDôFˆð ’oˆsÐQ¬1Ð-PÓ+QÐQùs   ‚A9A;c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   —  s   € ÷ ñ °,ð À3ñ r.   c              ƒ  ó€  "  € ^ RI Hp ^ RIHp VP	                  4       P                  4       P                  4       pV'       d   V^ ,          P                  4       MRpVP                  VP                  4      '       * ;'       d    VR9  pV'       d,   VP                  VP                  4      ^ 8X  d   \        R4      # V! VP                  W@P                  RV4      R7      pVf   \        R4      # VR8X  dG   \        V4      R	8”  d7   \        V4      ^8”  d
   V^,          MR
pVR,          \        RVR7      ,           pV# 5i)uí   Handle /skills on the gateway â€” pending skill-write review only (hub stays CLI-only). Gated
by ``skills.write_approval`` but still answers when staged writes exist after the gate is off
(never stranded). ``diff`` is truncated for chat.rÝ  rß  rF   zgateway.skills.gate_offÚskills)rã  z!gateway.skills.unknown_subcommandr�  é¸  z<id>:Ni¸  Nzgateway.skills.diff_truncated)Ú
pending_id>   r0  Úapproval)rä  rÞ  rå  ré   rþ  r$  rS  r=  Úwrite_approval_enabledÚSKILLSÚpending_countr   rï   rH   )	r¡   rV   rÞ  rè  rû  ÚsubÚgate_offr˜  rï  s	   &&       r,   Ú_handle_skills_commandÚ0GatewaySlashCommandsMixin._handle_skills_command—  s   é € õ 	QÝ.Ø×%Ñ%Ó'×-Ñ-Ó/×5Ñ5Ó7ˆß!%ˆd�1�g�m‰mŒo¨2ˆØ×0Ñ0°·±Ó;Ô;×_Ð_ÀÐK_Ñ@_ˆß˜×(Ñ(¨¯©Ó3°qÔ8ÜÐ.Ó/Ð/Ù'Ø�I‰I�t×)DÑ)DÀXÈuÓ)UôWˆàŠ;ÜÐ8Ó9Ð9ð �&Œ=œS ›X¨œ_Ü$'¨£I°¤M˜˜až°vˆJØ�e•*œqÐ!@ÈZÔXÕXˆCØˆ
ùs   ‚B D>ÂD>ÂB-D>c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   ®  s   € ÷ <ñ <°\ð <Àcñ <r.   c              ƒ  ó6  "  € ^ RI Hp ^ RIHp VP	                  4       P                  4       ;'       g    RpV! WP                  4      pV'       d7   VP                  VP                  P                  4      '       g   \        R4      # V! V4      P                  # 5i)zAShow or persist the profile-wide dangerous-command approval mode.r,  )Úrun_approval_mode_commandNzgateway.approvals.admin_only)r<  r-  Úhermes_cli.approval_moderú  rþ  r$  ra   r>  r_   r   Úmessage)r¡   rV   r-  rú  Ú	requestedrÜ   s   &&    r,   Ú_handle_approvals_commandÚ3GatewaySlashCommandsMixin._handle_approvals_command®  st   é € åAÝFØ×*Ñ*Ó,×2Ñ2Ó4×<Ð<¸ˆ	ñ *¨$·±Ó=ˆß˜VŸ_™_¨U¯\©\×-AÑ-A×BÒBÜÐ3Ó4Ð4ñ )¨Ó3×;Ñ;Ð;ùs   ‚A9BÁ<Bc               ó    € V ^8„  d   QhRRRR/# r…  r*   )r+   s   "r,   r-   r›   ½  s   € ÷ `ñ `°ð `ÐAUñ `r.   c              ƒ  óŒ  aa"  € ^ RI Hp V P                  VP                  4      oRRrCV P                  ;oeA   V P
                  P                  VP                  4      G Rj  x€L
 P                  RJ pVV3R lp\        P                  ! VSW4R7      G Rj  x€L
 p\        \        V'       d   R4      4      # R4      4      #  L^ L,5i)	u�   Handle /yolo â€” toggle dangerous command approval bypass for this session only. The flag is
persisted on the routing entry so it survives a gateway restart.)Útoggle_session_yoloFNTc                ó(   <€ SP                  SV 4      # rq   )Úset_session_yolo)Úonr™   Ústores   &€€r,   Ú<lambda>Ú@GatewaySlashCommandsMixin._handle_yolo_command.<locals>.<lambda>Æ  s   ø€  ×!7Ñ!7¸ÀRÔ!Hr.   )Ú	persistedÚpersistzgateway.yolo.enabledzgateway.yolo.disabled)Útools.approval_yolor  rÄ   ra   Úsession_storer–   r›  ÚyolorU  rV  r   r   )r¡   rV   r  r	  r
  Úenabler™   r  s   &&    @@r,   Ú_handle_yolo_commandÚ.GatewaySlashCommandsMixin._handle_yolo_command½  s©   ùé € õ 	<Ø×2Ñ2°5·<±<Ó@ˆØ" D�7Ø×'Ñ'Ð'ˆEÒ4à#×7Ñ7×MÑMÈeÏlÉlÓ[×[×aÑaÐeiÐiˆIÝHˆGä×(Ò(Ð)<¸kÐU^Ôp×pˆÜœa¿&Ð 6Ó^Ó_Ð_ÐF]Ó^Ó_Ð_ñ	 \ñ qùs$   „ACÁ!C Á"3CÂCÂ+CÃCc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   Ë  s   € ÷ !Rñ !R°<ð !RÀCñ !Rr.   c              ƒ  óô  "  € ^ RI Hp ^ RIHp V P	                  V4      w  rEV! WP
                  4      p V! 4       p\        \        VRR4      RR7      pV'       g   Vf   \        R4      # ^ R	I
Hp	 . ROVe   . MR.,           p
Ve   \        VRR4      MR;'       g    V	! WuRR
4      pYªP                  Wº9   d   TMR
4      ^,           \        V
4      ,          ,          pVe   WÆn        \        RV 24      p \!        VRRVR3V4       V R2\        RVR7      ,           #   \         d    / Rr‡ LÛi ; i  \         d8   p\"        P%                  RT4       T R2\        RTR7      ,           u Rp?# Rp?ii ; i5i)ué   Handle /verbose â€” cycle tool progress display mode (off â†’ new â†’ all â†’ verbose â†’ log) per
*current platform*, saved to ``display.platforms.<platform>.tool_progress``. Gated by
``display.tool_progress_command`` (default off).©rÎ   )Ú
local_liver&  Útool_progress_commandF)ÚdefaultNzgateway.verbose.not_enabled)Úresolve_display_settingr   ÚlogÚtool_progress_modeÚtool_progresszgateway.verbose.mode_rµ  r"  zgateway.verbose.saved_suffix)rX   z%Failed to save tool_progress mode: %szgateway.verbose.save_failedrL  )r4  Únewr   Úverbose)rª   rÎ   Ú gateway.session_setting_commandsr  r  ra   r   r   rŸ   r   Úgateway.display_configr  rc   ÚindexrH   r  r@   rþ   rÿ   )r¡   rV   rÎ   r  r5   Úplatform_keyÚliverì   Úgate_enabledr  ÚcycleÚcurrentÚnew_modeÚdescriptionrÕ  s   &&             r,   Ú_handle_verbose_commandÚ1GatewaySlashCommandsMixin._handle_verbose_commandË  sŠ  é € õ 	5Ý?Ø$(×$?Ñ$?ÀÓ$FÑ!ˆÙ˜$§¡Ó-ˆð	2Ù.Ó0ˆKÜ*¬7°;À	ÐKbÓ+cØ38ô:ˆL÷
  ¢ÜÐ2Ó3Ð3õ 	CÚ0¸$Ò:J±BÐQVÐPWÕXˆØ@DÒ@P”7˜4Ð!5°tÔ<ÐVZ÷ Wð WÙ# K¸ÐPUÓVð 	àŸ+™+°Ô1A¡gÀuÓMÐPQÕQÔUXÐY^ÓU_Õ_Õ`ˆØÒØ&.Ô#ÜÐ/°¨zÐ:Ó;ˆð	RÜ" ;°¸KÈÐWfÐ0gÐiqÔrØ!�] "Ð%¬Ð*HÐS_Ô(`Õ`Ð`øô% ô 	2Ø(*¨Ešð	2ûô& ô 	RÜ�N‰NÐBÀAÔFØ!�] "Ð%¬Ð*GÈqÔ(QÕQÕQûð	Rüsf   ‚2E8µD ÁE8ÁA E8ÂAE8Ã7'D3 ÄE8ÄD0Ä-E8Ä/D0Ä0E8Ä3E5Ä>,E0Å*E5Å+E8Å0E5Å5E8c               ó    € V ^8„  d   QhRRRR/# r…  r*   )r+   s   "r,   r-   r›   î  s   € ÷ hñ h°ð hÐAUñ hr.   c           
   ƒ  óÐ  "  € ^ RI HpHp VP                  4       P	                  4       P                  4       pV! WP                  4      pV'       d   VR8X  do   Ve	   V! W4      MV P                  VP                  4      p\        \        P                  V\        R,          4      ^ ,          4      p\        \        RWgR7      4      # V\        9  d   \        \        RVR7      4      # ^ RIHp V! R	V4      '       g   \        \        R
4      4      # Ve   WEn        V P                  VP                  4      p	V	'       d   ^ RIHp
 V P%                  Wš! 4       4       MW@n        V P)                  4       V n        V P-                  VP                  4      pVe!   V P/                  VP                  4      Vn        \        \        RV\        \        V,          ^,          4      R7      4      # 5i)uM   Handle /busy â€” control what happens when messaging while Hermes is working.)r  Úsession_busy_moder?  r   zgateway.busy.status)r0  Úbehaviorzgateway.busy.unknown_mode)rr  ©Úsave_config_valuezdisplay.busy_input_modezgateway.busy.save_failedr  zgateway.busy.set)r  r  r+  rþ  r$  r=  ra   Ú_effective_busy_input_moder   Ú_BUSY_MODE_BEHAVIORr1   r   Úclir.  Úbusy_input_modeÚ_busy_profile_name_for_sourcerª   rÎ   Ú_snapshot_profile_busy_modesÚ_busy_input_modeÚ_load_busy_text_modeÚ_busy_text_moderÃ   Ú_effective_busy_text_mode)r¡   rV   r  r+  rr  r!  r0  r,  r.  r  rÎ   r   s   &&          r,   Ú_handle_busy_commandÚ.GatewaySlashCommandsMixin._handle_busy_commandî  s…  é € çRØ×$Ñ$Ó&×,Ñ,Ó.×4Ñ4Ó6ˆÙ˜$§¡Ó-ˆß�c˜X”oØ48Ò4DÑ$ TÔ0È$×JiÑJiÐjo×jvÑjvÓJwˆDÜÔ,×0Ñ0°Ô7JÈ;Õ7WÓXÐYZÕ[Ó\ˆHÜ!¤!Ð$9ÀÔ"XÓYÐYØÔ)Ô)Ü!¤!Ð$?ÀSÔ"IÓJÐJõ 	*Ù Ð!:¸C×@Ò@Ü!¤!Ð$>Ó"?Ó@Ð@ØÒØ#&Ô Ø×9Ñ9¸%¿,¹,ÓGˆßÝ8Ø×-Ñ-¨lÐ<PÓ<RÕSà$'Ô!ð $(×#<Ñ#<Ó#>ˆDÔ à×,Ñ,¨U¯\©\Ó:ˆØÒØ&*×&DÑ&DÀUÇ\Á\Ó&RˆGÔ#ÜœaÐ 2¸ÄqÔI\Ð]`ÕIaÐbcÕIdÓGeÔfÓgÐgùs   ‚C9G&Ã<A G&Ä=B)G&c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›     s   € ÷ &Sñ &S°,ð &SÀ3ñ &Sr.   c           	   ƒ  ó  "  € ^ RI HpHp ^ RIHpHp V P                  V4      w  rgVP                  4       P                  4       P                  4       p V! 4       p	T! Y—4      pR R lpTR9   dE   \        RT! TR	,          4      R
P                  TP                  R4      ;'       g    . 4      TR7      # T'       d   T\        9  d   \        R4      # T'       d   \        T,          MTR	,          '       * p TP                  P                   \"        P$                  8X  d   RRT3MRR,           p\'        YnT4       RpT'       dM   T! T! T	4      ;'       g    R^ RTP                  R4      ;'       g    . ROR7      pT'       d   \        RTR7      p\        RT! T4      TR7      #   \         d   p
\        RT
R7      u Rp
?
# Rp
?
ii ; i  \         d.   p
\(        P+                  RT
4       \        RT
R7      u Rp
?
# Rp
?
ii ; i5i)u>   Handle /footer command â€” toggle the runtime-metadata footer.)rÎ   Ú_resolve_gateway_model)Úformat_runtime_footerÚresolve_footer_configzgateway.config_read_failedrL  Nc               ó    € V ^8„  d   QhRRRR/# )r$   rÕ   rš   r)   r(   r*   )r+   s   "r,   r-   ÚFGatewaySlashCommandsMixin._handle_footer_command.<locals>.__annotate__  s   € ÷ 	^ñ 	^˜Dð 	^ Sñ 	^r.   c                ó>   € V '       d   \        R 4      # \        R4      # )zgateway.footer.state_onzgateway.footer.state_offr   r   s   &r,   Ú_stateÚ@GatewaySlashCommandsMixin._handle_footer_command.<locals>._state  s   € ß3:”1Ð.Ó/Ð]ÄÐB\Ó@]Ð]r.   zgateway.footer.statusrÕ   r3  rÞ   )ÚstaterÞ   rX   zgateway.footer.usager&  rµ  z)Failed to save runtime_footer.enabled: %szgateway.config_save_failedrF   )rÃ  Úcontext_tokensÚcontext_lengthrÞ   zgateway.footer.example_linerÑ  zgateway.footer.saved)rE  Úexample>   r.  r?  )r&  )Úruntime_footerrÕ   )rÃ  Úcontext_pctra  )rª   rÎ   r=  Úgateway.runtime_footerr>  r?  r  rþ  r$  r=  rŸ   r   r„   r1   Ú_FOOTER_STATE_BY_ARGra   rX   r
   r#  r@   rþ   rÿ   )r¡   rV   rÎ   r=  r>  r?  r5   r   rr  rì   rÕ  Ú	effectiverC  Ú	new_stater?   rH  r¶  s   &&               r,   Ú_handle_footer_commandÚ0GatewaySlashCommandsMixin._handle_footer_command  sÆ  é € çLßWØ$(×$?Ñ$?ÀÓ$FÑ!ˆØ×$Ñ$Ó&×,Ñ,Ó.×4Ñ4Ó6ˆð	<Ù 4Ó 6ˆKñ *¨+ÓDˆ	õ	^à�/Ô!ÜÐ,±F¸9ÀYÕ;OÓ4PØ ŸI™I i§m¡m°HÓ&=×&CÐ&CÀÓDÈ|ô]ð ]ç�3Ô2Ô2ÜÐ+Ó,Ð,ß14Ô(¨Ö-¸iÈ	Õ>RÔ:Rˆ	ð		<ð ?D¿l¹l×>SÑ>SÔW_×WeÑWeÔ>e�Y ¨\Ñ:Ø%Ð)FõGˆDä" ;°iÔ@ð ˆßá+Ù,¨[Ó9×AÐA¸TÐRSÐdhØ —}‘} XÓ.×QÐQÒ2QôSˆG÷ ÜÐ9À7ÔK�ÜÐ'©v°iÓ/@È'ÔRÐRøô= ô 	<ÜÐ1¸Ô;Õ;ûð	<ûô& ô 	<Ü�N‰NÐFÈÔJÜÐ1¸Ô;Õ;ûð	<üs’   ‚AHÁF" ÁAHÂ&HÂ;HÃHÃ5AG Ä8	HÅHÅHÅ/HÆ!HÆ"GÆ-F?Æ9GÆ:HÆ?GÇHÇG?Ç"G:Ç4G?Ç5HÇ:G?Ç?Hc               ó    € V ^8„  d   QhRRRR/# ©r$   rV   r   r)   r�   r*   )r+   s   "r,   r-   r›   7  s   € ÷  Qñ  Q°lð  QÀ}ñ  Qr.   c              ƒ  ó²  a aa"  € S P                  SP                  4      oS P                  4       p\        V\        4      '       d   VP                  R4      MRp\        V\        4      '       d2   VP                  RR4      '       g   S P                  S4      G Rj  x€L
 # R VV V3R llpS P                  SRR\        R	4      VR
7      G Rj  x€L
 #  L6 L5i)u  Handle /reload-mcp â€” reconnect MCP servers and rebuild the cached agent. Reloading
invalidates the provider prompt cache (tool schemas live in the system prompt), so it routes
through slash-confirm; "Always Approve" persists ``approvals.mcp_reload_confirm: false``.Ú	approvalsNÚmcp_reload_confirmTc               ó    € V ^8„  d   QhRRRR/# )r$   Úchoicer(   r)   r�   r*   )r+   s   "r,   r-   ÚJGatewaySlashCommandsMixin._handle_reload_mcp_command.<locals>.__annotate__E  s   € ÷ 	ñ 	 cð 	¨mñ 	r.   c              “  óX  <"  € V R 8X  d   \        R4      # V R8X  d'    ^ RIHp V! RR4       \        P	                  RS4       SP                  S4      G Rj  x€L
 pV R8X  d   V R	2\        R
4      ,           # V#   \
         d!   p\        P                  RT4        Rp?L]Rp?ii ; i LP5i)Úcancelzgateway.reload_mcp.cancelledr"   r-  zapprovals.mcp_reload_confirmFz7User opted out of /reload-mcp confirmation (session=%s)z.Failed to persist mcp_reload_confirm=false: %sNr–  z"gateway.reload_mcp.always_followup)r   r1  r.  rþ   r�  rŸ   rÿ   Ú_execute_mcp_reload)rW  r.  r  rw  rV   r¡   r™   s   &   €€€r,   Ú_on_confirmÚIGatewaySlashCommandsMixin._handle_reload_mcp_command.<locals>._on_confirmE  s«   øé € Ø˜Ô!ÜÐ7Ó8Ð8Ø˜Ô!ðZÝ5Ù%Ð&DÀeÔLÜ—K‘KÐ YÐ[fÔgð  ×3Ñ3°EÓ:×:ˆFØ˜Ô!Ø ˜ �¬Ð+OÓ)PÕPÐPØˆMøô !ô ZÜ—N‘NÐ#SÐUX×YÑYûðZúñ ;ùs:   ƒB*ž%A: ÁB*ÁB(Á"B*Á:B%ÂB ÂB*Â B%Â%B*z
reload-mcpz/reload-mcpz!gateway.reload_mcp.confirm_prompt)rV   rK   Útitlerü  Úhandler)	rÄ   ra   Ú_read_user_configr0   r&   r1   r[  Ú_request_slash_confirmr   )r¡   rV   rì   rT  r\  r™   s   ff   @r,   Ú_handle_reload_mcp_commandÚ4GatewaySlashCommandsMixin._handle_reload_mcp_command7  sÅ   úé € ð ×2Ñ2°5·<±<Ó@ˆð ×,Ñ,Ó.ˆÜ4>¸{ÌD×4QÒ4Q�K—O‘O KÔ0ÐW[ˆ	Ü�i¤×&Ò&¨y¯}©}Ð=QÐSW×/XÒ/XØ×1Ñ1°%Ó8×8Ð8÷	ò 	ð  ×0Ñ0Ø °]ÜÐ9Ó:ÀKð 1ó Q÷ Qð 	Qñ) 9ñ(Qùs*   …BCÂCÂCÂ1CÃCÃCÃCc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   Y  s   € ÷ 9>ñ 9>¸ð 9>È#ñ 9>r.   c           
   ƒ  ó<  "  €  ^ RI Hp V P                  V4      G Rj  x€L
 pVP                  R. 4      VP                  R. 4      rTVP                  R^ 4      p\	        V P
                  P                  4       4       FS  p\        VRR4      p \        V4      '       d   V! 4       MRp	\        P                  ! V	4      '       d   V	G Rj  x€L
  KS  KU  	  \        R	4      .pV'       g9   V'       g1   V\        R
4      \        RVR7      .,          pRP                  V4      # R R lpR.pRRV3RRV33 FS  w  rïpV'       g   K  V Uu. uF  pV! V4      NK  	  ppV\        V4      .V,           ,          pVRV.V,           ,          pKU  	  VP!                  \        RVR7      4       VRR.,          pV P#                  VP$                  4      p\'        V R4      '       g   / V n        V'       d   RP                  V4      V P(                  V&   RP                  V4      #  ELü ELV  \         d/   p
\        P                  R\        TRT4      T
4        Rp
?
EKÙ  Rp
?
ii ; iu upi   \         d.   p\        P                  RT4       \        RTR7      u Rp?# Rp?ii ; i5i)uM  Handle /reload-skills â€” rescan skills dir, queue a note for next turn. Skills are invoked at
runtime, not baked into the system prompt, so this does NOT clear the prompt cache. The diff
goes into ``_pending_skills_reload_notes[session_key]``, prepended to the NEXT user message â€”
nothing out-of-band, so alternation is preserved.)Úreload_skillsNÚaddedÚremovedÚtotalÚrefresh_skill_groupz)Adapter %s refresh_skill_group raised: %srg  zgateway.reload_skills.headerzgateway.reload_skills.no_newzgateway.reload_skills.totalrÍ  r"  c               ó    € V ^8„  d   QhRRRR/# )r$   Úitemr&   r)   r(   r*   )r+   s   "r,   r-   ÚMGatewaySlashCommandsMixin._handle_reload_skills_command.<locals>.__annotate__x  s   € ÷ Oñ O ð O¨ñ Or.   c                óŒ   € V P                  R R4      V P                  RR4      r!V'       d   \        RWR7      # \        RVR7      # )rg  rF   r&  z$gateway.reload_skills.item_with_desc)rg  Údescz"gateway.reload_skills.item_no_descr¼  )r1   r   )rl  Únmro  s   &  r,   Ú	_fmt_lineÚJGatewaySlashCommandsMixin._handle_reload_skills_command.<locals>._fmt_linex  sC   € ØŸ8™8 F¨BÓ/°·±¸-ÈÓ1L�DßY]œÐ@ÀrÔUð OÜÐCÈ"ÔMðOr.   z[USER INITIATED SKILLS RELOAD:z"gateway.reload_skills.added_headerzAdded Skills:z$gateway.reload_skills.removed_headerzRemoved Skills:rF   z,Use skills_list to see the updated catalog.]Ú_pending_skills_reload_noteszSkills reload failed: %szgateway.reload_skills.failedrL  )Úagent.skill_commandsrf  Ú_run_in_executor_with_contextr1   r    r  rÀ  rc   r"  ÚinspectÚisawaitablerŸ   rþ   rÿ   r   r„   r¾  rÄ   ra   r‚  rs  )r¡   rV   rf  rw  rg  rh  ri  r   ÚrefreshÚmayber  rÆ  rq  Úsectionsrz  Únote_headerrÚ   rl  Ú	formattedr™   rÕ  s   &&                   r,   Ú_handle_reload_skills_commandÚ7GatewaySlashCommandsMixin._handle_reload_skills_commandY  sd  é € ð
4	>Ý:ð  ×=Ñ=¸mÓL×LˆFØ#ŸZ™Z¨°Ó4°f·j±jÀÈBÓ6O�7Ø—J‘J˜w¨Ó*ˆEô   §¡× 4Ñ 4Ó 6Ö7�Ü! 'Ð+@À$ÓG�ðKÜ)1°'×):Ò):™GœIÀ�EÜ×*Ò*¨5×1Ò1Ø#Ÿšñ 2ñ	 8ô Ð5Ó6Ð7ˆEß§Øœ!Ð:Ó;¼QÐ?\ÐdiÔ=jÐkÕk�Ø—y‘y Ó'Ð'õOð 9Ð9ˆHà5°ÈÐNØ7Ð9JÈGÐTó1VÑ,� u÷ ‘5Ù=BÓ C¹U°T¡¨4¦¹U�IÐ CØœa ›k˜]¨YÕ6Õ6�EØ  [Ð 1°IÕ =Õ=’Hñ1Vð �L‰LœÐ8ÀÔFÔGØ˜ÐKÐLÕLˆHØ×6Ñ6°u·|±|ÓDˆKÜ˜4Ð!?×@Ò@Ø46�Ô1ßØAEÇÁÈ8ÓAT�×1Ñ1°+Ñ>Ø—9‘9˜UÓ#Ð#òY Mò $øÜ ô KÜ—N‘NÐ#NÜ#*¨7°F¸GÓ#DÀc÷Kó KûðKüò, !Døô ô 	>Ü�N‰NÐ5°qÔ9ÜÐ3¸1Ô=Õ=ûð	>üs²   ‚J„I! žHŸA,I! Â5H ÃH ÃHÃH Ã!I! Ã./I! ÄJÄI! ÅI! ÅIÅBI! Ç+.I! ÈJÈI! ÈH È IÈ+"IÉI! ÉIÉI! É!JÉ,"JÊJÊJÊJÊJc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   ”  s   € ÷ Iñ I°<ð IÀCñ Ir.   c           
   ƒ  ó°  "  € \        R4      pRVP                  9   d4   \        P                  RVP                  R,          4       VP                  # VP                  R,          pV'       g   \        RVP                  R,          R7      # \        R\        V4      R7      R	.pV F…  pVP                  R
. 4      pVP                  R4      ;'       g    \        R\        V4      R7      pT\        RVR,          V\        V4      R7      .V Uu. uF  pRV 2NK
  	  up,           ,          pK‡  	  RP                  VR	\        R4      .,           4      # u upi 5i)uš   Handle /bundles â€” list installed skill bundles (mirrors the CLI handler). Bundles are
loaded by invoking their own ``/<slug>`` command, not by this one.ÚbundlesrM  zBundles command unavailable: %szgateway.bundles.noneÚdir)r‚  zgateway.bundles.headerrÍ  rF   rí  r&  zgateway.bundles.default_desczgateway.bundles.itemÚslug)rƒ  ro  rÎ  u       Â· r"  zgateway.bundles.invoke_hint)	rS   rd   rþ   rÿ   rB   r   rH   r1   r„   )	r¡   rV   r'  r�  rÆ  r�  rí  ro  Úss	   &&       r,   Ú_handle_bundles_commandÚ1GatewaySlashCommandsMixin._handle_bundles_command”  sD  é € ô ˜Ó#ˆØ�e—j‘jÔ Ü�N‰NÐ<¸e¿j¹jÈÕ>QÔRØ—:‘:ÐØ—*‘*˜YÕ'ˆßÜÐ+°·±¸EÕ1BÔCÐCÜÐ+´3°w³<Ô@À"ÐEˆÛˆDØ—X‘X˜h¨Ó+ˆFØ—8‘8˜MÓ*×bÐb¬aÐ0NÔVYÐZ`ÓVaÔ.bˆDØ”aÐ.°T¸&µ\ÈÔTWÐX^ÓT_Ô`Ðañ  }Có  eDñ  }CÐwxÐgnÐopÐnqÓerñ  }Cñ  eDõ  Dõ  DŠEñ ð �y‰y˜ "¤aÐ(EÓ&FÐ!GÕGÓHÐHùò eDùs   ‚A*EÁ-A$EÃ;EÄE
Ä;Ec               ó$   € V ^8„  d   QhRRRRRR/# )r$   rV   r   Ú	stale_keyr(   Únone_keyr*   )r+   s   "r,   r-   r›   ¥  s"   € ÷ 
(ñ 
(°ð 
(È#ð 
(ÐY\ñ 
(r.   c                óò   € ^ RI Hp V P                  VP                  4      pV! V4      '       d   VR3# WPP                  9   d)   V P                  P                  V4       V\        V4      3# V\        V4      3# )z´``(session_key, None)`` when an agent thread is blocked on approval, else the reply to send.
A pending-approvals entry with no blocked thread is a stale prompt: drop it and say so.)Úhas_blocking_approvalN)Útools.approvalr‹  rÄ   ra   Ú_pending_approvalsÚpopr   )r¡   rV   rˆ  r‰  r‹  r™   s   &&&&  r,   Ú_blocking_approval_or_staleÚ5GatewaySlashCommandsMixin._blocking_approval_or_stale¥  so   € õ 	9Ø×2Ñ2°5·<±<Ó@ˆÙ  ×-Ò-Ø Ð$Ð$Ø×1Ñ1Ô1Ø×#Ñ#×'Ñ'¨Ô4Ø¤ )£Ð,Ð,ØœA˜h›KÐ'Ð'r.   c               ó    € V ^8„  d   QhRRRR/# rR  r*   )r+   s   "r,   r-   r›   ±  s   € ÷ ^ñ ^°<ð ^ÀMñ ^r.   c              ƒ  ó&  "  € ^ RI Hp V P                  VRR4      w  r4V'       d   V# VP                  4       P	                  4       P                  4       P                  4       pV Uu0 uF  qf\        9   g   K  \        V,          kK  	  ppRV9   d   RM
RV9   d   RMRpV! W8RV9   R7      p	V	'       g   \        R4      # \        R	T R
V	^8”  d   RMR 2V	R7      p
\        P                  RW˜4       V P                  WR4      G Rj  x€L
 # u upi  L	5i)u²   Handle /approve â€” unblock waiting agent thread(s). They block inside tools/approval.py;
signalling the event resumes them so the command executes inline (same flow as the CLI).©Úresolve_gateway_approvalzgateway.approval_expiredzgateway.approve.no_pendingr"   r    Úoncer   )Úresolve_allzgateway.approve.r²  ÚpluralÚsingularrÍ  z7User approved %d dangerous command(s) via /approve (%s)ÚapproveN)rŒ  r”  r�  rþ  r$  r=  rS  Ú_APPROVE_CHOICE_BY_ARGr   rþ   r�  r  )r¡   rV   r”  r™   Ústalerû  rˆ  ÚchoicesrW  rÎ  rò   s   &&         r,   Ú_handle_approve_commandÚ1GatewaySlashCommandsMixin._handle_approve_command±  s  é € õ 	<Ø!×=Ñ=¸eÐE_Ø>Zó\ÑˆçØˆLà×%Ñ%Ó'×-Ñ-Ó/×5Ñ5Ó7×=Ñ=Ó?ˆÙ6:ÓZ±d°ÔCYÑ>YÔ,Ô)¨!×,Ð,±dˆÐZØ%¨Ô0‘À9ÐPWÔCW±iÐ]cˆÙ(¨È%ÐSWÉ-ÔXˆßÜÐ1Ó2Ð2ÜÐ 0°°¸ÀeÈaÄi¹(ÐU_Ð9`ÐaÐinÔoÐÜ�‰ÐMÈuÔ]Ø×8Ñ8¸ÐS\Ó]×]Ð]ùò [ñ ^ùs%   ‚A$DÁ&D
Á7D
ÂA=DÄDÄ
Dc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   Ä  s   € ÷ [ñ [°ð [Àñ [r.   c              ƒ  ó¸  "  € ^ RI Hp V P                  VRR4      w  r4V'       d   V# VP                  4       P	                  4       pVP                  4       p\        V4      ;'       d    V^ ,          P                  4       R8H  pV'       d$   V\        V^ ,          4      R P	                  4       MTR,          P	                  4       pT! TRYx;'       g    RR7      p	V	'       g   \        R4      # \        P                  R	T	V'       d   R
MR4       RV'       d   RMR,           V	^8”  d   RMR,           p
\        W©VR7      pV P                  WR4      G Rj  x€L
 #  L5i)ug  Handle /deny â€” reject pending dangerous command(s) with a definitive BLOCKED result, as in
the CLI. ``/deny`` denies the oldest; ``/deny all`` denies everything.

``/deny <reason>`` (or ``/deny all <reason>``) attaches a one-line reason that is relayed back to
the agent so it can adapt instead of only hearing "denied". Ported from qwibitai/nanoclaw#2832.
r“  zgateway.deny.stalezgateway.deny.no_pendingr   N:Ni  NÚdeny)r–  r˜  z/User denied %d dangerous command(s) via /deny%sz (with reason)rF   zgateway.deny.deniedÚ_reasonÚ_pluralÚ	_singular)rÎ  r˜  )rŒ  r”  r�  rþ  r$  rS  rš   r=  rH   r   rþ   r�  r  )r¡   rV   r”  r™   r›  Úraw_argsr^  r–  r˜  rÎ  r‰  rò   s   &&          r,   Ú_handle_deny_commandÚ.GatewaySlashCommandsMixin._handle_deny_commandÄ  s)  é € õ 	<Ø!×=Ñ=¸eÐEYØ>WóYÑˆçØˆLð ×)Ñ)Ó+×1Ñ1Ó3ˆØ—‘Ó!ˆÜ˜6“l×AÐA v¨a¥y§¡Ó'8¸EÑ'Aˆß7B�(œ3˜v a�y›>˜?Ð+×1Ñ1Ô3ÈÐRVÕW×]Ñ]Ó_ˆÙ(¨°fÈ+×^lÐ^lÐhlÔmˆßÜÐ.Ó/Ð/Ü�‰ÐEÀuß(.Ñ$°Bô	8à#·F¡yÀÕCÐTYÐ\]ÔT]ÁyÐcnÕoˆÜ˜c°vÔ>ÐØ×8Ñ8¸ÐSYÓZ×ZÐZÑZùs7   ‚A%EÁ("EÂAEÃEÃ"#EÄEÄ<EÅEÅEc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   ß  s   € ÷ >ñ >°<ð >ÀCñ >r.   c              ƒ  óú   aaaaa"  € ^ RI o^ RIHoHo ^ RIHo \        P                  ! VP                  4       ;'       g    R4      ;'       g    R.oR VVVVV3R llpV P                  V4      G Rj  x€L
 #  L5i)u  Handle /curator â€” the ``hermes curator`` handler set (status by default), as main's CLI ran
it in-process; its printed report is the reply. Runs in the executor with the session's
context so the profile's skills tree and curator state are the ones read and written.N)Úredirect_stderrÚredirect_stdout)Úcli_mainrF   r?  c               ó   € V ^8„  d   QhRR/# r°   r*   )r+   s   "r,   r-   ÚGGatewaySlashCommandsMixin._handle_curator_command.<locals>.__annotate__è  s   € ÷ 		+ñ 		+�cñ 		+r.   c                 ó–  <€ SP                  4       p S! V 4      ;_uu_ 4        S! V 4      ;_uu_ 4         S! S4       RRR4       RRR4       V P                  4       P                  4       #   \         d     L;\         d!   p\        \	        R TR7      4        Rp?L`Rp?ii ; i  + '       g   i     Lp; i  + '       g   i     L{; i)zcli.commands.curator.failedrL  N)ÚStringIOÚ
SystemExitrŸ   Úprintr   Úgetvaluer[  )r˜  r  r¬  Úiorª  r«  r^  s     €€€€€r,   Ú_runÚ?GatewaySlashCommandsMixin._handle_curator_command.<locals>._runè  s’   ø€ Ø—+‘+“-ˆCÙ  ×%Õ%¡°s×';Õ';ðGÙ˜VÔ$÷ (<×%ð —<‘<“>×(Ñ(Ó*Ð*øô	 "ô ÙÜ ô GÜœ!Ð9ÀÔE×FÑFûðGú÷ (<×';ú×%×%úsV   ¢B8³B%	µA+½B8Á+B"Á6B%	Á8B"ÂB"ÂBÂB%	ÂB"Â"B%	Â%B5Â0B8Â8C	)
r´  Ú
contextlibrª  r«  Úhermes_cli.curatorr¬  rr   rS  rþ  ru  )r¡   rV   rµ  r¬  r´  rª  r«  r^  s   && @@@@@r,   Ú_handle_curator_commandÚ1GatewaySlashCommandsMixin._handle_curator_commandß  s]   üé € ó 	ß?Ý/Ü—’˜U×3Ñ3Ó5×;Ð;¸Ó<×JÐJÀÀ
ˆ÷		+ô 		+ð ×7Ñ7¸Ó=×=Ð=Ñ=ùs   ‡AA;Á%A;Á4A9Á5A;c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   õ  s   € ÷ -Mñ -M°ð -MÀ#ñ -Mr.   c              ƒ  ó  aaaa	a
aaaa"  € ^ RI HoHoHoHo	Ho
HoHo ^ RIH	o RVP                  4       ;'       g    RP                  4        Uu0 uF  q"P                  4       kK  	  up9   pV'       d6   \        VP                  RR4      \        P                   8w  d   \#        R4      # V'       d&   ^ RI Ho V3R	 lpV P'                  V4      G Rj  x€L
 # VVVV	V
VVV3R
 lpV P'                  V4      G Rj  x€L
 # u upi  L/ L5i)u    Handle /debug â€” upload ONLY the summary (system info + log tails), never full logs, to
protect privacy; ``hermes debug share`` from the CLI does full uploads.)Ú_GATEWAY_PRIVACY_NOTICEÚ!_best_effort_sweep_expired_pastesÚ_capture_dumpÚ_is_dpaste_urlÚ_schedule_auto_deleteÚcollect_debug_reportÚupload_to_pastebin)Úredact_debug_support_textÚlocalrF   rX   Nzgateway.debug.local_refused©Úcollect_share_bundlec                 ó$   <€ S ! ^ÈR7      R,          # )éÈ   )Ú	log_linesÚreportr*   rÆ  s   €r,   Ú_collect_localÚGGatewaySlashCommandsMixin._handle_debug_command.<locals>._collect_local  s   ø€ Ù+°cÔ:¸8ÕDÐDr.   c                 ó$  <a€ S! 4        S
! ^ÈS! 4       R7      p  \        R4      S! V 4      /pS	! \        TP                  4       4      4       \	        R T 4       4      o\        \        STP                  4       4      4      '       d   . M\        R4      .pRP                  SR	\        R
4      R	.T3R lTP                  4        4       OR	NTO\        R4      N\        R4      N4      #   \         d   p\        RS! T4      R7      u Rp?# Rp?ii ; i)rÉ  )rÊ  Ú	dump_textzgateway.debug.report_labelzgateway.debug.upload_failedrL  Nc              3  ó8   "  € T F  p\        V4      x € K  	  R # 5irq   rG   )rt   r2   s   & r,   rv   Ú_GatewaySlashCommandsMixin._handle_debug_command.<locals>._collect_and_upload.<locals>.<genexpr>  s   é € Ð3©d¨œc !Ÿf˜f«dùr´  zgateway.debug.auto_deleter"  rF   zgateway.debug.headerc              3  ó@   <"  € T F  w  rR VRS 2 RV 2x € K  	  R# 5i)Ú`Ú<z`  Nr*   )rt   rÐ  ÚurlÚlabel_widths   &  €r,   rv   rÑ    s+   øé € ÐbÑUaÁzÀu ! E¨!¨K¨=¨Ð#9¸¸S¸EÕ BÓUaùs   ƒzgateway.debug.full_logs_hintzgateway.debug.share_hint)	r   rŸ   r    rÀ  rb  rj  Úmapr„   rÚ   )rË  Úurlsr  Úauto_deleterÖ  r½  r¾  r¿  rÀ  rÁ  rÂ  rÄ  rÃ  s       @€€€€€€€€r,   Ú_collect_and_uploadÚLGatewaySlashCommandsMixin._handle_debug_command.<locals>._collect_and_upload  s  ù€ Ù-Ô/Ù)°CÁ=Ã?ÔSˆFð^ÜÐ6Ó7Ñ9KÈFÓ9SÐT�ñ "¤$ t§{¡{£}Ó"5Ô6ÜÑ3©dÓ3Ó3ˆKô !$¤C¨¸¿¹»Ó$F× GÒ G™"ÜÐ-Ó.ðN0ˆKà—9‘9Ð5°r¼1Ð=SÓ;TÐVXð =ÜbÐUY×U_ÑU_ÔUaÓbð=à ð=à#.ð=ä01Ð2PÓ0Qð=ô  Ð :Ó;ð=ó >ð >øô ô ^ÜÐ6Ñ>WÐX[Ó>\Ô]Õ]ûð^ús   šC' Ã'DÃ2D
ÄDÄ
D)Úhermes_cli.debugr½  r¾  r¿  rÀ  rÁ  rÂ  rÃ  Úhermes_cli.debug_redactionrÄ  rþ  rS  r=  rc   ra   r
   r#  r   rÇ  ru  )r¡   rV   ÚwÚwants_localrÌ  rÚ  r½  r¾  r¿  rÀ  rÁ  rÂ  rÇ  rÄ  rÃ  s   &&    @@@@@@@@@r,   Ú_handle_debug_commandÚ/GatewaySlashCommandsMixin._handle_debug_commandõ  sÚ   ÿøé € ÷	P÷ 	Pñ 	Põ 	Ià°e×6LÑ6LÓ6N×6TÐ6TÐRT×5[Ñ5[Ô5]Ó!^Ñ5]°§'¡'¦)Ñ5]Ñ!^Ñ^ˆßœ7 5§<¡<°¸TÓBÄhÇnÁnÔTô Ð2Ó3Ð3ßõ >õEð ×;Ñ;¸NÓK×KÐK÷	>ô 	>ð* ×7Ñ7Ð8KÓL×LÐLùòK "_ñ Lñ. Mùs<   ‹ADÁC<Á'DÁ4<DÂ1 DÃDÃ%DÃ7DÃ8
DÄDc               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   r›   $  s   € ÷ C,ñ C,°,ð C,À3ñ C,r.   c              ƒ  ój  "  € ^ RI p^ RIHpHp ^ RIHpHp VP                  pVP                  V P                  9  dS    ^ RI
Hp VP                  VP                  P                  4      p	V	'       d   V	P                  '       g   \        R4      #  V! 4       '       d   RV! \        R4      4       2# \#        \$        4      P&                  P&                  P)                  4       p
 ^ RIHpHp V! V
4      pVR"9  d   \        R	VV! V4      R
7      #  V
R,          pVP/                  4       '       g   \        R4      # V! 4       pV'       g   \        R4      # VR,          pVR,          pVR,          pRVP                  P                  RVP0                  RVP2                  RVP4                  RV P7                  V4      R\8        P:                  ! 4       P=                  4       /pTP?                  RVP@                  3RVPB                  3R\E        VRR4      33 UUu/ uF  w  ppV'       g   K  VVbK  	  upp4       VPG                  R4      pVPI                  VPK                  V4      RR7       VPM                  V4       VPO                  RR7        \Q        VVV4       T PS                  4        \        R!4      #   \          d    \        R4      u # i ; i  \          d     ELÑi ; iu uppi   \          d<   pTPO                  RR7       TPO                  RR7       \        RTR 7      u Rp?# Rp?ii ; i5i)#u¶   Handle /update â€” spawn ``hermes update`` detached (``setsid``) so it survives the gateway
restart it may trigger; marker files let this or the next gateway process notify the user.N)rÌ  Ú_resolve_hermes_bin)Ú
is_managedÚformat_managed_message)Úplatform_registryz%gateway.update.platform_not_messagingu   âœ— zgateway.update.managed_action)Údetect_install_methodÚ%recommended_update_command_for_methodzgateway.update.not_applicable)ÚmethodrK   z.gitzgateway.update.not_git_repoz#gateway.update.hermes_cmd_not_foundz.update_pending.jsonz.update_output.txtz.update_exit_coderX   rY   rZ   r_   r™   Ú	timestampr\   r]   r^   rx   zutf-8)ÚencodingT)Ú
missing_okzgateway.update.start_failedrL  zgateway.update.starting>   Úgitr  )*Újsonrª   rÌ  rä  r;   rå  ræ  ra   rX   Ú_UPDATE_ALLOWED_PLATFORMSÚgateway.platform_registryrç  r1   r<   Úallow_update_commandr   rŸ   r   Ú__file__ÚparentÚresolverè  ré  ÚexistsrY   rZ   r_   rÄ   r   r·  Ú	isoformatrb   r\   r]   rc   Úwith_suffixÚ
write_textÚdumpsrÜ  Úunlinkr�   Ú#_schedule_update_notification_watch)r¡   rV   rï  rÌ  rä  rå  ræ  ró  rç  r¤   Úproject_rootrè  ré  rê  Úgit_dirr†   Úpending_pathr‡   rˆ   Úpendingr2   rf   Ú_tmp_pendingrÕ  s   &&                      r,   Ú_handle_update_commandÚ0GatewaySlashCommandsMixin._handle_update_command$  sþ  é € ó 	ßAßHð �l‰lˆØ�<‰<˜t×=Ñ=Ô=ðBÝGØ)×-Ñ-¨c¯l©l×.@Ñ.@ÓA�ß E×$>×$>Ð$>ÜÐDÓEÐEð %?ñ �<Š<ØÑ0´Ð3RÓ1SÓTÐUÐVÐVäœH“~×,Ñ,×3Ñ3×;Ñ;Ó=ˆð
	÷ñ
 +¨<Ó8ˆFØÐ/Ô/ÜÐ8ÀÙ!FÀvÓ!NôPð Pð 0ð  Õ'ˆà�~‰~×ÒÜÐ2Ó3Ð3Ù(Ó*ˆ
ßÜÐ:Ó;Ð;Ø#Ð&<Õ<ˆØ"Ð%9Õ9ˆØ%Ð(;Õ;ˆà˜Ÿ™×*Ñ*¨I°s·{±{ÀKÐQT×Q^ÑQ^Ø�s—{‘{ M°4×3OÑ3OÐPSÓ3TØœŸš›×1Ñ1Ó3ð5ˆð 	�‰¨;¸¿¹Ð*FÈÐW\×WgÑWgÐHhØ+4´g¸cÀ9ÈdÓ6SÐ*Tñ*Vô \ñ *V¡  AÜYZô ˜˜1šñ *Vò \ô 	]à#×/Ñ/°Ó7ˆØ×Ñ §
¡
¨7Ó 3¸gÐÔFØ×Ñ˜\Ô*Ø×Ñ¨ÐÔ.ð	=Ü" :¨{¸NÔKð
 	×0Ñ0Ô2ÜÐ*Ó+Ð+øôi ô BÜÐ@ÓAÒAðBûô( ô 	Úð	üó&\øô ô 	=Ø×Ñ¨4ÐÔ0Ø×!Ñ!¨TÐ!Ô2ÜÐ2¸!Ô<Õ<ûð	=üs¯   ‚<L3¿2J6 Á2J6 Â
J6 ÂL3ÂAL3Ã#*K Ä L3Ä.L3ÅCL3ÈK$
È(K$
È/AL3ÊK* ÊL3Ê6KËL3ËKËL3ËK!ËL3Ë K!Ë!	L3Ë*L0Ë50L+Ì%L0Ì&L3Ì+L0Ì0L3)r5  r7  rs  rÝ  rq   )é<   rî  )9Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r¥   r­   Ústaticmethodr·   r¿   rÅ   rÊ   rß   rï   r  r	  r  r  r(  rE  rb  rZ  r©  rÈ  rõ  r   r  r
  r  r  r+  rU  r|  r‹  r‡  r—  r­  r¾  rÙ  ré  rö  rþ  r  r'  r9  rO  rb  r}  r…  r�  r�  r¦  r¹  rà  r  Ú__static_attributes__r*   r.   r,   r•   r•   ­   sh  ‡ ñ kà*Ó*ðdÈu÷ dõ(3ð ôgó ðgõcõdõnô9õõ,õ(]õ>ð ôcó ðcõ
Oõ.Kõ('7õR#õJ?+õB+8õZ:?õxõ(õõPõ
Cõ(NõT5Nõn)õV;õ0 ð$ ö-ó ð-õ?õZõ49õlRõõ.<õ`õ!RõFhõB&SõP QõD9>õvIõ"
(õ^õ&[õ6>õ,-M÷^C,ñ C,r.   r•   ))Úskipped_user_editsz gateway.rollback.kept_user_edits)Úskipped_oversizezgateway.rollback.kept_oversize)Úfailed_deleteszgateway.rollback.failed_deletes)z!gateway.busy.behavior_queue_shortz gateway.busy.behavior_queue_long)z!gateway.busy.behavior_steer_shortz gateway.busy.behavior_steer_long)z%gateway.busy.behavior_interrupt_shortz$gateway.busy.behavior_interrupt_long)r   z--stagedÚcachedz--cached)r   r\  rB  )r  r  )r@  z gateway.voice.enabled_voice_only)r4  Údisable)r4  zgateway.voice.disabled_text)r   zgateway.voice.tts_enabled)r  r  ÚtrueÚ1)r4  r  ÚfalseÚ0)r"   Ú	permanentÚpermanently)r    Úses)r  )Gr	  Ú
__future__r   rU  r·  rÛ  rv  Úloggingr¹  rW  rr   r~   rå  r   Úpathlibr   Útypingr   r   Ú
agent.i18nr   Úgateway.configr	   r
   r   r   Úgateway.platforms.baser   Úgateway.platforms.eventr   Úgateway.sessionr   Úgateway.session_transcriptr   Úgateway.slash_commands_goalsr   Úgateway.slash_commands_modelr   Úgateway.slash_commands_sessionr   Úgateway.slash_commands_loginr   Úgateway.slash_commands_statusr   r   r;   r   r   Úutilsr   r   Ú	getLoggerrþ   ro  r0  r&   r?  r„  rL  rL  rš  r$  r‚   r3   r@   rI   rS   rg   r�   r“   r•   r*   r.   r,   Ú<module>r*     sÌ  ðñ>õ
 #ã Û Û Û Û Û 	Û 	Û Û 
Û Ý Ý ß "å ß VÓ VÝ 1Ý 0Ý -Ý :Ý AÝ BÝ FÝ Bß Xß :ß 4à	×	Ò	˜=Ó	)€ðOÐ ð ÐVØÐVØÐbðÐ ð]�t—}‘}Ð%QÐS[Ó\ð ]Ø—}‘}Ð%=¸uÓEð]ØGPÐR[ñ]Ð ð1Ø
‡m�mÐ$Ð&XÓYð1à
‡m�mÐ&Ð(NÓOð1ð 
Ð/ñ1Ð ðR˜$Ÿ-™-Ð(EÀtÓLð RØŸ-™-Ð(HÈ%ÓPðRÐ ðJ˜DŸM™MÐ*PÐRZÓ[ð JØ ŸM™MÐ*<¸iÓHðJÐ ð
÷ 
�EƒGð õõ*÷?õUõõ iõ@
1ôz,ØØØØØöz,r.   