+
    .pÐ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Úalwaysaa  
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)
with open(exit_code_path, "w", encoding="utf-8") as f:
    f.write(str(rc))
c               ó$   € V ^8„  d   QhRRRRRR/# )é   ÚrootÚdictÚkeysÚstrÚreturn© )Úformats   "Ú%/opt/hermes/gateway/slash_commands.pyÚ__annotate__r-   Q   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   Q   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-   Z   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@   Z   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-   d   s!   € ÷ ?ñ ?�3ð ?˜sð ?¨Cñ ?r.   c                óJ   € V R V \        V 4      V8”  d	   R,           # R,           # )Nz...Ú ©Úlen)rB   rC   s   &&r,   Ú_previewrI   d   s&   € Ø��ˆ<¤C¨£I°Ô$5˜5Õ>Ð>¸2Õ>Ð>r.   c               ó   € V ^8„  d   QhRR/# )r$   Úcommandr(   r*   )r+   s   "r,   r-   r-   h   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   h   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-   n   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   n   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                óz  € ^ 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      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" > Ú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Œ   ~   s7  € ó ÛÜ
‡|�|�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Ó(HÐ'Ið		Kð ð —‘˜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R 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R/ R0 ltR1 R2 ltR3 R4 ltR5 R6 ltR7 R8 lt R9 R: lt!R; R< lt"]ReR= R> ll4       t#R? R@ lt$RA RB lt%RC RD lt&RE RF lt'RG RH lt(RI RJ lt)RK RL lt*RM RN lt+RO RP lt,RQ RR lt-RS RT lt.RU RV lt/RW RX lt0RY RZ lt1R[ R\ lt2R] R^ lt3R_ R` lt4Ra Rb lt5Rct6Rd# )fÚ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.   c                ó  € ^ RI HpHp ^ RIHp V! V! 4       4      pVR,          '       g   R# VP                  4        UUu/ uF-  w  rVV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 )	zOA CheckpointManager from gateway config, or None when checkpoints are disabled.)Ú_checkpoint_agent_kwargsÚ_load_gateway_config)ÚCheckpointManagerÚcheckpoints_enabledNÚcheckpoint_ÚenabledTr*   )r©   rÌ   rÍ   Útools.checkpoint_managerrÎ   ÚitemsÚ
startswithrH   )r    rÌ   rÍ   rÎ   Úcpr2   rf   Úfieldss   &       r,   Ú_checkpoint_managerÚ-GatewaySlashCommandsMixin._checkpoint_managerå   s{   € çNÝ>Ù%Ñ&:Ó&<Ó=ˆØÐ'×(Ô(Ùà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š   +  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   ÚconfigÚ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_command+  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š   B  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  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   ÚpolicyrX   rZ   r)  r_   ÚheadÚrunnableÚrunnable_strs   &&          r,   Ú_handle_whoami_commandÚ0GatewaySlashCommandsMixin._handle_whoami_commandB  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š   V  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.kanbanrC  rB   r  ÚlstriprÔ   rH   Úiterrr   ÚsplitÚnextÚasyncioÚ	to_threadrž   r   ÚreÚsearchÚgroupÚ_kanban_auto_subscribeÚrstriprö   r÷   )r    rV   rC  rB   Úrequested_boardÚactionÚtokensÚtokÚoutputrù   ÚmrI  s   &&          r,   Ú_handle_kanban_commandÚ0GatewaySlashCommandsMixin._handle_kanban_commandV  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   rI  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   )ra  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)
rI  rX   rY   rZ   r\   r_   rk  Únotifier_profileÚdelivery_modeÚdelivery_metadata)	Ú
hermes_clirg  rh  ri  ÚconnectÚadd_notify_subrc   Ú_active_profile_nameÚclose)Ú_kbÚ_kbcÚ_kbnÚconnrd  rY   rZ   ro  Úplatform_strrV  r    rI  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(   r6  r¾   r0   r&   râ   rO  rP  )r    rV   rI  rV  rX   rz  rd  rY   rZ   ro  ry  ra   s   f&ff  @@@@@@r,   rT  Ú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              ƒ  ó0  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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P.                  4      p V'       dF   \1        VR4      '       d4   VP3                  SP4                  S P7                  V4      4      G Rj  x€L
  \        R4      #  EL( ELã EL£ EL L  \8         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): %sr,  )Ú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˜   rª   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¤  sS  úé € ÷
 	PØ—‘ˆØ"×6Ñ6×LÑLÈVÓT×TˆØ#×/Ñ/ˆ÷	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ô Ð)Ó*Ð*òo Uò =ò =ò* 2ñ$ føÜô 	`Ü�L‰LÐOÐZ^ˆLÖ_ð	`üs�   …3J¸I ¹AJÂ I#Â5JÂ7JÃI&ÃAJÄ$JÄ;JÅI)ÅA.JÆ;JÇ:JÈAI. ÉI,ÉI. ÉJÉ#JÉ&JÉ)JÉ,I. É."JÊJÊJÊJ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_platformsr,  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¯®»-ùó   ‚r1  zgateway.platform.headerzgateway.platform.connected)Ú	platformsÚpausedÚpause_reasonzgateway.platform.reason_defaultzgateway.platform.item_paused)ra  r’  zgateway.platform.item_retryingÚattempts)ra  r±  r  zgateway.platform.none_failedÚpausezgateway.platform.usagezgateway.platform.usage_action)rW  c              3  óh   <"  € T F'  qP                   P                  4       S8X  g   K#  Vx € K)  	  R # 5irq   )r<   r6  )rt   r«  Útargets   & €r,   rv   r¬  ý  s%   øé € Ð_Ñ$A˜qÇWÁWÇ]Á]Ã_ÐX^ÑE^ŸšÓ$Aùs   ƒ 2¨
2Nzgateway.platform.unknown©ra  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  rM  r6  rK  rÔ   rH   rƒ   r9  rþ   r   rÓ   r1   Úappendr<   rN  r
   Ú__members__Úvaluesr™   Ú_pause_failed_platformÚ_resume_paused_platform)r    rV   ÚpartsrW  ÚfailedÚ	connectedÚlinesr«  r–  r’  rX   ra  Ú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$   ra  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)rO  rP  r   rž   rö   rœ  )ra  Ú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Ê  (  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_payload(  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Ê  1  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_payload1  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š   M  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_commandM  s   é € ä˜	Ó"×'Ñ'Ð'ùs   ‚c               ó    € V ^8„  d   QhRRRR/# rU   r*   )r+   s   "r,   r-   rš   Q  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_commandsr*  r+  )r5  r&  ra   rÑ   r7  r_   r:  )r    rV   r&  ra   r;  s   &&   r,   Ú_catalog_optionsÚ*GatewaySlashCommandsMixin._catalog_optionsQ  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š   ^  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.r*  r  )rÉ   rS   rø  rB   r½   s   &&r,   Ú_handle_help_commandÚ.GatewaySlashCommandsMixin._handle_help_command^  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š   c  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_sizer2  )Úargsr  )	ra   rX   r
   ÚTELEGRAMrø  rS   Úget_command_argsrÉ   rB   )r    rV   r  r  r   s   &&   r,   Ú_handle_commands_commandÚ2GatewaySlashCommandsMixin._handle_commands_commandc  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š   j  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_platformrF  r[   FTÚ_intake_adapter_forÚfronts_platformr_   z*gateway.set_home.err_relay_unauthenticatedr`   )rX   rY   ra  r\   r_   r`   )Úenabled_if_new)Úsave_env_valuerF   z7Home config saved but legacy env persistence failed: %s©rÑ   zgateway.set_home.success)ra  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_commandj  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   € ÷ 3Nñ 3N°ð 3NÀ#ñ 3Nr.   c           	   ƒ  óN  a aaa"  € VP                  4       P                  4       P                  4       pVP                  P                  oS P                  VP                  4      oS P                  VP                  4      oR 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                  V4      G Rj  x€L
 # VR8X  d   S P                  V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                  V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        S'       g   R # V R8X  d   SP                  SSRR7       R # SP                  SSRR7       R # )NÚoffT)Údisabledr  )Ú_voice_modeÚ_save_voice_modesÚ_set_adapter_auto_tts_disabledÚ_set_adapter_auto_tts_enabled)r   rø   rY   r    Ú	voice_keys   &€€€€r,   Ú	_set_modeÚBGatewaySlashCommandsMixin._handle_voice_command.<locals>._set_modeŸ  sV   ø€ Ø*.ˆD×Ñ˜YÑ'Ø×"Ñ"Ô$ßÙØ�uŒ}Ø×3Ñ3°G¸WÈtÐ3ÖTà×2Ñ2°7¸GÈTÐ2ÖRr.   NÚleaveÚstatusr#  Ú
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)ra  r-  r  zgateway.voice.enabled_shortzgateway.voice.disabled_shortÚjoin_voice_channelzgateway.voice.help_channelszgateway.voice.help)ÚtoggleÚchannels>   rƒ   r1  )r#  r.  r   )r  r  r6  ra   rY   Ú_voice_key_for_sourcerÂ   Ú_VOICE_MODE_BY_ARGr   Ú_handle_voice_channel_joinÚ_handle_voice_channel_leaver%  r1   Ú_get_guild_idr|  r/  r·  rƒ   )r    rV   r  r*  r   Ú	reply_keyrÉ  r¿  Úguild_idr–  r[  r-  Ú
turning_onÚtoggle_lineÚsupports_voice_channelsr8  rø   rY   r)  s   f&              @@@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%Ã3J"Ã4BJ%ÆC J%É'J%É0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                  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)rJ  z--force©r6  ©rt   rY  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rI  rK  rL  s   & r,   rv   rM  Ó  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_failedrG  rF  zgateway.rollback.restoredÚrestored_tor’  )rQ  r’  z (+Ú)rF   r,  :Né   N)Úfiles)rÒ   rG  r×   r   r	  r  r  rM  Úanyrƒ   Úunsupported_backend_reasonÚlist_checkpointsrD   rH   Ú
ValueErrorÚrestoreÚ_ROLLBACK_SKIP_LINESr1   )r    rV   rG  ÚmgrrO  rX  Úrestore_allÚargr’  ÚcheckpointsÚlistingÚidxÚtarget_hashÚresultÚmsgÚ
result_keyÚi18n_keyrW  Úmores   &&                 r,   Ú_handle_rollback_commandÚ2GatewaySlashCommandsMixin._handle_rollback_commandÉ  s  é € åCØ×&Ñ&Ó(ˆØŠ;ÜÐ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]   ‚A,I,Á/I,ÂAI,ÃI,ÃI,Ã+ I,ÄI,ÄI Ä,B9I,Ç&I,Ç3A&I,ÉI)É&I,É(I)É)I,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  dd   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_diffrS  zgateway.diff.failedrG  zgateway.diff.err_defaultrF  )r  r  rM  r6  r™   ÚsetÚ_DIFF_MODE_BY_ARGr1   r	  r×   r   rY  rO  rP  Úsession_diffÚtools.working_diffrp  Ú_render_diff_result)r    rV   Úar  Ú	stat_onlyr   ÚlowrO  r^  r’  re  rp  s   &&          r,   Ú_handle_diff_commandÚ.GatewaySlashCommandsMixin._handle_diff_commandô  sL  é € ð $)×#9Ñ#9Ó#;×#AÑ#AÓ#C×#IÑ#IÔ#KÓLÑ#K˜a—‘–	Ñ#KˆÐLÜ˜( FÐ+¬c°$«iÕ7Ó8ˆ	ØˆÛˆCÜ$×(Ñ(¨Ó3ŠDñ à× Ñ Ó"ˆØ�9Ôà×*Ñ*Ó,ˆ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±E>Á	BFÃ&FÃ<FÃ=%FÄ"FÄ#FÄ>FÅ(FÆFc               ó$   € V ^8„  d   QhRRRRRR/# )r$   re  r&   rw  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.rn  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ùr0  :Nr   Nzgateway.diff.more_untrackedrÆ  zgateway.diff.untracked_labelz
```
ú

)r1   r   r·  rƒ   rH   Ú_fenced_truncated_diff)	r    re  rw  rn  r}  r~  ÚoutÚshownri  s	   &&&      r,   ru  Ú-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š     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_diff  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š   -  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)rO  Úcreate_taskÚ_background_tasksÚaddÚadd_done_callbackÚdiscard)r    ÚcoroÚtasks   && r,   Ú_track_background_taskÚ0GatewaySlashCommandsMixin._track_background_task-  s@   € ä×"Ò" 4Ó(ˆØ×Ñ×"Ñ" 4Ô(Ø×Ñ˜t×5Ñ5×=Ñ=Ö>r.   c               ó    € V ^8„  d   QhRRRR/# r  r*   )r+   s   "r,   r-   rš   3  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)ÚpreviewrI  )r  r  r   r   ÚnowÚstrftimeÚosÚurandomÚhexr›  Ú_run_background_taskra   r¼   rŸ   r¢  r£  rI   )r    rV   ÚpromptrI  s   &&  r,   Ú_handle_background_commandÚ4GatewaySlashCommandsMixin._handle_background_command3  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š   @  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__f  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¤  rG  )rñ   )Úagent.side_questionrµ  rO  rP  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_questionf  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_command@  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š   v  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  rM  rç   r   )r    rV   rÌ  ÚwarÎ  r†  s   &&    r,   Ú_handle_memory_commandÚ0GatewaySlashCommandsMixin._handle_memory_commandv  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>   r   Úapproval)rÒ  rÌ  rÓ  rá   r  r  rM  r6  Ú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)r5  r&  Úhermes_cli.approval_moderè  r  r  ra   r7  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•  ÚyolorO  rP  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              ƒ  óV  "  € ^ RI Hp V P                  V4      w  r4 V! 4       p\        \	        VRR4      RR7      pV'       g   \        R4      # ^ RIHp . ROpV! XVR	R4      p	YˆP                  W˜9   d   T	MR4      ^,           \        V4      ,          ,          p
\        R
V
 24      p \        VRRVR	3V
4       V R2\        RVR7      ,           #   \
         d    Rp 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Í   r  Útool_progress_commandF)Údefaultzgateway.verbose.not_enabled)Úresolve_display_settingr   Útool_progresszgateway.verbose.mode_r®  r  zgateway.verbose.saved_suffix)rX   z%Failed to save tool_progress mode: %szgateway.verbose.save_failedrF  N)r#  Únewr   ÚverboseÚlog)r©   rÍ   r  r   r   rž   r   Úgateway.display_configr  ÚindexrH   r@   rö   r÷   )r    rV   rÍ   r5   Úplatform_keyrä   Úgate_enabledr  ÚcycleÚcurrentÚnew_modeÚdescriptionrÎ  s   &&           r,   Ú_handle_verbose_commandÚ1GatewaySlashCommandsMixin._handle_verbose_command·  s2  é € õ 	5Ø$(×$?Ñ$?ÀÓ$FÑ!ˆð	!Ù.Ó0ˆKÜ*¬7°;À	ÐKbÓ+cØ38ô:ˆL÷ ÜÐ2Ó3Ð3åBÚ7ˆÙ)¨+°|À_ÐV[Ó\ˆØŸ+™+°Ô1A¡gÀuÓMÐPQÕQÔUXÐY^ÓU_Õ_Õ`ˆÜÐ/°¨zÐ:Ó;ˆð	RÜ" ;°¸KÈÐWfÐ0gÐiqÔrØ!�] "Ð%¬Ð*HÐS_Ô(`Õ`Ð`øô ô 	!Ø ŠLð	!ûô ô 	RÜ�N‰NÐBÀAÔFØ!�] "Ð%¬Ð*GÈqÔ(QÕQÕQûð	Rüs^   ‚D)�C ¼D)ÁA$D)Â)'C$ ÃD)ÃC!ÃD)Ã C!Ã!D)Ã$D&Ã/,D!ÄD&ÄD)Ä!D&Ä&D)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           
   ƒ  óp  "  € VP                  4       P                  4       P                  4       pV'       d   VR8X  dc   V P                  VP                  4      p\        \        P                  V\        R,          4      ^ ,          4      p\        \        RW4R7      4      # V\        9  d   \        \        RVR7      4      # ^ RI	H
p V! RV4      '       g   \        \        R	4      4      # V P                  VP                  4      pV'       d   ^ R
IHp V P                  Wg! 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-  r   zgateway.busy.status)r   Úbehaviorzgateway.busy.unknown_mode)r`  ©Úsave_config_valuezdisplay.busy_input_modezgateway.busy.save_failedr  zgateway.busy.set)r  r  r6  Ú_effective_busy_input_modera   r   Ú_BUSY_MODE_BEHAVIORr1   r   Úclir  Ú_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   r  r  r  rÍ   rø   s	   &&       r,   Ú_handle_busy_commandÚ.GatewaySlashCommandsMixin._handle_busy_commandÒ  sX  é € à×$Ñ$Ó&×,Ñ,Ó.×4Ñ4Ó6ˆß�c˜X”oØ×2Ñ2°5·<±<Ó@ˆ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   ‚CF6Ã6F6ÄB)F6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  rgRp \        VRR4      ;'       g    RP                  4       p	V	P                  R4      '       dJ   V	P                  R^4      p
\        V
4      ^8”  d&   V
^,          P                  4       P                  4       MRp T! 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RT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    Rp EL*i ; i  \         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_configrF   rê  Nr   zgateway.config_read_failedrF  c               ó    € 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Ñ   r,  rÖ   )ÚstaterÖ   rX   zgateway.footer.usagez)Failed to save runtime_footer.enabled: %szgateway.config_save_failed)r±  Úcontext_tokensÚcontext_lengthrÖ   zgateway.footer.example_liner¿  zgateway.footer.saved)r-  Úexample>   r'  r-  )r  Úruntime_footerrÑ   )r±  Úcontext_pctrO  )r©   rÍ   r%  Úgateway.runtime_footerr&  r'  r  rc   r  rÔ   rM  rH   r6  rž   r   rƒ   r1   Ú_FOOTER_STATE_BY_ARGr@   rö   r÷   )r    rV   rÍ   r%  r&  r'  r5   r  r`  rB   r¼  rä   rÎ  Ú	effectiver+  Ú	new_stater0  r¤  s   &&                r,   Ú_handle_footer_commandÚ0GatewaySlashCommandsMixin._handle_footer_commandï  sù  é € çLßWØ$(×$?Ñ$?ÀÓ$FÑ!ˆØˆð	Ü˜E 9¨dÓ3×9Ð9°r×@Ñ@ÓBˆDØ�‰˜s×#Ò#ØŸ
™
 4¨Ó+�Ü25°e³*¸q´.�e˜A•h—n‘nÓ&×,Ñ,Ô.Àb�ð	<Ù 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ˆ	ð	<Ü" ;Ð0XÐZcÔdð ˆßá+Ù,¨[Ó9×AÐA¸TÐRSÐdhØ —}‘} XÓ.×QÐQÒ2QôSˆG÷ ÜÐ9À7ÔK�ÜÐ'©v°iÓ/@È'ÔRÐRøô; ô 	Ø‹Cð	ûô ô 	<ÜÐ1¸Ô;Õ;ûð	<ûô ô 	<Ü�N‰NÐFÈÔJÜÐ1¸Ô;Õ;ûð	<üs´   ‚&H<©;G Á%A	G Â/G Â6AH<ÄH<ÄH<Ä5H<ÅH Å	H<Å(H<Å9H<ÆH<Æ'!H<ÇGÇH<ÇGÇH<ÇG>Ç'G9Ç3G>Ç4H<Ç9G>Ç>H<ÈH9È"H4È.H9È/H<È4H9È9H<c               ó    € V ^8„  d   QhRRRR/# ©r$   rV   r   r)   rŽ   r*   )r+   s   "r,   r-   rš     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__'  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   r  r  rö   r–  rž   r÷   Ú_execute_mcp_reload)r?  r  rù   re  rV   r    r˜   s   &   €€€r,   Ú_on_confirmÚIGatewaySlashCommandsMixin._handle_reload_mcp_command.<locals>._on_confirm'  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   rC  Ú_request_slash_confirmr   )r    rV   rä   r<  rD  r˜   s   ff   @r,   Ú_handle_reload_mcp_commandÚ4GatewaySlashCommandsMixin._handle_reload_mcp_command  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š   ;  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: %sra  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__Z  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      # )ra  rF   r  z$gateway.reload_skills.item_with_desc)ra  Údescz"gateway.reload_skills.item_no_descrµ  )r1   r   )rT  ÚnmrW  s   &  r,   Ú	_fmt_lineÚJGatewaySlashCommandsMixin._handle_reload_skills_command.<locals>._fmt_lineZ  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.failedrF  )Úagent.skill_commandsrN  Ú_run_in_executor_with_contextr1   rŸ   rþ   r¹  rc   r  ÚinspectÚisawaitablerž   rö   r÷   r   rƒ   r·  rÃ   ra   r|  r[  )r    rV   rN  re  rO  rP  rQ  rø   ÚrefreshÚmayberù   r¿  rY  Úsectionsrh  Únote_headerrÓ   rT  Ú	formattedr˜   rÎ  s   &&                   r,   Ú_handle_reload_skills_commandÚ7GatewaySlashCommandsMixin._handle_reload_skills_command;  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š   v  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.ÚbundlesrG  zBundles command unavailable: %szgateway.bundles.noneÚdir)rj  zgateway.bundles.headerrÆ  rF   rÛ  r  zgateway.bundles.default_desczgateway.bundles.itemÚslug)rk  rW  rÇ  u       Â· r  zgateway.bundles.invoke_hint)	rS   rd   rö   r÷   rB   r   rH   r1   rƒ   )	r    rV   r   ri  r¿  r–  rÛ  rW  Úss	   &&       r,   Ú_handle_bundles_commandÚ1GatewaySlashCommandsMixin._handle_bundles_commandv  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.approvalrs  rÃ   ra   Ú_pending_approvalsÚpopr   )r    rV   rp  rq  rs  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/# r:  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)rt  r|  rw  r  r  r6  rM  Ú_APPROVE_CHOICE_BY_ARGr   rö   r–  rú   )r    rV   r|  r˜   Ústaler  rv  Úchoicesr?  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’  )rt  r|  rw  r  r  rM  r™   r6  rH   r   rö   r–  rú   )r    rV   r|  r˜   rƒ  Úraw_argsrX  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   € ÷ Mñ M°ð MÀ#ñ Mr.   c              ƒ  óš   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	 VVVVVVV	V
3R lpV P                  V4      G Rj  x€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_textc                 ó$  <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)éÈ   )Ú	log_linesÚ	dump_textzgateway.debug.report_labelzgateway.debug.upload_failedrF  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¹  rP  rX  Úmaprƒ   rÓ   )ÚreportÚ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N)Úhermes_cli.debugr’  r“  r”  r•  r–  r—  r˜  Úhermes_cli.debug_redactionr™  r]  )r    rV   r©  r’  r“  r”  r•  r–  r—  r™  r˜  s   && @@@@@@@@r,   Ú_handle_debug_commandÚ/GatewaySlashCommandsMixin._handle_debug_commandÁ  sB   ÿé € ÷	P÷ 	Pñ 	Põ 	I÷	>ô 	>ð* ×7Ñ7Ð8KÓL×LÐLÑLùs   Š:AÁA	ÁA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^   z.tmpzutf-8)ÚencodingT)Ú
missing_okzgateway.update.start_failedrF  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)r  r  r[  rÖ  N)é<   rÜ  )7Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r¤   r¬   Ústaticmethodr¶   r¾   rÄ   rÉ   r×   rç   rú   r  r	  r  r!  r?  r\  rT  r¢  rÁ  rî  ró  rø  rü  r  r  rC  rj  ry  ru  r…  r›  r¬  rÇ  r×  rä  rì  rý  r  r!  r7  rJ  re  rm  rw  r…  rŽ  r­  rÏ  Ú__static_attributes__r*   r.   r,   r”   r”   ©   s[  ‡ ñ kà*Ó*ðdÈu÷ dõ(3ð ôgó ðgõcõdõnò	9õõ,õ(]õ>ð ôcó ðcõ
Oõ.Kõ('7õR#õJ>+õ@+8õZ:?õx(õõPõ
Cõ(NõT3Nõj)õV;õ0 ð$ ö-ó ð-õ?õZõ49õlRõõ.<õ`õRõ6hõ:(SõT 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   rJ  r<  )ró  rü  )r.  z gateway.voice.enabled_voice_only)r#  Údisable)r#  zgateway.voice.disabled_text)r   zgateway.voice.tts_enabled)ró  rü  ÚtrueÚ1)r#  rÞ  ÚfalseÚ0)r"   Ú	permanentÚpermanently)r    Úses)rÑ  )GrÖ  Ú
__future__r   rO  Ú
contextlibrÔ  r^  Úloggingr§  rQ  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ö   r]  r  r&   r8  rr  r:  r4  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.   