+
    iHàjÎÌ  ã            
       ól  a € R‚ tk0 t R t^ RIt^ RIt^ RIt^ RIt^ RI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Ht ^ RIHt ]P0                  ! ]4      t/ t] ^ k / t] ^k / t] ^k ]P<                  ! 4       t]P@                  ! R4      t!]P@                  ! R	4      t"R
t#Rt$Rt%Rt&Rt'Rt(Rt)]P@                  ! ]PT                  ! ]#4      R,           4      t+Rt,]P@                  ! R4      t-Rt.]#R,           t/],R,           t0Rt1R R lt2R R lt3R R lt4R R lt5RƒR R  llt6]P@                  ! ]PT                  ! ],4      R!,           ]-Pn                  ,           4      t8]P@                  ! R"]Pr                  4      t:R# R$ lt;R% R& lt<R' R( lt=R) R* lt>R+ R, lt?R„R- R. llt@R/ R0 ltAR1 R2 ltBR3 R4 ltCR5 R6 ltDR7tER8tFR…R†R9]F33tGR:tHR; R< ltIR= R> ltJR‡R@ RA lltKRB RC ltLRDRRERRFRRGR?RHR?/RI RJ lltM0 RˆmtNRK RL ltORM RN ltPRO RP ltQ^ tRRQ RR ltSRS RT ltTRU RV ltU/ sV] ^k RsW] ^k RW RX ltXRY RZ ltYR[ R\ ltZR] R^ lt[R_ R` lt\Ra Rb lt]Rc Rd lt^Re Rf lt_RgRh/Ri Rj llt`Rk Rl ltaR‰Rm Rn lltb^tcRgRh/Ro Rp lltdRŠRq Rr llteR„Rs Rt lltfRuRv RwRRxRhRyR/Rz R{ lltgR‹R| R} llthR„R~ R lltiRŒR€ R� lltjR# )�zRShared slash command helpers for skills (CLI and gateway both invoke /skill-name).N)ÚPath)ÚAnyÚDictÚMappingÚOptional)Údisplay_hermes_home)Úregister_stable_prefix)Úload_skills_configÚpreprocess_skill_content)ÚAMBIGUOUS_SKILL_PREFIXz[^\w-]z-{2,}ú%[IMPORTANT: The user has invoked the z(The full skill content is loaded below.]zPThe user has provided the following instruction alongside the skill invocation: z

[Runtime note:z skill bundle,z
User instruction: z

[Loaded as part of the z	"([^"]*)"ú[IMPORTANT: The "zE" skill is auto-loaded\. Follow its instructions for this session\.\]z=then run them with the terminal tool using the absolute path.Ú%Úc                ó0   € V ^8„  d   QhR\         R\         /# ©é   ÚnameÚreturn©Ústr)Úformats   "Ú9/home/ubuntu/.hermes/hermes-agent/agent/skill_commands.pyÚ__annotate__r   U   s   € ÷ 8ñ 8œSð 8¤Sñ 8ó    c                óÔ   € \         P                  RV P                  4       P                  RR4      P                  RR4      4      p\        P                  RV4      P                  R4      # )zžNormalize a skill/bundle name to a ``/command`` slug (``Foo Bar`` -> ``foo-bar``);
strips chars (``+``, ``/``) that would make invalid Telegram command names.Ú Ú Ú-Ú_)Ú_SKILL_INVALID_CHARSÚsubÚlowerÚreplaceÚ_SKILL_MULTI_HYPHENÚstrip)r   Úcmds   & r   Úslugify_skill_namer'   U   sU   € ô ×
"Ñ
" 2 t§z¡z£|×';Ñ';¸CÀÓ'E×'MÑ'MÈcÐSVÓ'WÓ
X€CÜ×"Ñ" 3¨Ó,×2Ñ2°3Ó7Ð7r   c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   ÚpartsÚinstructionr   ©Úlistr   )r   s   "r   r   r   \   s!   € ÷ ñ ¤4ð ´cð ¼cñ r   c                ó~   € RP                  V 4      R,           \        ,           pV P                  \         V 24       V# )ug  Append the instruction line to ``parts``; return the stable prefix, which
ends exactly at the instruction marker so (registered with
``agent.prompt_cache_boundary``) the cache planner can break on the scaffold.
Single construction site guarantees the prefix is a byte-prefix of the message.

Shared by every builder that ends a static skill scaffold with the caller-supplied volatile instruction
(single-skill invocations, cron job prompts). Keeping construction in one place guarantees the
registered prefix stays a byte-prefix of the built message â€” the invariant the request-time split
depends on. See #81867.
Ú
)ÚjoinÚ_SINGLE_SKILL_INSTRUCTIONÚappend)r)   r*   Ústable_prefixs   && r   Úappend_user_instructionr3   \   s:   € ð —I‘I˜eÓ$ tÕ+Ô.GÕG€MØ	‡L�LÔ-Ð.¨{¨mÐ<Ô=ØÐr   c                óF   € V ^8„  d   QhR\         R\        \        ,          /# ©r   Úcontentr   )r   r   r   )r   s   "r   r   r   l   s   € ÷ ñ ¼ð ÄÌ#Åñ r   c                ó  € \        V \        4      '       g   R# V P                  \        4      '       g   V # \        V 9   d!   \        V \        \        V P                  4      # \        V 9   d!   \        V \        \        V P                  4      # R# )zÛRecover the user's instruction from a slash-skill-expanded turn: the
string unchanged when it is NOT scaffolding, the extracted instruction when
the scaffolding carried one, or ``None`` for a bare ``/skill`` invocation.N)Ú
isinstancer   Ú
startswithÚ_SKILL_INVOCATION_PREFIXÚ_BUNDLE_MARKERÚ
_cut_afterÚ_BUNDLE_USER_INSTRUCTIONÚ_BUNDLE_FIRST_SKILL_BLOCKÚfindÚ_SINGLE_SKILL_MARKERr0   Ú_RUNTIME_NOTEÚrfind)r6   s   &r   Ú+extract_user_instruction_from_skill_messagerC   l   sn   € ô �gœs×#Ò#ÙØ×ÑÔ6×7Ò7ØˆÜ˜Ô ä˜'Ô#;Ô=VÐX_×XdÑXdÓeÐeÜ˜wÔ&ä˜'Ô#<¼mÈWÏ]É]Ó[Ð[Ùr   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# r5   ©r   r   )r   s   "r   r   r   }   s   € ÷ *ñ *¬cð *´h¼sµmñ *r   c                óà  a€ V P                  \        4      '       g   R# \        P                  ! \        P                  ! \        4      R,           V 4      pV'       d   VP                  ^4      MRpV P                  \        4      pVR8X  d   V'       d   RV 2# R# W\        \        4      ,           R P                  4       o\        V3R l\         4       R4      ;p'       d@   SP                  V4      pV^ 8¼  d$   SV\        V4      ,           R P                  4       MRoKa  SP                  4       '       g   V'       d   RV 2# R# RP                  SP                  4       4      ;'       g    R# )u�  ``[IMPORTANT: The "X" skill is auto-loaded. â€¦]`` + payload(s) + typed text
-> the typed text.

``_hmwa_auto_load_skills`` builds each payload with ``_build_skill_message``
(activation header, body, then the skill-directory footer note) and appends the
user's text as the final block. The footer's closing sentence is the reliable
payload-end marker: the user's text is what follows the LAST footer. A header
quoted inside a body (a skill embedding the scaffold in an example) carries no
footer, so it cannot end the payload early. ``/<skill>`` renders when no user
text follows, matching the single-skill describer's bare-invocation shape.Nz([^"]*)"r   Ú/c              3   ó^   <"  € T F"  w  rSP                  V4      '       g   K  Vx € K$  	  R # 5i©N)r9   )Ú.0ÚstartÚendÚtails   &  €r   Ú	<genexpr>Ú3_describe_auto_loaded_skill_turn.<locals>.<genexpr>’   s#   øé € ÐbÑ3G¡Z UÈ4Ï?É?Ð[`×KaŸSšSÓ3Gùs   ƒ-£
-r   éÿÿÿÿ)r9   Ú_AUTO_LOAD_PREFIXÚreÚmatchÚescapeÚgrouprB   Ú_SKILL_DIR_NOTE_ENDÚlenÚlstripÚnextÚ_TRAILING_BLOCK_ENDSr?   r%   r/   Úsplit)r6   Ú
name_matchr   Ú
footer_endÚ	block_endÚcutrM   s   &     @r   Ú _describe_auto_loaded_skill_turnr`   }   s"  ø€ ð ×ÑÔ/×0Ò0ÙÜ—’œ"Ÿ)š)Ô$5Ó6¸ÕDÀgÓN€Jß",ˆ:×Ñ˜AÔ°"€Dð —‘Ô2Ó3€JØ�RÔß!��4�&ˆzÐ+ tÐ+Ø¤Ô$7Ó 8Õ8Ð9Ð:×AÑAÓC€DÜÔbÕ3GÓbÐdhÓiÐ
iˆ)Ö
iØ�i‰i˜	Ó"ˆØ7:¸a´xˆt�Cœ#˜i›.Õ(Ð)Ð*×1Ñ1Ô3ÀRŠØ�:‰:�<Š<ß!��4�&ˆzÐ+ tÐ+Ø�8‰8�D—J‘J“LÓ!×)Ð) TÐ)r   c                óR   € V ^8„  d   QhR\         R\        R\        \        ,          /# )r   r6   Ú	separatorr   )r   r   r   )r   s   "r   r   r   š   s&   € ÷ #ñ #¤sð #´sð #ÌÔRUÍñ #r   c                ó^  € \        V \        4      '       g   R# V P                  \        4      '       d   \	        V 4      # V P                  \
        4      '       g   R# \        P                  V 4      pV'       d   VP                  ^4      MRP                  4       pVP                  R4      '       d   TMRV 2p\        V 4      pV'       dY   WPJdT   RP                  VP                  \        4      ^ ,          P                  4       4      pV'       d   V'       d	   V V V 2# T# V'       d   V# R# )uæ  Render a slash-skill-expanded turn the way the user typed it:
``"/work â€” fix the title leak"``, ``"/work"`` for a bare invocation, or
``None`` when *content* is not scaffolding. ``separator=" "`` gives the
literal invocation as typed (chat transcripts).

A gateway auto-load scaffold (channel-bound skill on a new session) is also
scaffolding: the typed request follows the skill payload, so it renders as
that request â€” the header/body never reaches a preview or a title (#48359).
Nr   rG   r   )r8   r   r9   rQ   r`   r:   Ú_SKILL_NAME_RErS   rU   r%   rC   r/   r[   ÚSKILL_EXCERPT_JOINT)r6   rb   rS   r   Úlabelr*   s   &&    r   Údescribe_skill_invocationrg   š   sñ   € ô �gœs×#Ò#ÙØ×ÑÔ+×,Ò,Ü/°Ó8Ð8Ø×ÑÔ6×7Ò7ÙÜ× Ñ  Ó)€Eß#ˆE�K‰K˜ŒN¨×2Ñ2Ó4€Dà—O‘O C×(Ò(‰D°°$°¨j€EÜ=¸gÓF€Kß�{Ó1ð —h‘h˜{×0Ñ0Ô1DÓEÀaÕH×NÑNÓPÓQˆßß9=�e�W˜Y˜K¨ }Ð5ÐNÀ;ÐNßˆ5Ð"˜dÐ"r   z([^"]*)z^Skills loaded: (.+)$c                óF   € V ^8„  d   QhR\         R\        \        ,          /# r5   )r   r,   r   )r   s   "r   r   r   ¼   s"   € ÷ jñ j¤sð j¬t´C­yñ jr   c                óL  € \        V \        4      '       g   . # V P                  \        4      '       dQ   \        P                  V 4      '       d4   \        P                  V 4       Uu. uF  qP                  ^4      NK  	  up# . # V P                  \        4      '       g   . # V P                  R^4      ^ ,          p\        V9   du   \        P                  V 4      pV'       dV   VP                  ^4      P                  R4       Uu. uF*  qDP                  4       '       g   K  VP                  4       NK,  	  up# . # \        P                  V 4      pVP                  \         4      '       d2   V'       d*   VP                  ^4      '       d   VP                  ^4      .# . # u upi u upi )a  Skill names a slash-skill, bundle/stacked or gateway auto-load turn carries inline; ``[]`` for any
other text. Only a complete activation header counts, so typed text that merely starts like one
(``[IMPORTANT: The "config" file is broken]``) is not mistaken for a skill load.r.   Ú,)r8   r   r9   rQ   Ú_AUTO_LOAD_HEADER_RErS   ÚfinditerrU   r:   r[   r;   Ú_BUNDLE_LOADED_REÚsearchr%   rd   Úendswithr@   )r6   ÚmÚheaderÚloadedÚnrS   s   &     r   Úskills_loaded_by_scaffoldrt   ¼   sB  € ô �gœs×#Ò#Øˆ	Ø×ÑÔ+×,Ò,ÜOc×OiÑOiÐjq×OrÒOrÔ$8×$AÑ$AÀ'Ô$JÓKÑ$J˜q—‘˜–
Ñ$JÑKÐzÐxzÐzØ×ÑÔ6×7Ò7Øˆ	Ø�]‰]˜4 Ó# AÕ&€FÜ˜ÔÜ"×)Ñ)¨'Ó2ˆßOU 6§<¡<°£?×#8Ñ#8¸Ô#=ÓKÑ#=˜aÇÁÇ”	�—‘–	Ñ#=ÑKÐ]Ð[]Ð]Ü× Ñ  Ó)€EØ%Ÿ™Ô/C×DÒDÏÐSX×S^ÑS^Ð_`×SaÒSaˆE�K‰K˜‹NÐÐiÐgiÐiùò Lùò Ls   Á&FÄF!Ä F!c          	      ó^   € V ^8„  d   QhR\         R\         R\         R\        \         ,          /# )r   ÚmessageÚmarkerÚstop_markerr   rE   )r   s   "r   r   r   Î   s2   € ÷ Wñ Wœð W¤Sð W´sð WÄXÌcÅ]ñ Wr   c                óª   € V! V4      pV^ 8  d   R# W\        V4      ,           R P                  V^4      ^ ,          P                  4       ;'       g    R# )z`Text between *marker* (located with ``find``) and *stop_marker*, stripped; None if absent/empty.N)rW   r[   r%   )rv   rw   rx   r?   Ú
marker_idxs   &&&& r   r<   r<   Î   sN   € á�f“€JØ�A„~ÙØ¤ F£Õ+Ð,Ð-×3Ñ3°KÀÓCÀAÕF×LÑLÓN×VÐVÐRVÐVr   c                ó:   € V ^8„  d   QhR\         \        ,          /# ©r   r   ©r   r   )r   s   "r   r   r   Ö   s   € ÷ %ñ %¬(´3­-ñ %r   c                 óÂ   €  ^ RI Hp  \        P                  ! R4      ;'       g	    V ! R4      pT;'       g    R#   \         d    \        P                  ! R4      p L/i ; i)az  Current platform scope for disabled-skill filtering, or None (CLI, RL,
scripts). A change invalidates the scan cache so each platform sees its
own ``skills.platform_disabled`` view.

Used to detect when the active platform has shifted so :func:`get_skill_commands` can drop a stale cache
that was populated for a different platform's ``skills.platform_disabled`` view (#14536).
)Úget_session_envÚHERMES_PLATFORMÚHERMES_SESSION_PLATFORMN)Úgateway.session_contextr   ÚosÚgetenvÚ	Exception)r   Úresolved_platforms     r   Ú _resolve_skill_commands_platformr‡   Ö   sY   € ð9Ý;ÜŸIšIÐ&7Ó8×fÐf¹OÐLeÓ<fÐð ×$Ð$ Ð$øô ô 9ÜŸIšIÐ&7Ó8Òð9ús   ‚": ¥	: º!AÁAc                ó$   € V ^8„  d   QhR\         /# r|   r   )r   s   "r   r   r   æ   s   € ÷ "ñ "¤cñ "r   c                 ó.   € ^ RI Hp  \        V ! 4       4      # )a.  Effective Hermes home the scan is scoped to (profiles carry their own
``skills.external_dirs``, so a profile switch must invalidate the cache).

A gateway session can switch between profiles that each carry their own ``skills.external_dirs`` (via
``set_hermes_home_override``), but the module-level scan only tracked
``_resolve_skill_commands_platform()``. Switching profiles without a platform change left the previous
profile's skill list cached, so ``get_skill_commands()`` reported a cache miss for skills that only
exist under the new profile (#88023).
©Úget_hermes_home)Úhermes_constantsr‹   r   rŠ   s    r   Ú_resolve_skill_commands_homer�   æ   s   € õ 1Ü‰Ó Ó!Ð!r   c                ó:   € V ^8„  d   QhR\         \        ,          /# r|   r}   )r   s   "r   r   r   ô   s   € ÷ 3ñ 3¬´#­ñ 3r   c                 ó>   € ^ RI Hp  V ! 4       pVe   \        V4      # R# )a  The project root the scan's project skills resolve from (None outside a repo). One multi-session
host serves sessions in different repos; without this tag the first session's project skills stayed
published for every other session's ``get_skill_commands`` lookup (#114359).)Úfind_project_rootN)Úagent.skill_utilsr�   r   )r�   Úroots     r   Ú_resolve_skill_commands_projectr“   ô   s#   € õ 4ÙÓ€DØÒ(Œ3ˆt‹9Ð2¨dÐ2r   c          	      ó´   € V ^8„  d   QhR\         R\         R,          R\        \        \         \        3,          \        R,          \         3,          R,          /# )r   Úskill_identifierÚtask_idNr   )r   ÚtupleÚdictr   r   )r   s   "r   r   r   ý   sQ   € ÷ Pñ P¬#ð P¼¸d½
ð PÌeÔTXÔY\Ô^aÐYaÕTbÔdhÐkoÕdoÔqtÐTtÕNuÐx|ÕN|ñ Pr   c                óš  € ^ RI Hp V! 4       '       d   R# T ;'       g    RP                  4       pV'       g   R#  ^ RIHpHp ^ RIHp V! V4      p\        P                  ! V! WqRR7      4      pTP                  R4      '       g   R# \        TP                  R	4      ;'       g    R4      p	Rp
TP                  R
4      '       d   \        TR
,          4      p
M*T	'       d#    T! 4       \        T	4      P                  ,          p
YŠ\        TP                  R4      ;'       g    T4      3#   \         d     R# i ; i  \         d    Rp
 LGi ; i)zOLoad a skill by name/path and return (loaded_payload, skill_dir, display_name).©Úsafe_worker_enabledNr   )Ú_skills_dirÚ
skill_view©Únormalize_skill_lookup_nameF)r–   Ú
preprocessÚsuccessÚpathÚ	skill_dirr   )Úagent.safe_worker_policyr›   r%   Útools.skills_toolrœ   r�   r‘   rŸ   ÚjsonÚloadsr…   Úgetr   r   Úparent)r•   r–   r›   Úraw_identifierrœ   r�   rŸ   Ú
normalizedÚloaded_skillÚ
skill_pathr£   s   &&         r   Ú_load_skill_payloadr®   ý   s  € å<á×ÒÙØ&×,Ð,¨"×3Ñ3Ó5€NßÙðß=ÝAÙ0°Ó@ˆ
Ü—z’z¡*¨ZÐUZÔ"[Ó\ˆð ×Ñ˜I×&Ò&ÙÜ�\×%Ñ% fÓ-×3Ð3°Ó4€JØ€Ið ×Ñ˜×$Ò$Ü˜ kÕ2Ó3‰	ß	ð	Ù#›¬¨ZÓ(8×(?Ñ(?Õ?ˆIð ¤C¨×(8Ñ(8¸Ó(@×(NÐ(NÀJÓ$OÐOÐOøô ô Úðûô ô 	ØŠIð	ús#   »4D( Ã!!D: Ä(D7Ä6D7Ä:E
Å	E
c                óR   € V ^8„  d   QhR\         R\        R\        \         ,          /# )r   Ú
identifierÚpayloadr   )r   r˜   r   )r   s   "r   r   r     s*   € ÷ oñ o¤cð o´Dð o¼XÄc½]ñ or   c                ó    € \        V\        4      '       d   VP                  R4      MRpV'       d   \         V  RRP	                  V4       2# R# )u¸   ``Ambiguous skill name X: use one of <paths>`` when a failed skill_view *payload* is a same-tier
name collision, else None â€” so preload/cron say why instead of "Unknown"/"not found".Ú
load_namesNz: use one of ú, )r8   r˜   r¨   r   r/   )r°   r±   r³   s   && r   Úambiguous_skill_labelrµ     sI   € ô /9¸Ä$×.GÒ.G�—‘˜\Ô*ÈT€JßZdÔ$Ð% j \°¸t¿y¹yÈÓ?TÐ>UÐVÐnÐjnÐnr   c                ó0   € V ^8„  d   QhR\         R\         /# )r   r°   r   r   )r   s   "r   r   r   $  s   € ÷ Dñ D¤Sð D¬Sñ Dr   c                ó´   €  ^ RI Hp ^ RIHp \        P
                  ! V! V! V 4      RR7      4      p\        Y4      ;'       g    T #   \         d    T u # i ; i)zZDisplay form of an identifier that failed to load (failure path only: re-asks skill_view).)r�   rž   F)r    )r¥   r�   r‘   rŸ   r¦   r§   r…   rµ   )r°   r�   rŸ   r±   s   &   r   Ú_missing_skill_labelr¸   $  sU   € ðÝ0ÝAÜ—*’*™ZÑ(CÀJÓ(OÐ\aÔbÓcˆô ! Ó5×CÐC¸ÐCøô ô ØÒðús   ‚0A ÁAÁAc                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r   Úmissingr   r+   )r   s   "r   r   r   /  s"   € ÷ cñ c¤4¬¥9ð c´ñ cr   c                ó  € V  Uu. uF!  qP                  \        4      '       g   K  VNK#  	  ppV  Uu. uF  qV9  g   K  VNK  	  ppRP                  Y#'       d    RRP                  V4       2.,           4      # . ,           4      # u upi u upi )z�One error line for unresolved preload identifiers: ambiguous ones keep their own wording,
the rest are reported as ``Unknown skill(s): ...``.z; zUnknown skill(s): r´   )r9   r   r/   )rº   rp   Ú	ambiguousÚunknowns   &   r   Úformat_missing_skillsr¾   /  s€   € ñ $ÓL™G�q§|¡|Ô4J×'K—�™G€IÐLÙ!Ó8™'�Q¨iÑ%7�qˆq™'€GÐ8Ø�9‰9�YÖQXÐ%7¸¿	¹	À'Ó8JÐ7KÐ#LÐ"MÕaÓbÐbÐ^`ÕaÓbÐbùò MùÚ8s   …B¦B²B
¿B
c                ól   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          RR/# )r   r¬   r)   r   N)r˜   r   r   r,   )r   s   "r   r   r   7  s-   € ÷ ñ ¤t¬C´¨H¥~ð ¼dÄ3½ið ÈDñ r   c                óÈ  €  ^ RI HpHpHp \	        V P                  R4      ;'       g    V P                  R4      ;'       g    R4      pV! V4      w  rgV! V! V4      4      pV'       g   R# VP                  R4       VP                  R\        4        R24       VP                  R VP                  4        4       4       VP                  R	4       R#   \         d     R# i ; i)
z¨Append a ``[Skill config: ...]`` block with resolved ``metadata.hermes.config``
values so the agent needn't read config.yaml. Any failure leaves the message without it.)Úextract_skill_config_varsÚparse_frontmatterÚresolve_skill_config_valuesÚraw_contentr6   r   Nz[Skill config (from z/config.yaml):c              3   ó\   "  € T F"  w  rR T RV'       d   \        V4      MR 2x € K$  	  R# 5i)z  z = z	(not set)Nr   )rJ   ÚkeyÚvalues   &  r   rN   Ú'_inject_skill_config.<locals>.<genexpr>C  s*   é € ÐlÑ[kÉZÈS�r˜#˜˜c·¤# e¤*¸;Ð!GÕHÓ[kùs   ‚*,Ú])r‘   rÁ   rÂ   rÃ   r   r¨   r1   r   ÚextendÚitemsr…   )	r¬   r)   rÁ   rÂ   rÃ   rÄ   Úfrontmatterr   Úresolveds	   &&       r   Ú_inject_skill_configrÎ   7  sÁ   € ðßoÑoÜ˜,×*Ñ*¨=Ó9×^Ð^¸\×=MÑ=MÈiÓ=X×^Ð^Ð\^Ó_ˆÙ*¨;Ó7‰ˆÙ.Ñ/HÈÓ/UÓVˆßÙØ�‰�RÔØ�‰Ð+Ô,?Ó,AÐ+BÀ.ÐQÔRØ�‰ÑlÐ[c×[iÑ[iÔ[kÓlÔlØ�‰�SÖøÜô Úðús#   ‚&C ©C Á'C Á+A%C ÃC!Ã C!z¯Resolve any relative paths in this skill (e.g. `scripts/foo.js`, `templates/config.yaml`) against that directory, then run them with the terminal tool using the absolute path.z/scripts/foo.js`).z [This skill has supporting fileszwRequired environment setup was skipped. Continue loading the skill and explain any reduced functionality if it matters.c                óh   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          /# )r   r¬   r   )r˜   r   r   r   )r   s   "r   r   r   Y  s&   € ÷ ñ œd¤3¬ 8�nð ´¼#µñ r   c                 óÖ   € V P                  R 4      '       d   \        # V P                  R4      ;'       g5    V P                  R4      '       d   V P                  R4      MR;'       g    R# )Úsetup_skippedÚgateway_setup_hintÚsetup_neededÚ
setup_noteN)r¨   Ú_SETUP_SKIPPED_NOTE)r¬   s   &r   Ú_setup_noterÖ   Y  se   € Ø×Ñ˜×(Ò(Ü"Ð"Ø×ÑÐ0Ó1÷ ð Ø*6×*:Ñ*:¸>×*JÒ*Jˆ×Ñ˜Ô&ÐPT÷ð à	ðr   c                ó‚   € V ^8„  d   QhR\         \        \        3,          R\        R,          R\        \        ,          /# )r   r¬   r£   Nr   )r˜   r   r   r   r,   )r   s   "r   r   r   a  s2   € ÷ 
ñ 
¤D¬¬c¨¥Nð 
¼tÀd½{ð 
ÌtÔTWÍyñ 
r   c                ó>  € V P                  R4      ;'       g    / P                  4       pV UUu. uF=  p\        V\        4      '       g   K  V F  p\	        V4      P                  4       NK  	  K?  	  pppV'       g–   V'       dŽ   R F‡  p\        W,          P                  R4      4      pYW Uu. uFQ  qˆP                  4       '       g   K  VP                  4       '       d   K2  VP                  V4      P                  4       NKS  	  up,          pK‰  	  V# u uppi u upi )zHSkill-relative support file paths: from ``linked_files`` or a disk walk.Úlinked_filesÚ*)Ú
referencesÚ	templatesÚscriptsÚassets)r¨   Úvaluesr8   r,   r   Úas_posixÚsortedÚrglobÚis_fileÚ
is_symlinkÚrelative_to)	r¬   r£   ÚlinkedÚentriesÚentryÚ
supportingÚsubdirÚfilesÚfs	   &&       r   Ú_supporting_filesrí   a  sá   € à×Ñ˜~Ó.×4Ð4°"×<Ñ<Ó>€FÙ8>Ôq¹¨WÄ*ÈWÔVZ×B[Ô(ÓipÐ`e”$�u“+×&Ñ&Ö(ÑipÑ(¹€JÑqßŸ)ÛFˆFÜ˜IÕ.×5Ñ5°cÓ:Ó;ˆEð ÈÓtÉÀ1×QZÑQZ×Q\Ô>Ðef×eqÑeq×esÔ>˜1Ÿ=™=¨Ó3×<Ñ<Ö>ÉÑtÕtŠJñ	 Gð
 Ðùó rùò us   ¯DÁ&DÂ.DÃ
DÃ"#Dr   c                óª   € V ^8„  d   QhR\         \        \        3,          R\        R,          R\        R\        R\        R\        R,          R\        /# )	r   r¬   r£   NÚactivation_noteÚuser_instructionÚruntime_noteÚ
session_idr   )r˜   r   r   r   )r   s   "r   r   r   n  s^   € ÷ 2ñ 2Ü”sœC�x•.ð2ä�d�{ð2ô ð2ô ð	2ô
 ð2ô �d•
ð2ô 	ñ2r   c                óÚ  € ^ RI Hp \        \        V P	                  R4      ;'       g    R4      W\        4       R7      pVRVP                  4       .pV'       d   VRRV R2\        .,          p\        W4       \        V 4      p	V	'       d   VRRV	 R2.,          p\        W4      p
V
'       dl   V'       dd    \        VP                  V! 4       4      4      pVRR	.,          pYŠ Uu. uF  pR
V 2NK
  	  up,          pVP                  RV RV \         24       RpV'       d   VP                  R4       \!        Wƒ4      pV'       d   VRRV R2.,          pRP#                  V4      pVe<   VP%                  V4      '       d%   \'        V4      \'        V4      8”  d   \)        V4       V#   \         d3    \        T P	                  R4      ;'       g    TP                  4      p ELi ; iu upi )z9Format a loaded skill into a user/system message payload.)rœ   r6   r   )Ú
skills_cfgz[Skill directory: rÉ   ú[Skill setup note: r   zP[This skill has supporting files (paths relative to the skill directory above):]z- z)
Load any of these with skill_view(name="zM", file_path="<path>"), or run scripts directly by absolute path (e.g. `node Nz[Runtime note: r.   )r¥   rœ   r
   r   r¨   Ú_load_skills_configr%   Ú_SKILL_DIR_NOTErÎ   rÖ   rí   rå   Ú
ValueErrorr   r1   Ú_SUPPORTING_FILES_ENDr3   r/   r9   rW   r   )r¬   r£   rï   rð   rñ   rò   rœ   r6   r)   rÔ   ré   Úskill_view_targetÚsfr2   rv   s   &&&&&&         r   Ú_build_skill_messagerü   n  sÖ  € õ .ä&ÜˆL×Ñ˜YÓ'×-Ð-¨2Ó.°	ÔReÓRgô€Gð ˜b '§-¡-£/Ð2€EçØ�"Ð*¨9¨+°QÐ7¼ÐIÕIˆÜ˜Ô-Ü˜\Ó*€JßØ�"Ð+¨J¨<°qÐ9Ð:Õ:ˆÜ" <Ó;€Jß—ið	PÜ # I×$9Ñ$9¹+»-Ó$HÓ IÐð 	�"ÐhÐiÕiˆØ jÓ1¡j �B�r�d“)¡jÑ1Õ1ˆØ�‰Ø8Ð9JÐ8Kð Là$˜+Ô&;Ð%<ð>ô	
ð
 €MßØ�‰�RÔô 0°ÓHˆßØ�"˜¨ ~°QÐ7Ð8Õ8ˆØ�i‰i˜Ó€GØÒ  W×%7Ñ%7¸×%FÒ%FÌ3ÈwË<ÔZ]Ð^kÓZlÔKlÜ˜}Ô-Ø€Nøô1 ô 	PÜ # L×$4Ñ$4°VÓ$<×$NÐ$NÀ	ÇÁÓ OÓð	Püò 2s   Â7F( Ã%G(Æ('G%ÇG%Ç$G%c          
      ó¾   € V ^8„  d   QhR\         \        \        \        3,          \        R,          \        3,          R\        R\        R,          R\        R\        /# )r   rr   Nrï   r–   Úmessage_kwargsr   )r—   r˜   r   r   r   )r   s   "r   r   r   £  sY   € ÷ pñ pÜ”$”sœC�x•.¤$¨¥+¬sÐ2Õ3ðpÜFIðpÜTWÐZ^ÕT^ðpÜruðpäñpr   c                ól   € V w  rEp ^ RI Hp V! WbR7       \        WEV3RV/VB #   \         d     Li ; i)z[Bump Curator usage tracking (never fatal) and build the message block for one loaded skill.)Úbump_use©r–   rò   )Útools.skill_usager   r…   rü   )rr   rï   r–   rþ   r¬   r£   Ú
skill_namer   s   &&&,    r   Ú_render_skill_blockr  £  sO   € ð +1Ñ'€L˜Zðõ 	/Ù�Õ-ô   ¸ÑoÐU\ÐoÐ`nÑoÐoøô ô Ùðús   ‡% ¥3²3Ú
lead_linesrº   ÚdisabledÚextra_instructionrð   c                óú   € V ^8„  d   QhR\         R\        \         ,          R\        \         ,          R,          R\        \         ,          R,          R\        \         ,          R,          R\         R\         R	\         /# )
r   ÚsubjectÚloaded_namesr  Nrº   r  r  rð   r   )r   r,   )r   s   "r   r   r   ³  sq   € ÷ ñ ÜðÜ $¤S¥	ðÜ:>¼s½)ÀdÕ:Jðä”#�Y˜Õðä04´Sµ	¸DÕ0@ðô ðô 47ðô 	ñ	r   c               ó�  € RV  R\        V4       R2R.T;'       g    . ORRP                  V4       2NpV'       d$   VP                  RRP                  V4       24       V'       d$   VP                  RRP                  V4       24       V'       d   VRR	V 2.,          pV'       d   VRR
V 2.,          pRP                  V4      # )z’Header for multi-skill messages (bundles and stacked invocations).
``subject`` must end in " skill bundle" so the bundle-format extractor applies.r   z
, loading zL skills together. Treat every skill below as active guidance for this turn.]r   zSkills loaded: r´   zSkills missing (skipped): z-Skills disabled for this platform (skipped): zBundle instruction: zUser instruction: r.   )rW   r/   r1   )r	  r
  r  rº   r  r  rð   Úliness   &&$$$$$ r   Ú_scaffold_headerr  ³  sé   € ð 0°¨yð 9Ü�|Ó$Ð%ð &-ð	-ð 	ð	ð
 ×
Ð
˜ðð ˜$Ÿ)™) LÓ1Ð2Ð3ð€E÷ Ø�‰Ð1°$·)±)¸GÓ2DÐ1EÐFÔGßØ�‰ÐDÀTÇYÁYÈxÓEXÐDYÐZÔ[ßØ�"Ð,Ð->Ð,?Ð@ÐAÕAˆßØ�"Ð*Ð+;Ð*<Ð=Ð>Õ>ˆØ�9‰9�UÓÐr   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# r   rE   )r   s   "r   r   r   Ð  s"   € ÷ bñ b¤sð b¬x¼­}ñ br   c                ó\   € ^ RI Hp \        V 4      pV'       d   V! V4      f   R# RV RV  2# )u±  User-facing note when *name*'s slash slug is a core command (name or alias), else None.

The single source of the collision predicate: ``scan_skill_commands`` uses it to skip
auto-registration (the shadowing guard from 370ebf2d3 â€” the skill map is consulted before
built-in handlers), and the ``/skills`` listing plus the command palette render the note so
the skipped skill is explained where the user looks, not only in the log.
)Úresolve_commandNzslash command /u4    unavailable â€” name taken by built-in; use /skill )Úhermes_cli.commandsr  r'   )r   r  Úcmd_names   &  r   Úskill_command_collision_noter  Ð  s7   € õ 4Ü! $Ó'€Hß‘ xÓ0Ò8ÙØ˜X˜JÐ&ZÐ[_ÐZ`ÐaÐar   c                ó�   € V ^8„  d   QhR\         R\        R\        R\        \        \        \        \        3,          3,          RR/# )r   Úskill_mdr  Ú
seen_namesÚcommandsr   N)r   Úsetr˜   r   r   )r   s   "r   r   r   ß  sO   € ÷ "\ñ "\œTð "\¬Sð "\¼cð "\ÌTÔRUÔW[Ô\_ÔadÐ\dÕWeÐReÕMfð "\Ðkoñ "\r   c           
     ó¬  € ^ RI HpHpHpHp \
        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   R# V! V P                  RR7      4      w  r‰V! V4      '       d   V! V4      '       d   V! V4      '       g   R# VP                  RV P                  P                  4      p
W¢9   g   W¡9   d   R# VP                  R	R
4      ;'       g1    \        R V	P                  4       P                  R4       4       R
4      pVP                  V
4       \        V
4      pV'       g   R# \!        V
4      e   \"        P%                  RW¬V
4       R# RV 2pWÓ9   d'   \"        P%                  RW­W=,          R,          4       R# RT
R	T;'       g    RV
 R2R\'        V 4      R\'        V P                  4      /W=&   R# )zGRegister one SKILL.md in *commands* (no-op when filtered or colliding).)Ú_parse_frontmatterÚskill_matches_appsÚskill_matches_platformÚskill_matches_environmentc              3   ó2   "  € T F  q\         9   x € K  	  R # 5irI   )Ú_SCAN_SKIP_PARTS)rJ   Úparts   & r   rN   Ú!_scan_skill_md.<locals>.<genexpr>â  s   é € Ð
?±¨Ô#Ö#³ùs   ‚TFNú	utf-8-sig)Úencodingr   Údescriptionr   c              3   óÌ   "  € T FZ  qP                  4       '       g   K  VP                  4       P                  R 4      '       d   KA  VP                  4       R,          x € K\  	  R# 5i)Ú#:NéP   NN)r%   r9   )rJ   Úlines   & r   rN   r!  ì  sD   é € ÐuÑ'?˜tÇ:Á:Ç<Ô	ÐX\×XbÑXbÓXd×XoÑXoÐps×XtÔ	ˆ�‰‹�c×	Ò	Ó'?ùs   ‚A$ž"A$ÁA$r.   z†Skill %r generates slash command '/%s' which collides with a core Hermes command; skipping auto-registration. Use '/skill %s' instead.rG   zaSkill %r maps to slash command %s already claimed by %r; keeping the first and skipping this one.úInvoke the z skillÚskill_md_pathr£   )r¥   r  r  r  r  Úanyr)   Ú	read_textr¨   r©   r   rY   r%   r[   Úaddr'   r  ÚloggerÚwarningr   )r  r  r  r  r  r  r  r  rÌ   Úbodyr   r$  r  Úcmd_keys   &&&&          r   Ú_scan_skill_mdr2  ß  sž  € ç{Ó{ß
ƒsÑ
?°·²Ó
?‡s‡s‚sÑ
?°·²Ó
?×?Ò?ÙÙ*¨8×+=Ñ+=À{Ð+=Ó+SÓTÑ€Ká! +×.Ò.Ñ6OÐP[×6\Ò6\Ñdvð  xC÷  eDò  eDÙØ�?‰?˜6 8§?¡?×#7Ñ#7Ó8€DØÔ˜TÔ-ÙØ—/‘/ -°Ó4÷ ð ¼Ùu t§z¡z£|×'9Ñ'9¸$Ô'?ÓuØ
ó9€Kð ‡N�N�4ÔÜ! $Ó'€HßÙô $ DÓ)Ò5Ü�‰ð NØOSÐ_cô	eáð �(�ˆn€GØÔÜ�‰ÐzØ hÕ&7¸Õ&?ô	AáØ  }°k×6_Ð6_À{ÐSWÐRXÐX^ÐE_Ø(¬#¨h«-¸ÄcÈ(Ï/É/ÓFZð\€HÓr   c                óh   € V ^8„  d   QhR\         \        \         \        \        3,          3,          /# r|   ©r˜   r   r   )r   s   "r   r   r     s%   € ÷ *ñ *œT¤#¤t¬C´¨H¥~Ð"5Õ6ñ *r   c                 ó  € ^ RI Hp  V ! 4       '       d   / # \        4       \        4       \	        4       3p\        4       p/ p ^ RIHpHp V! 4       p\        4       pV! 4        F1  pVR,          R8X  g   K   \        \        VR,          4      WgV4       K3  	  \        ;_uu_ 4        V\         V&   V\"        V&   R	R	R	4       V#   \         d     Kn  i ; i  \         d    \        P                  RRR7        Lai ; i  + '       g   i     T# ; i)
a.  Scan skill dirs and return {"/skill-name": {name, description, skill_md_path, skill_dir}}.
Builds a local map and publishes once at the end: writing straight into the
global exposed partial results to overlapping scans, which then logged
bogus "already claimed" collisions against their own incumbents.rš   )Ú_get_disabled_skill_namesÚ_skill_catalogÚstatusÚuniquer¢   zSkill command scan failedT©Úexc_infoN)r¤   r›   r‡   r�   r“   Ú_skill_dirs_signaturer¥   r6  r7  r  r2  r   r…   r.  ÚdebugÚ_publish_lockÚ_skill_commands_by_keyÚ_skill_commands_sig_by_key)	r›   rÆ   Ú	signaturer  r6  r7  r  r  rè   s	            r   Úscan_skill_commandsrB    s÷   € õ
 =á×ÒØˆ	Ü+Ó-Ô/KÓ/MÔOnÓOpÐ
q€Cô &Ó'€IØ*,€HðAßOÙ,Ó.ˆÜ›%ˆ
ñ $Ö%ˆEØ�X� (Ö*ðÜ"¤4¨¨f­Ó#6¸ÈhÖWñ &÷ 
Žð '/Ô˜sÑ#Ø*3Ô" 3Ñ'÷ 
ð €Oøô !ô Úðûäô AÜ�‰Ð0¸4ˆÖ@ðAú÷
 
Žð €OúsB   Á .C Á4C ÂC Â#C:Ã CÃC ÃCÃC Ã"C7Ã6C7Ã:D	c                ó$   € V ^8„  d   QhR\         /# r|   )r—   )r   s   "r   r   r   5  s   € ÷ ñ ¤Eñ r   c            
     ó6  € ^ RI Hp Hp ^ RIHpHp \        ;_uu_ 4        \        \        4      pRRR4       \        X UUUu0 uF  w  rVqv'       g   K  Wg3kK  	  uppp4      R\         pRR\        4       3.p	V Fc  w  rgV! V4      p
T! T;'       g    \        P                  P                  4      p V	P                  Wg\        4       34       V ! V4       V! V
4       Ke  	  \!        V	4      #   + '       g   i     LÅ; iu upppi   T ! T4       T! T
4       i ; i)a9  Signature of every skill scope a session has resolved commands for, plus the ambient one.

One gateway serves sessions in several profiles and repos; each published ``(platform, home,
project)`` key names a scope whose roots (that profile's skills/external dirs, that repo's trusted
project skills) a viewer is looking at. The change watcher (``skills.changed``) compares this, so
an install in a session's repo B notifies viewers even when the gateway was launched in repo A.
Only command maps/catalogs refetch; a conversation's stored system prompt is never rebuilt.
)Úreset_session_cwdÚset_session_cwd©Úreset_hermes_home_overrideÚset_hermes_home_overrideNr   )Úagent.runtime_cwdrE  rF  rŒ   rH  rI  r>  r,   r?  rá   Ú_MAX_WATCHED_SCOPESr<  rƒ   r¢   Úsepr1   r—   )rE  rF  rH  rI  ÚkeysÚ	_platformÚhomeÚprojectÚscopesÚrowsÚ
home_tokenÚ	cwd_tokens               r   Úpublished_scopes_signaturerU  5  sä   € ÷ EßUß	ŽÜÔ*Ó+ˆ÷ 
äÁTÕRÁTÑ)A¨¸'ËT”_�d“_ÁTÓRÓSÐThÔUhÐi€FØ�Ô,Ó.Ð/Ð0€DÛ‰ˆÙ-¨dÓ3ˆ
á# G×$:Ð$:¬r¯w©w¯{©{Ó;ˆ	ð	3Ø�K‰K˜Ô(=Ó(?Ð@ÔAá˜iÔ(Ù& zÖ2ñ  ô �‹;Ð÷ 
�üäRøñ ˜iÔ(Ù& zÕ2ús#   ŸC,ÁC?ÁC?Â2DÃ,C<	ÄDc                ó:   € V ^8„  d   QhR\         \        ,          /# r|   )r   r—   )r   s   "r   r   r   P  s   € ÷ ñ œx¬�ñ r   c                 óÌ   € ^ RI Hp HpHp  V! 4       w  r4T! V UUu. uF  w  rVVNK	  	  uppV ! 4       4      # u uppi   \         d    \
        P                  RRR7        R# i ; i)añ  Stat-cheap change signature of every skill root (the catalog's own: the mtime and child names of
every directory the catalog walks, depth-bounded, plus the disabled set and the platform). None when
it cannot be computed (a root that cannot be stat'ed), which keeps the published map rather than
rescanning on every lookup. Any other error raises: the catalog scan itself takes the same signature
unguarded (``tools.skills_tool._skill_catalog``), and a swallowed bug would pin a stale map silently.)r6  Úskill_search_dirsÚ_skills_scan_signaturezSkill dir signature failedTr:  N)r¥   r6  rX  rY  ÚOSErrorr.  r=  )r6  rX  rY  ÚrootsÚ_activeÚ_tierÚds          r   r<  r<  P  sb   € ÷ gÑfðÙ*Ó,‰ˆÙ%¹Ô&?¹©X¨U£q¹Ò&?ÑAZÓA\Ó]Ð]ùÓ&?øÜô Ü�‰Ð1¸DˆÔAÚðús   Œ= œ7
©= ·= ½"A#Á"A#c                óh   € V ^8„  d   QhR\         \        \         \        \        3,          3,          /# r|   r4  )r   s   "r   r   r   _  s%   € ÷ !ñ !œD¤¤d¬3´¨8¥nÐ!4Õ5ñ !r   c                 ó^  € ^ RI Hp  V ! 4       '       d   / # \        4       \        4       \	        4       3p\
        ;_uu_ 4        \        P                  V4      p\        P                  V4      pRRR4       Xe   \        4       pVe   Xe   WC8X  d   V# \        4       #   + '       g   i     L8; i)a�  Return the current skill commands mapping (scan first if empty). Rescans
when the platform scope (one gateway serving Telegram and Discord) or the
active profile's home (Desktop profile switch) or the session's project root (two sessions in two
repos) changes, so each sees its own ``platform_disabled`` / ``external_dirs`` / project-skill view.

See #14536, #88023, #114359, #104849.
rš   N)r¤   r›   r‡   r�   r“   r>  r?  r¨   r@  r<  rB  )r›   rÆ   ÚcachedÚ
scanned_atÚcurrents        r   Úget_skill_commandsrd  _  s�   € õ =á×ÒØˆ	Ü+Ó-Ô/KÓ/MÔOnÓOpÐ
q€Cß	ŽÜ'×+Ñ+¨CÓ0ˆÜ/×3Ñ3°CÓ8ˆ
÷ 
ð Òô (Ó)ˆØŠ?˜jÒ0°GÔ4IØˆMô Ó Ð ÷ 
�ús   Á+BÂB,	c                ó   € V ^8„  d   QhRR/# )r   r   N© )r   s   "r   r   r   ƒ  s   € ÷ *ñ *¨$ñ *r   c                 ód   € \         ;_uu_ 4        / sRsRRR4       R#   + '       g   i     R# ; i)z(Drop the cached plugin skill projection.N)r>  Ú_plugin_skill_commandsÚ_plugin_skill_commands_tagrf  r   r   Ú invalidate_plugin_skill_commandsrj  ƒ  s!   € ÷ 
ŽØ!#ÐØ%)Ð"÷ 
��Šús   �ž/	c                óh   € V ^8„  d   QhR\         \        \         \        \        3,          3,          /# r|   r4  )r   s   "r   r   r   ‹  s%   € ÷ ñ ¤4¬¬T´#´s°(­^Ð(;Õ#<ñ r   c                 óÒ  € ^ RI Hp  ^ RIHpHp ^ RIHp ^ RIHp V! 4        V! 4       pVP                  4       p\        V! 4       4      \        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      3p\        ;_uu_ 4        \        \        V8H  r˜RRR4       X	'       g   \        WVV4      pV ! 4       p
V! 4       pV
'       g   V'       g   X# XP!                  4        UUu/ uFe  w  rÍVR,          V
9   d   K  VR,          P#                  R^4      ^,          V
9   d   K<  VR,          P#                  R^4      ^ ,          V9   d   Kc  WÍbKg  	  upp#   + '       g   i     LÆ; iu uppi )	zòProject enabled plugin skills into the interactive-only slash namespace (``/plugin:skill``).

Config disable lists (``skills.disabled``, ``plugins.disabled``) are applied on EVERY call, so a
config-only disable takes effect without a rescan.
©Úget_disabled_skill_names)Údiscover_pluginsÚget_plugin_manager)Ú_get_disabled_pluginsrŠ   c              3   ój   "  € T F)  p\        VP                  R 4      ;'       g    R4      x € K+  	  R# 5i)r   r   N)r   r¨   )rJ   rp   s   & r   rN   Ú,get_plugin_skill_commands.<locals>.<genexpr>™  s(   é € Ð(TÉ8Àa¬¨Q¯U©U°6«]×-@Ð-@¸b×)AÐ)AË8ùs   ‚!3¤3Nr   Ú:)r‘   rn  Úhermes_cli.pluginsro  rp  Úhermes_cli.plugins_discoveryrq  rŒ   r‹   Úlist_plugin_skill_metadatar   r—   r>  rh  ri  Ú_scan_plugin_skill_commandsrË   r[   )rn  ro  rp  rq  r‹   ÚmanagerÚmetadataÚtagra  Úis_freshr  Údisabled_pluginsrÆ   Úinfos                 r   Úget_plugin_skill_commandsr  ‹  s$  € õ ;ßGÝBÝ0áÔÙ Ó"€GØ×1Ñ1Ó3€HÜ‰Ó Ó!§5¤5Ñ(TÉ8Ó(T§5¡5Ñ(TÉ8Ó(TÓ#TÐ
U€Cß	ŽÜ1Ô3MÐQTÑ3T�÷ 
çÜ,¨WÀÓDˆÙ'Ó)€HÙ,Ó.Ðß×,Øˆà#)§<¡<¤>ôÙ#1‘i�cØ�V• Ñ(ô 	Ø,0°­L×,>Ñ,>¸sÀAÓ,FÀqÕ,IÈXÑ,Uô 	à˜•<×%Ñ% c¨1Ó-¨aÕ0Ð4DÑDô 	ˆŠ	¡>òð ÷ 
�üós$   ÂEÃ!E#Ã8"E#Ä"E#ÅE#ÅE 	c          
      ó€   € V ^8„  d   QhR\         R\        R\        \        \        \        \        3,          3,          /# )r   rz  r{  r   )r,   r—   r˜   r   r   )r   s   "r   r   r   ©  s8   € ÷ #ñ #´4ð #¼eð #ÌÌSÔRVÔWZÔ\_ÐW_ÕR`ÐM`ÕHañ #r   c                óŠ  € ^ RI HpHpHpHp / pV EFk  p\        VP                  R4      ;'       g    R4      P                  4       p	RV	9  d   K?  V P                  V	4      p
V
e   V
P                  4       '       g   Kl   V! V
P                  RRR7      4      w  r¼T! T4      '       d   T! T4      '       d   T! T4      '       g   K´  R	T	P                  4        2p\        T	4      f   Y×9   d   \        P                  R
T	4       Kò  RT	R\        TP                  R4      ;'       g     TP                  R4      ;'       g    RT	 R24      P                  4       RT	R\        T
4      R\        T
P                   4      RR/Y}&   EKn  	  \"        ;_uu_ 4        WrussRRR4       V#   \         d     EKœ  i ; i  + '       g   i     T# ; i)zIBuild the plugin skill projection and publish it with its tag atomically.)r  r  r  r  r   r   rt  Nr"  r#   )r#  ÚerrorsrG   zAPlugin skill %r collides with an existing slash command; skippingr$  r)  z plugin skillr•   r*  r£   ÚsourceÚplugin)r¥   r  r  r  r  r   r¨   r%   Úfind_plugin_skillrã   r,  rZ  r"   r  r.  r/  r©   r>  rh  ri  )ry  rz  r{  r  r  r  r  r  rè   Ú	qualifiedr  Úparsedr   rÆ   s   &&&           r   rx  rx  ©  s«  € ÷ó ð
 +-€HÜˆÜ˜Ÿ	™	 &Ó)×/Ð/¨RÓ0×6Ñ6Ó8ˆ	Ø�iÔÙØ×,Ñ,¨YÓ7ˆØÒ 8×#3Ñ#3×#5Ò#5Ùð	Ù*¨8×+=Ñ+=À{Ð[dÐ+=Ó+eÓf‰IˆFñ ' v×.Ò.Ñ3LÈV×3TÒ3TÑYkÐlr×YsÒYsÙØ�)—/‘/Ó#Ð$Ð%ˆÜ'¨	Ó2Ò>À#Ä/Ü�N‰NÐ^Ð`iÔjÙà�I˜}¬c°&·*±*¸]Ó2K÷ 3\ð 3\ÈuÏyÉyÐYfÓOg÷ 3\ð 3\Ø7BÀ9À+È]Ð5[ó/]ß]bÑ]bÓ]dØ 	¨?¼CÀ»MØœ˜XŸ_™_Ó-¨x¸ð	
ˆŒñ% ÷0 
ŽØ=EÐ:ÐÐ :÷ 
à€Oøô# ô 	Ûð	ú÷ 
Žà€Oús   Á>FÆF1ÆF.Æ-F.Æ1G	c          
      ó  € V ^8„  d   QhR\         \        \         \        \        3,          3,          R\         \        \         \        \        3,          3,          R\         \        \         \        \        3,          3,          /# )r   Úfilesystem_commandsÚplugin_commandsr   r4  )r   s   "r   r   r   Ï  s]   € ÷ 
ñ 
Üœc¤4¬¬S¨¥>Ð1Õ2ð
ÜEIÌ#ÌtÔTWÔY\ÐT\Í~ÐJ]ÕE^ð
ä	Œ#Œt”Cœ�H�~Ð
Õñ
r   c                ó®   € \        V 4      pVP                  4        F5  w  r4W29   d'   \        P                  RW2V,          R,          4       K1  WBV&   K7  	  V# )zFMerge interactive sources with filesystem commands winning collisions.z3Plugin skill %r collides with %r; keeping the firstr   )r˜   rË   r.  r/  )r‰  rŠ  r  Úcommandr~  s   &&   r   Ú!_merge_interactive_skill_commandsr�  Ï  sU   € ô Ð'Ó(€HØ(×.Ñ.Ö0‰ˆØÔÜ�N‰NÐPÐRYÐdkÕ[lÐmsÕ[tÖuà $�WÓñ	 1ð
 €Or   c                óh   € V ^8„  d   QhR\         \        \         \        \        3,          3,          /# r|   r4  )r   s   "r   r   r   Ü  s%   € ÷ ñ ¬¬S´$´s¼C°xµ.Ð-@Õ(Añ r   c                 óò   € \        4       \        4       \        4       3p \        \	        4       \        4       4      p\        ;_uu_ 4        \        V4      \        V &   RRR4       V#   + '       g   i     T# ; i)z‹Filesystem skills plus profile-scoped plugin skills; never use for
messaging/native command menus (plugin skills are CLI/TUI/desktop only).N)	r‡   r�   r“   r�  rd  r  r>  r˜   Ú'_last_interactive_skill_commands_by_key)Úidentityr  s     r   Úget_interactive_skill_commandsr’  Ü  sZ   € ô 1Ó2Ô4PÓ4RÔTsÓTuÐv€HÜ0Ô1CÓ1EÔG`ÓGbÓc€Hß	ŽÜ<@À»NÔ/°Ñ9÷ 
à€O÷ 
Žà€Oús   ÁA%Á%A6	c                ó¢   € V ^8„  d   QhR\         \        \        3,          R\         \        \        3,          R\         \        \        3,          /# )r   ÚbeforeÚafterr   r4  )r   s   "r   r   r   æ  s<   € ÷ ñ ¤4¬¬S¨¥>ð ¼$¼sÄC¸x½.ð ÌTÔRUÔWZÐRZÍ^ñ r   c                óp  € R\        \        V4      \        V 4      ,
          4       Uu. uF  pRVRW,          /NK  	  upR\        \        V 4      \        V4      ,
          4       Uu. uF  pRVRW,          /NK  	  upR\        \        V4      \        V 4      ,          4      R\        V4      /# u upi u upi )z“Diff two {name: description} snapshots into added/removed/unchanged/total.
Removed entries carry the pre-rescan description (the file may be gone).Úaddedr   r$  ÚremovedÚ	unchangedÚtotal)rá   r  rW   )r”  r•  rs   s   && r   Údiff_command_snapshotsr›  æ  s    € ð 	ÄÄsÈ5ÃzÔTWÐX^ÓT_ÕG_Ô@`ÓaÑ@`¸1�6˜1˜m¨U­XÓ6Ñ@`ÑaØÄ6Ì#ÈfË+ÔX[Ð\aÓXbÕJbÔCcÓdÑCc¸a�V˜Q ¨v­yÓ9ÑCcÑdØ”VœC ›J¬¨V«Õ4Ó5Ø”�U“ð	ð ùÚaùÚds   ¨B.Á&B3
c                ó–   € V ^8„  d   QhR\         \        \         \        \        3,          3,          R\         \        \        3,          /# )r   Úcmdsr   r4  )r   s   "r   r   r   ñ  s8   € ÷ bñ bœ4¤¤T¬#¬s¨(¥^Ð 3Õ4ð b¼¼cÄ3¸h½ñ br   c                ó¼   € V P                  4        UUu/ uF:  w  rVP                  R4      T;'       g    / P                  R4      ;'       g    RbK<  	  upp# u uppi )zL``{"/slug": info}`` -> ``{"slug": description}`` for diff_command_snapshots.rG   r$  r   )rË   rX   r¨   )r�  rÆ   r~  s   &  r   Úcommand_snapshotrŸ  ñ  sM   € àTX×T^ÑT^ÔT`ÔaÑT`ÁyÀsˆC�J‰J�s‹O˜dŸj˜j b×-Ñ-¨mÓ<×BÐBÀÒBÑT`ÒaÐaùÓas   ”A´AÁAc                óF   € V ^8„  d   QhR\         \        \        3,          /# r|   r4  )r   s   "r   r   r   ö  s   € ÷ "ñ "”tœC¤˜H•~ñ "r   c                 ó   € \        4       \        4       \        4       3p \        ;_uu_ 4        \        P                  V 4      pRRR4       Xf…   \        ;_uu_ 4        \        \        P                  V / 4      4      p\        '       dC   \        ^ ,          V ^,          8X  d*   \        P                  4        F  w  r#W!9  g   K  W1V&   K  	  RRR4       \        V4      p\        ;_uu_ 4        \        P                  4        RRR4       ^ RIHp V! 4        \        4        \!        4       p\#        V\%        4       4      p\        V4      p\'        WH4      p	\        ;_uu_ 4        V\        V &   RRR4       \)        V4      V	R&   V	#   + '       g   i     ELJ; i  + '       g   i     LÕ; i  + '       g   i     L²; i  + '       g   i     LZ; i)a¨  Re-scan skill dirs and return a diff of the slash-command map (``added``
/ ``removed`` / ``unchanged`` / ``total`` / ``commands``; descriptions are the
full frontmatter field). Does NOT invalidate the skills system-prompt cache:
skills are called by name, so ``/reload-skills`` costs no cache reset. The
plugin projection is rebuilt too, so a plugin enabled/disabled/installed
since the last scan shows up without a restart.N)Úclear_skills_cacher  )r‡   r�   r“   r>  r�  r¨   r˜   r?  ri  rh  rË   rŸ  Úclearr¥   r¢  rj  rB  r�  r  r›  rW   )
rÆ   Úbefore_commandsrŒ  r~  r”  r¢  Únew_commandsÚeffective_commandsr•  Úresults
             r   Úreload_skillsr¨  ö  sJ  € ô ,Ó-Ô/KÓ/MÔOnÓOpÐ
q€Cß	ŽÜA×EÑEÀcÓJˆ÷ 
àÒ÷ Ž]Ü"Ô#9×#=Ñ#=¸cÀ2Ó#FÓGˆOß)Ó)Ô.HÈÕ.KÈsÐSTÍvÔ.UÜ%;×%AÑ%AÖ%C‘M�GØÖ5Ø37¨Ó0ñ &D÷ ô ˜oÓ.€Fß	Žô 	×$Ñ$Ô&÷ 
õ 5ÙÔÜ$Ô&Ü&Ó(€LÜ:¸<ÔIbÓIdÓeÐÜÐ/Ó0€EÜ# FÓ2€Fß	ŽØ7IÔ/°Ñ4÷ 
äÐ/Ó0€Fˆ:ÑØ€M÷5 
�ˆú÷
 �]ú÷ 
�ú÷ 
�ús6   ¬FÁA!FÃFÃ+F*Å!
F=ÆF	ÆF'	Æ*F:	Æ=G	ÚinteractiveFc                óR   € V ^8„  d   QhR\         R\        R\        \         ,          /# )r   rŒ  r©  r   )r   Úboolr   )r   s   "r   r   r     s+   € ÷ qñ q¤sð q¼Dð qÌXÔVYÍ]ñ qr   c               óT   € \        Y'       d   \        4       4      # \        4       4      # )a  Resolve a user-typed slash command, or return None.

Try the exact qualified spelling before the filesystem skill slug fallback,
where underscores and hyphens are interchangeable for Telegram. Native
callers retain the filesystem-only lookup; plugin skills are interactive.
)Úresolve_slash_keyr’  rd  )rŒ  r©  s   &$r   Úresolve_skill_command_keyr®    s#   € ô ˜WÎ+Ô&DÓ&FÓpÐpÔ[mÓ[oÓpÐpr   c                ót   € V ^8„  d   QhR\         R\        \         \        3,          R\        \         ,          /# )r   rŒ  Útabler   )r   r   r   r   )r   s   "r   r   r   %  s.   € ÷ 1ñ 1œsð 1¬7´3¼°8Õ+<ð 1ÄÌ#Åñ 1r   c                ó¦   € V '       g   R# RV P                  4        2pW!9   d   V# RV P                  RR4      P                  4        2pW19   d   V# R# )zZ``command`` -> ``"/slug"`` when present in *table* (``_`` normalized to ``-``), else None.NrG   r   r   )r"   r#   )rŒ  r°  Ú	exact_keyr1  s   &&  r   r­  r­  %  sX   € çÙØ�G—M‘M“OÐ$Ð%€IØÔØÐØ�'—/‘/ # sÓ+×1Ñ1Ó3Ð4Ð5€GØÔ&ˆ7Ð0¨DÐ0r   c                óx   € V ^8„  d   QhR\         R\         R\         R,          R\         R\        \         ,          /# )r   r1  rð   r–   Nrñ   r   rE   )r   s   "r   r   r   0  sC   € ÷ 
tñ 
tÜð
tÜ$'ð
tÜ7:¸Tµzð
tÜX[ð
täŒc…]ñ
tr   c                óì   € \        4       P                  V 4      pV'       d.   \        VP                  R4      ;'       g
    VR,          VR7      MRpV'       g   R# RV^,           R2p\        WVW!VR7      # )zGBuild the user message for a skill slash command, or None if not found.r•   r£   r  Nz&[IMPORTANT: The user has invoked the "zf" skill, indicating they want you to follow its instructions. The full skill content is loaded below.])rð   rñ   )r’  r¨   r®   r  )r1  rð   r–   rñ   Ú
skill_inforr   Únotes   &&&&   r   Úbuild_skill_invocation_messager·  0  sv   € ô 0Ó1×5Ñ5°gÓ>€Jßt~Ô  §¡Ð0BÓ!C×!^Ð!^ÀzÐR]ÕG^ÐhoÕpð  EI€FßÙØ4°V¸AµY°Kð @Wð W€Dä˜v¨WÐfrÔsÐsr   c                ót   € V ^8„  d   QhR\         R\        R\        \        \         ,          \         3,          /# )r   Úrestr©  r   )r   r«  r—   r,   )r   s   "r   r   r   C  s3   € ÷ #ñ #¤sð #¼Dð #ÌUÔSWÔX[ÕS\Ô^aÐSaÕMbñ #r   c               ó„  € . pT ;'       g    Rp\        V4      \        ^,
          8  dˆ   VP                  4       pVP                  R4      '       g   M_VP	                  R^4      R.,           R,          w  rV\        VP                  R4      VR7      pVe   Wr9   d   MVP                  V4       TpK¢  W#P                  4       3# )ai  Consume further leading ``/skill`` tokens from *rest* (text after the first
matched command); stops at the first non-skill (or repeated) token, which
starts the user instruction. Returns ``(extra_cmd_keys, remaining_instruction)``.
Native callers (messaging gateway) must pass ``interactive=False``: plugin
skills are interactive-only and must not resolve here.r   rG   N:Nr   N)r©  )rW   Ú_MAX_STACKED_SKILLSrX   r9   r[   r®  r1   r%   )r¹  r©  rM  Ú	remainingÚstrippedÚtokenrM   r1  s   &$      r   Úsplit_stacked_skill_commandsr¿  C  s¨   € ð €DØ—
�
˜€IÜ
ˆd‹)Ô)¨AÕ-Ô
-Ø×#Ñ#Ó%ˆØ×"Ñ" 3×'Ò'ØØ—~‘~ d¨AÓ.°"°Õ5°rÕ:‰ˆÜ+¨E¯L©L¸Ó,=È;ÔWˆØŠ?˜gœoØØ�‰�GÔØŠ	Ø—‘Ó"Ð"Ð"r   c                óÚ   € V ^8„  d   QhR\         \        ,          R\        R\        R,          R\        \        \        \         \        ,          \         \        ,          3,          ,          /# )r   Úcmd_keysrð   r–   Nr   )r,   r   r   r—   )r   s   "r   r   r   X  sS   € ÷ Iñ IÜ”3�iðIÜ+.ðIÜ>AÀD½jðIäŒe”Cœœc�¤D¬¥IÐ-Õ.Õ/ñIr   c                ó  aa€ \        4       oV  Uu. uF  q3'       g   K  VNK  	  pp\        VVV3R lR SR R7      w  rVrxV'       g   R# RP                  V4      p	\        RV	 R2WVVR	7      p
R
P                  V
.VO4      WV3# u upi )züBuild the user message for a stacked multi-skill slash invocation:
``(message, loaded_skill_names, missing_skill_names)``, or ``None`` when no skill loaded.
Keys come from ``split_stacked_skill_commands``; native callers only ever pass filesystem keys.c                 óŒ   <€ V S9   d<   \        SV ,          P                  R 4      ;'       g    SV ,          R,          SR7      # R# )r•   r£   r  N)r®   r¨   )r1  r  r–   s   &€€r   Ú<lambda>Ú8build_stacked_skill_invocation_message.<locals>.<lambda>b  sc   ø€ ð  NUð  Yaô  NaÔ+¨H°WÕ,=×,AÑ,AÐBTÓ,U×,wÐ,wÐYaÐbiÕYjÐkvÕYwð  BIô  Jð  kð  gkð  kr   c                 ó   € R V  R2# )z1[Loaded as part of the stacked skill invocation "z".]rf  ©r   s   &r   rÄ  rÅ  c  s   € ÐHÈÈÈcÑRr   c                 ó$   € V P                  R 4      # )rG   )rX   )Úks   &r   rÄ  rÅ  d  s   € ¨¯©°#¬r   )Úmissing_labelNr   Ú"z" stacked skill bundle)rº   rð   ú

)r’  Ú_load_skill_blocksr/   r  )rÁ  rð   r–   rÉ  rM  r
  rº   Ú	_disabledÚskill_blocksÚtypedrq   r  s   &&f        @r   Ú&build_stacked_skill_invocation_messagerÑ  X  sœ   ù€ ô .Ó/€HÙÓ%‘x�!£1�AˆA‘x€DÐ%Ü5GØõ 	kÙRØÑ6ô	6Ñ2€L˜9÷ ÙØ�H‰H�T‹N€EÜ  % Ð(>Ð?Àð  rBô  C€FØ�K‰K˜Ð/ ,Ð/Ó0°,ÐHÐHùò &s
   ‘	BŸBc                ó>   € V ^8„  d   QhR\         R,          R\        /# )r   ÚplatformNr   )r   r  )r   s   "r   r   r   m  s   € ÷ ñ ¤C¨$¥Jð ¼#ñ r   c                óX   €  ^ RI Hp V! V R7      #   \         d    \        4       u # i ; i)zDOperator-disabled skill names (empty set when config is unreadable).rm  )rÓ  )r‘   rn  r…   r  )rÓ  rn  s   & r   Ú_disabled_skill_namesrÕ  m  s+   € ðÝ>Ù'°Ô:Ð:øÜô Ü‹uŠðús   ‚ ‘)¨)rÊ  c                 ó   € V # rI   rf  )Úidents   &r   rÄ  rÄ  x  s   € ¡r   Údisabled_namesÚdisabled_as_missingÚalready_loadedc                ó.  € V ^8„  d   QhR\         \        ,          R\        R,          R\        R,          R\        R\        R,          R\        \         \        ,          \         \        ,          \         \        ,          \         \        ,          3,          /# )r   Úidentifiersr–   NrØ  rÙ  rÚ  r   )r,   r   r  r«  r—   )r   s   "r   r   r   v  sn   € ÷ %3ñ %3Ü”c•ð%3Ü<?À$½Jð%3ä7:¸Tµzð%3ä_cð%3ô ˜$•Jð%3ô Œ4”�9”dœ3•i¤¤c¥¬D´­IÐ5Õ6ñ	%3r   c          	     óp  € . p. p	. p
. p\        4       pV  EF  pV'       d   WÜ9   d   K  VP                  V4       V! V4      pV'       g   V	P                  V! V4      4       KN  V^,          pV'       di   Wõ9   g,   WÕ9   g&   RV9   dV   VP                  R^4      ^,          V9   d8   V'       d   V	P                  V4       MT
P                  T;'       g    T4       KÇ  V'       d   W÷9   d   VP                  V4       Kè  VP                  \	        Wâ! V4      V4      4       VP                  V4       EK  	  W‰W«3# )uº  Load each distinct identifier via *load* and render its block; returns
``(loaded_names, missing, disabled, blocks)``. With *disabled_names*, members
whose canonical (LOADED â€” identifiers may be paths) name or identifier is
disabled go to ``disabled`` (or ``missing`` when *disabled_as_missing*).
Canonical names in *already_loaded* (e.g. skills.auto_load) count as resolved
but render no block, so one skill never lands in the prompt twice.rt  )r  r-  r1   r[   r  )rÜ  Úloadrï   r–   rÊ  rØ  rÙ  rÚ  r
  rº   r  ÚblocksÚseenr°   rr   r  s   &&&&$$$$        r   rÍ  rÍ  v  s  € ð !€LØ€GØ€HØ€FÜ“U€DÜ!ˆ
ß˜ZÔ/ÙØ�‰�ÔÙ�jÓ!ˆßØ�N‰N™=¨Ó4Ô5ÙØ˜A•Yˆ
ß˜zÔ;¸zÔ?[Ø#&¨*Ô#4¸×9IÑ9IÈ#ÈqÓ9QÐRSÕ9TÐXfÔ9fß"Ø—‘˜zÕ*à—‘ 
× 8Ð 8¨jÔ9Ùß˜jÔ:Ø×Ñ 
Ô+ÙØ�‰Ô)¨&°/À*Ó2MÈwÓWÔXØ×Ñ˜J×'ñ) "ð*  (Ð2Ð2r   c                óè   € V ^8„  d   QhR\         \        ,          R\        R,          R\        \        ,          R,          R\        \        \         \        ,          \         \        ,          3,          /# )r   Úskill_identifiersr–   NÚexcluded_loaded_namesr   )r,   r   r  r—   )r   s   "r   r   r   ž  sT   € ÷ <ñ <ÜœC•yð<Ü+.°­:ð<ÜUXÔY\ÕU]Ð`dÕUdð<ä
Œ3””S•	œ4¤�9Ð$Õ%ñ<r   c                ó  a€ ^ RI Hp V! 4       '       d   R. \        V 4      3# \        V  Uu. uF  qD;'       g    RP	                  4       NK  	  upV3R lR S\
        \        4       RVR7      w  rVrxRP                  V4      WV3# u upi )uƒ  Load skills for session-wide CLI/TUI preloading; returns (prompt_text,
loaded_skill_names, missing_identifiers). Disabled skills count as missing:
this path bypasses the scan-time filter, and ``hermes -s <skill>`` must not
force-load an operator-disabled skill. *excluded_loaded_names* are canonical
names the session already carries (skills.auto_load): they resolve as loaded
but are not rendered again.

Disabled skills are treated the same as missing ones: this loads via a raw identifier straight into
``_load_skill_payload``, bypassing ``get_skill_commands()``'s scan-time disabled filter â€” mirrors the
bundle-invocation gate (#59156).
rš   r   c                 ó   <€ \        V SR 7      # ©r  ©r®   ©r°   r–   s   &€r   rÄ  Ú/build_preloaded_skills_prompt.<locals>.<lambda>²  s   ø€ Ô.¨zÀ7ÕKr   c                 ó   € R V  R2# )z9[IMPORTANT: The user launched this CLI session with the "z~" skill preloaded. Treat its instructions as active guidance for the duration of this session unless the user overrides them.]rf  rÇ  s   &r   rÄ  ré  ³  s   € ÐQÐRVÐQWð XAñ Ar   T)rÊ  rØ  rÙ  rÚ  rÌ  )r¤   r›   r,   rÍ  r%   r¸   rÕ  r/   )	râ  r–   rã  r›   Úrawr
  rº   rÎ  Úprompt_partss	   &f&      r   Úbuild_preloaded_skills_promptrí  ž  sŒ   ø€ õ =á×ÒØ�2”tÐ-Ó.Ð.Ð.Ü5GÙ(9Ó:Ñ(9 �)ˆ)�×	Ñ	Ö	Ñ(9Ñ:ÜKñ	Bð 	Ô3ÔDYÓD[Ø Ð1Fô6Ñ2€L˜9ð �;‰;�|Ó$ lÐ;Ð;ùò 	;s
   ¬B¹Bc                óT   € V ^8„  d   QhR\         R,          R\        \        ,          /# )r   Úuser_configNr   )r˜   r,   r   )r   s   "r   r   r   ¼  s"   € ÷ &ñ &¬$°­+ð &ÄÄcÅñ &r   c                ó  € V f    ^ RI Hp V! 4       p \        V \        4      '       d   V P                  R4      MRp\        V\        4      '       d   VP                  R4      MRp\        V\        4      '       g   . # V Uu. uFC  p\        V\        4      '       g   K  VP                  4       '       g   K3  VP                  4       NKE  	  pp\        \        P                  V4      4      #   \         d    . u # i ; iu upi )z‘``skills.auto_load`` from *user_config* (else the active profile config), deduplicated;
empty when unset, malformed, or the config is unreadable.N)Úload_config_readonlyÚskillsÚ	auto_load)
Úhermes_cli.configrñ  r…   r8   r˜   r¨   r,   r   r%   Úfromkeys)rï  rñ  Úskills_blockró  rè   Únamess   &     r   Úresolve_auto_load_skillsrø  ¼  sÌ   € ð Òð	Ý>Ù.Ó0ˆKô 1;¸;Ì×0MÒ0M�;—?‘? 8Ô,ÐSW€LÜ1;¸LÌ$×1OÒ1O�× Ñ  Ô-ÐUY€IÜ�i¤×&Ò&Øˆ	Ù(1Ó^©	˜u´ZÀÄs×5KŒ]ÐPU×P[ÑP[×P]Œ]ˆU�[‰[Ž]©	€EÐ^Ü”—‘˜eÓ$Ó%Ð%øô ô 	ØŠIð	üò _s#   †C* ÂC=ÂC=Â6C=Ã*C:Ã9C:c                óÊ   € V ^8„  d   QhR\         R,          R\        R,          R\        R,          R\        \         \        \         ,          \        \         ,          3,          /# )r   r–   Nrï  Úhome_overrider   )r   r˜   r   r—   r,   )r   s   "r   r   r   Í  sN   € ÷ 3ñ 3Ü�4�Zð3Ü-1°D­[ð3ÜPTÐW[ÕP[ð3ä
Œ3””S•	œ4¤�9Ð$Õ%ñ3r   c           	     ó4  a € ^ RI HpHp Ve   V! \        V4      4      MRp \	        V4      pV'       g   R. . 3Ve
   V! V4       # # \        VV 3R lR S \        4       RR7      w  rxršRP                  V
4      Wx3Ve
   V! V4       # #   Te
   T! T4       i i ; i)	a<  Render ``skills.auto_load`` as fully loaded skill blocks for a new session; returns
``(prompt_text, loaded_names, missing)``. Missing and operator-disabled names are reported,
never raised: a typo in config must not block session start on any surface.

*home_override* makes home resolution EXPLICIT (same seam as ``build_skills_system_prompt``): the config,
the disabled list and the ``<home>/skills`` lookup all resolve under that home, so a gateway build thread
that lost the HERMES_HOME ContextVar cannot pin the launch profile's skills into another profile's prompt.
rG  Nr   c                 ó   <€ \        V SR 7      # ræ  rç  rè  s   &€r   rÄ  Ú(build_auto_load_prompt.<locals>.<lambda>à  s   ø€ Ô2°:ÀwÕOr   c                 ó   € R V  R2# )r   z¡" skill is auto-loaded via config (skills.auto_load). Treat its instructions as active guidance for the duration of this session unless the user overrides them.]rf  rÇ  s   &r   rÄ  rý  á  s   € Ð-¨d¨Vð 46ñ 6r   T)rØ  rÙ  rÌ  )rŒ   rH  rI  r   rø  rÍ  rÕ  r/   )r–   rï  rú  rH  rI  rS  Úauto_skillsr
  rº   rÎ  rì  s   f&&        r   Úbuild_auto_load_promptr   Í  s¶   ø€ ÷ VØANÒAZÑ)¬#¨mÓ*<Ô=Ð`d€Jð3Ü.¨{Ó;ˆßØ�r˜2�:ð Ò!Ù& zÕ2ð "ô :LØÜOñ7ð Ô$9Ó$;ÐQUô:
Ñ6ˆ˜yð �{‰{˜<Ó(¨,Ð?àÒ!Ù& zÕ2ð "øˆ:Ò!Ù& zÕ2ð "ús   ¢B Á3B Á=B ÂBc                ó(  € V ^8„  d   Qh/ ^ \         9   d=   \        \        \        \        \        \        \        3,          3,          3,          ;R&   ^\         9   d=   \        \        \        \        \        \        \        3,          3,          3,          ;R&   ^\         9   d   \        \        \        3,          ;R&   ^\         9   d,   \        \        \        \        \        3,          3,          ;R&   ^\         9   d   \
        \        ,          ;R&   # )r   r?  r�  r@  rh  ri  )Ú__conditional_annotations__r˜   r—   r   r   r   )r   s   "r   r   r      sÆ   € × XÑ X÷6 DÒ CœœU¤D¬¬d´3¼°8­nÐ)<Õ$=Ð=Õ>Ñ Cñ7 Y÷< UÒ T¬¬e´T¼#¼tÄCÌÀH½~Ð:MÕ5NÐ.NÕ)OÑ Tñ= Y÷D 4Ò 3œD¤¬ Õ.Ñ 3ñE Y÷| 7Ò 6œœS¤$¤s¬C x¥.Ð0Õ1Ñ 6ñ} Y÷~ 3Ò 2œH¤U�OÑ 2ò Yr   )u    â€” rI   )z[Skill config (z
])rõ   z]

)r   r   N>   ú.gitú.hubú.locksú.githubú.archive)r   Nr   )r   N)NN)NNN)lr  Ú__doc__r¦   Úloggingrƒ   rR   Ú	threadingÚpathlibr   Útypingr   r   r   r   rŒ   r   Úagent.prompt_cache_boundaryr   Úagent.skill_preprocessingr	   rö   r
   r‘   r   Ú	getLoggerÚ__name__r.  r?  r�  r@  ÚLockr>  Úcompiler    r$   r:   r@   r0   rA   r;   r=   r>   rT   rd   rQ   Ú_AUTO_LOAD_SUFFIX_RErV   ÚSKILL_SCAFFOLD_SQL_LIKEÚAUTO_LOAD_SCAFFOLD_SQL_LIKEre   r'   r3   rC   r`   rg   Úpatternrk   Ú	MULTILINErm   rt   r<   r‡   r�   r“   r®   rµ   r¸   r¾   rÎ   r÷   rù   rZ   rÕ   rÖ   rí   rü   r  r  r  r  r2  rB  rK  rU  r<  rd  rh  ri  rj  r  rx  r�  r’  r›  rŸ  r¨  r®  r­  r·  r»  r¿  rÑ  rÕ  rÍ  rí  rø  r   r   )r  s   @r   Ú<module>r     s  øðÞ Xã Û Û 	Û 	Û Ý ß /Ó /å 0Ý >ß iÝ 4à	×	Ò	˜8Ó	$€ð BDÐ Ó Cð SUÐ 'Ó Tð 24Ð Ó 3Ø—’Ó €ð —z’z )Ó,Ð Ø—j’j Ó*Ð ð CÐ ØAÐ ØnÐ Ø$€Ø!€Ø1Ð Ø9Ð ð —’˜BŸIšIÐ&>Ó?À,ÕNÓO€ð (Ð Ø—z’zÐ"jÓkÐ ð VÐ ð 3°SÕ8Ð ð 0°#Õ5Ð ð Ð õ8õõ õ"*÷:#ð< —z’z "§)¢)Ð,=Ó">ÀÕ"KÐNb×NjÑNjÕ"jÓkÐ Ø—J’JÐ7¸¿¹ÓFÐ õjõ$Wõ%õ "õ3÷Põ@oõDõcõð&6ð ð -Ð Ø2Ð4TØ;Ð=RÐSðUÐ ð;ð õõ
÷2õjpð ØMQðà $ðàCGðð  ðð :<÷ò4 EÐ õbõ"\õJ*ð\ Ð õõ6õ!ð@ 57Ð Ó 6Ø.2Ð Ó 2õ*õõ<#õL
õõõbõ
"ðJqÀ5÷ qõ1÷
tð  Ð ð#À5÷ #÷*I÷*ð%3á%ð%3àDHð%3àfkð%3ð "&÷%3÷P<÷<&÷"3ñ 3r   