+
    jHàjþ  ã                  óÞ   € R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIH	t	 ]
! ]P                  ]P                  ]P                  ]P                  04      tRtR R ltR	 R
 ltR R ltR R ltR# )uÄ  ``/branch`` destination on thread-capable platforms (#66023).

On Discord, Telegram, Slack and Matrix a plain ``/branch`` opens a NEW sibling thread for the
clone and leaves the current chat bound to the original session, so the user can keep both paths
alive. ``/branch --here`` keeps the legacy in-place switch; platforms without threads (and the CLI)
always branch in place. Pure helpers only â€” the handler lives in ``slash_commands_session.py``.
)ÚannotationsN)ÚOptional)ÚPlatform)ÚSessionSourcez--herec               ó    € V ^8„  d   QhRRRR/# )é   ÚrawÚstrÚreturnztuple[bool, str]© )Úformats   "ÚI/home/ubuntu/.hermes/hermes-agent/gateway/slash_commands_branch_thread.pyÚ__annotate__r      s   € ÷ 
ñ 
˜3ð 
Ð#3ñ 
ó    c                ó¼   € T ;'       g    RP                  4       pVP                  R4      w  r#pVP                  4       \        8X  d   RVP                  4       3# RV3# )zõ``(stay_here, title)`` from the text after ``/branch``.

Only a leading ``--here`` is a flag; everything else is the optional title. The CLI strips the
flag through the same parser so ``/branch --here` never becomes a session titled ``--here``.
Ú Ú TF)ÚstripÚ	partitionÚlowerÚBRANCH_HERE_FLAG)r   ÚtextÚheadÚ_Úrests   &    r   Úparse_branch_argsr      sT   € ð �IˆI�2×ÑÓ€DØ—N‘N 3Ó'�M€DˆTØ‡z�zƒ|Ô'Ô'Ø�T—Z‘Z“\Ð!Ð!Ø�$ˆ;Ðr   c               ó    € V ^8„  d   QhRRRR/# )r   Úsourcer   r
   zOptional[str]r   )r   s   "r   r   r   #   s   € ÷ ;ñ ; ð ;°=ñ ;r   c                ó~  € V P                   \        9  d   R# V P                   \        P                  8X  d`   V P                  R8X  d   R# V P
                  '       g   V P                  R8X  d*   V P                  '       d   \        V P                  4      # R# V P                  '       d   \        V P                  4      # R# )z‹Chat that can host a sibling thread for *source*, or None when nothing can (Discord DMs,
a Discord thread whose parent channel is unknown).NÚdmÚthread)	ÚplatformÚBRANCH_THREAD_PLATFORMSr   ÚDISCORDÚ	chat_typeÚ	thread_idÚparent_chat_idr	   Úchat_id)r   s   &r   Úbranch_thread_parentr(   #   s�   € ð ‡�Ô5Ô5ÙØ‡�œ(×*Ñ*Ô*Ø×Ñ˜tÔ#Ùð ××Ð˜v×/Ñ/°8Ô;Ø17×1F×1FÐ1F”3�v×,Ñ,Ó-ÐPÈDÐPà"(§.§. .Œ3ˆv�~‰~ÓÐ:°dÐ:r   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )r   r   r   Ú	parent_idr	   r%   Útitler
   r   )r   s   "r   r   r   3   s8   € ÷ ^ñ ^˜}ð ^¸Cð ^ÈCð ^ÐX[ð ^Ð`mñ ^r   c               ó‚  € \        \        V4      RRRRR7      pV P                  \        P                  8X  dF   \
        P                  ! V 3R\        V4      RT;'       g    V P                  RRR\        V4      /VB # V P                  R8X  d   R	MV P                  p\
        P                  ! V 3R\        V4      RV/VB # )
ue  The ``SessionSource`` a follow-up typed in the new thread will arrive on â€” the shape must
match each adapter's inbound source or the clone is bound to a key nobody ever reads (the
CLIâ†’platform handoff in ``run_startup.py::_handoff_resolve_destination`` mirrors the same
rules). Per-message fields are dropped; identity/scope fields travel with the copy.NF)r%   Ú
message_idÚprospective_thread_idÚauto_thread_createdÚauto_thread_initial_namer'   Ú	chat_namer$   r    r&   Úgroup)	Údictr	   r!   r   r#   ÚdataclassesÚreplacer1   r$   )r   r*   r%   r+   Úcommonr$   s   &$$$  r   Úbranch_dest_sourcer7   3   sË   € ô
 œC 	›N°tÐSWØ&+ÀdôL€Fà‡�œ(×*Ñ*Ô*ä×"Ò" 6ñ `´3°y³>ð `ÈU×MfÐMfÐV\×VfÑVfð `Ø-5ð`ÜFIÈ)Ãnð`ØX^ñ`ð 	`ð "×+Ñ+¨xÔ7‘¸V×=MÑ=M€IÜ×Ò˜vÑ]¬s°9«~Ð]ÈÐ]ÐV\Ñ]Ð]r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r!   zOptional[Platform]r%   r	   r
   r   )r   s   "r   r   r   D   s"   € ÷ ñ Ð 2ð ¸sð Àsñ r   c                óD   € V \         P                  8X  d   RV R2# RV R2# )zXClickable pointer where the platform has one (Discord ``<#id>`` mentions); id otherwise.z<#Ú>Ú`)r   r#   )r!   r%   s   &&r   Úformat_thread_refr<   D   s.   € à”8×#Ñ#Ô#Ø�I�;˜aÐ Ð Øˆyˆk˜ÐÐr   )Ú__doc__Ú
__future__r   r4   Útypingr   Úgateway.configr   Úgateway.sessionr   Ú	frozensetr#   ÚTELEGRAMÚSLACKÚMATRIXr"   r   r   r(   r7   r<   r   r   r   Ú<module>rF      sc   ðñõ #ã Ý å #Ý )ñ $ X×%5Ñ%5°x×7HÑ7HÈ(Ï.É.ÐZb×ZiÑZiÐ$jÓkÐ ØÐ õ
õ;õ ^÷"r   