+
    iHàjM¤  ã                  ó:  a € 0 t $ 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HtHtHt ^ RIHtHt ^ RIHtHtHt ^ RIHt ^ RIHtHtHtHtHtHtH t H!t! ^ RI"H#t#H$t$H%t%H&t&  ^ RI't'^ R	I)H*t* ^ R
I+H,t, ]PZ                  ! ].4      t/^<t0Rt1Rt2Rt3^t4]5! R04      t6]5! RR04      t7Rt80 RŒmt90 R�mt:];! 4       t<R]=R&   ]P|                  ! 4       t?]P|                  ! 4       t@]P|                  ! 4       tA];! 4       tBR]=R&   RsC];! 4       tDR]=R&   R R ltER R ltFR R ltGR R ltHR R  ltI ! R! R"4      tJ] ! R# R$]J4      4       tKR%RR&R/R' R( lltLR) R* ltMR%R/R+ R, lltNR- R. ltOR/ R0 ltPR1 R2 ltQR3 R4 ltRR5 R6 ltSR7 R8 ltTR9 R: ltUR; R< ltVR= R> ltWR? R@ ltXRA RB ltYRC RD ltZRE RF lt[RG RH lt\]]RI3]^RJ33t_RKRLRMRLRNRO/t`RPtaRQ RR ltbRS RT ltcRU RV ltdRW RX lteRY RZ ltfR[ R\ ltgR] R^ lthR_ R` ltiRŽtjRa Rb ltkRc Rd ltlRe Rf ltmR]kRg]l/tnRh]=Ri&   Rj Rk ltoRl Rm ltpRn Ro ltqRp Rq ltrRr Rs lts]Rt Ru l4       ttRv Rw ltuRx Ry ltvRz R{ ltwR| R} ltxR�tyR~]=R&   R€ R� ltzR‚ Rƒ lt{R„ R… lt|R† R‡ lt}Rˆ R‰ lt~RŠ R‹ ltR#   ]( d    Rt' EL!i ; i)�u   Shell-script hooks bridge: ``hooks:`` config â†’ first-use consent per ``(event, command)`` â†’
callbacks on the plugin hook manager, so every ``invoke_hook()`` site dispatches to the scripts.
Wire: stdin JSON ``{hook_event_name, tool_name, tool_input, session_id, cwd, extra}``; optional stdout
JSON ``{"decision"|"action": "block"|"modify", ...}`` / ``{"context": ...}`` via ``_parse_response``.
Exit code 2 blocks a ``pre_tool_call`` even without JSON (Claude-Code / Cursor). Fail open unless ``fail_closed``.)ÚannotationsN)Ú	ExitStackÚcontextmanagerÚsuppress)Ú	dataclassÚfield)ÚdatetimeÚtimezoneÚUTC)ÚPath)ÚAnyÚCallableÚDictÚIteratorÚListÚOptionalÚSetÚTuple)Ú
IS_WINDOWSÚkill_process_treeÚsplit_command_lineÚwindows_hide_flags)Úget_hermes_home)Úatomic_json_writei,  zshell-hooks-allowlist.jsonzBlocked by shell hook.Úpre_tool_callÚpost_tool_calli�  z(set[tuple[str, str, Optional[str], str]]Ú_registeredzset[tuple[str, str, str]]Ú_launch_consentFÚ_skip_loggedc               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚstr© )Úformats   "Ú6/home/ubuntu/.hermes/hermes-agent/agent/shell_hooks.pyÚ__annotate__r'   D   s   € ÷ 9ñ 9�3ñ 9ó    c                 ó`   € \        \        4       P                  4       P                  4       4      # ©N)r#   r   Ú
expanduserÚresolver$   r(   r&   Ú	_home_keyr-   D   s"   € ÜŒÓ ×+Ñ+Ó-×5Ñ5Ó7Ó8Ð8r(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   Úregistryz
set[tuple]Úlockzthreading.Lockr"   ÚNoner$   )r%   s   "r&   r'   r'   H   s&   € ÷ Nñ N¨ð N¸>ð NÈdñ Nr(   c           	     óÒ   € \        4       pT;_uu_ 4        T P                  V  Uu0 uF  q3^ ,          V8X  g   K  VkK  	  up4       RRR4       R# u upi   + '       g   i     R# ; i)zfDrop the current home's keys only (shared with outbound webhooks): profile A's reload must not drop B.N)r-   Údifference_update)r/   r0   Úhome_keyÚks   &&  r&   Ú_forget_home_registrationsr6   H   sJ   € ä‹{€Hß	ŠØ×"Ñ"©xÓ#L©x¨!¸Q½4À8Ñ;K§A A©xÑ#LÔM÷ 
‰ùÚ#L÷ 
�ˆús    •A¥A¹A¿AÁAÁA&	c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r!   Úer   ÚeventúOptional[str]Úcommandr#   r"   Úboolr$   )r%   s   "r&   r'   r'   O   s.   € ÷ nñ n�cð n -ð n¸#ð nÀ$ñ nr(   c                óª   € \        V \        4      ;'       d=    VR J ;'       g    V P                  R4      V8H  ;'       d    V P                  R4      V8H  # )Nr9   r;   )Ú
isinstanceÚdictÚget)r8   r9   r;   s   &&&r&   Ú_entry_matchesrA   O   sK   € Ü�aœÓ×mÐm E¨T M×$LÐ$L°Q·U±U¸7³^ÀuÑ5L×mÐmÐRS×RWÑRWÐXaÓRbÐfmÑRmÐmr(   c               ó   € V ^8„  d   QhRR/# r    r$   )r%   s   "r&   r'   r'   S   s   € ÷ Cñ C�cñ Cr(   c                 ót   € \         P                  ! \        R 7      P                  4       P	                  RR4      # )©Útzú+00:00ÚZ)r   Únowr
   Ú	isoformatÚreplacer$   r(   r&   Ú_utc_now_isorK   S   s'   € Ü�<Š<œ3Ô×)Ñ)Ó+×3Ñ3°H¸cÓBÐBr(   c               ó    € V ^8„  d   QhRRRR/# )r!   Úkwargsúdict[str, Any]r"   r$   )r%   s   "r&   r'   r'   W   s   € ÷ ñ ˜Nð ¨~ñ r(   c                óð  €  \        \        P                  ! 4       4      p^ RIHp RV P                  R4      R\        V P                  R4      \        4      '       d   V P                  R4      MRRV P                  R4      ;'       g    V P                  R4      ;'       g    RR	TR
V! 4       RV P                  4        UUu/ uF  w  r4V\        9  g   K  W4bK  	  upp/#   \         d    Rp LÎi ; iu uppi )zZCommon stdin/POST payload fields (shared with outbound webhooks); key order is wire order.Ú )Úget_active_profile_nameÚ	tool_nameÚ
tool_inputÚargsNÚ
session_idÚparent_session_idÚcwdÚprofileÚextra)r#   r   rW   ÚOSErrorÚhermes_cli.profilesrQ   r@   r>   r?   ÚitemsÚ_TOP_LEVEL_PAYLOAD_KEYS)rM   rW   rQ   r5   Úvs   &    r&   Ú_payload_fieldsr_   W   sÓ   € ðÜ”$—(’(“*‹oˆõ <à�V—Z‘Z Ó,Ø¬J°v·z±zÀ&Ó7IÌ4×,PÒ,P�f—j‘j Ô(ÐVZØ�f—j‘j Ó.×WÐW°&·*±*Ð=PÓ2Q×WÐWÐUWØˆsàÑ*Ó,Ø 6§<¡<¤>ÔV¡>™4˜1°QÔ>UÑ5U”$�!’$¡>ÒVðð øô ô ØŠðüó Ws   ‚C Ã C2ÃC2ÃC/Ã.C/c                  óL   € ] tR t^it$ RtRtR]R&   R]R&   R R ltR	 R
 ltRt	R# )Ú_ToolMatcherMixinzS``matcher`` regex handling shared by shell-hook specs and outbound webhook targets.z
shell hookr:   ÚmatcherúOptional[re.Pattern]Úcompiled_matcherc               ó   € V ^8„  d   QhRR/# ©r!   r"   r1   r$   )r%   s   "r&   r'   Ú_ToolMatcherMixin.__annotate__p   s   € ÷ -ñ -˜tñ -r(   c                	ó¸  € \        V P                  \        4      '       d*   V P                  P                  4       ;'       g    R V n        V P                  '       d)    \        P
                  ! V P                  4      V n        R # R #   \        P                   d?   p\        P                  RT P                  T P                  T4       R T n         R p?R # R p?ii ; i)Nu>   %s matcher %r is invalid (%s) â€” treating as literal equality)r>   rb   r#   ÚstripÚreÚcompilerd   ÚerrorÚloggerÚwarningÚ_MATCHER_KIND)ÚselfÚexcs   & r&   Ú__post_init__Ú_ToolMatcherMixin.__post_init__p   sž   € ä�d—l‘l¤C×(Ò(ØŸ<™<×-Ñ-Ó/×7Ð7°4ˆDŒLØ�<�<ˆ<ð-Ü(*¯
ª
°4·<±<Ó(@�Ö%ñ øô —8‘8ô -Ü—‘ØTÐVZ×VhÑVhÐjn×jvÑjvÐx{ôð )-�×%Ò%ûð	-ús   Á%B ÂCÂ3CÃCc               ó    € V ^8„  d   QhRRRR/# )r!   rR   r:   r"   r<   r$   )r%   s   "r&   r'   rg   }   s   € ÷ Fñ F mð F¸ñ Fr(   c                	ó¨   € V P                   '       g   R # Vf   R# V P                  f   WP                   8H  # V P                  P                  V4      RJ# )TNF)rb   rd   Ú	fullmatch)rp   rR   s   &&r&   Úmatches_toolÚ_ToolMatcherMixin.matches_tool}   sL   € Ø�|�|ˆ|ÙØÒÙØ× Ñ Ò(Ø§¡Ñ,Ð,Ø×$Ñ$×.Ñ.¨yÓ9ÀÐEÐEr(   )rd   rb   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ro   Ú__annotations__rr   rw   Ú__static_attributes__r$   r(   r&   ra   ra   i   s'   ‡ Ù]à €MØÓØ*Ó*õ-÷Fñ Fr(   ra   c                  óx   € ] tR t^‡t$ RtR]R&   R]R&   RtR]R&   ]tR]R	&   R
t	R]R&   ]
! RR
R7      tR]R&   RtR# )ÚShellHookSpeczAParsed and validated representation of a single ``hooks:`` entry.r#   r9   r;   Nr:   rb   ÚintÚtimeoutFr<   Úfail_closed)ÚdefaultÚreprrc   rd   r$   )ry   rz   r{   r|   r}   r~   rb   ÚDEFAULT_TIMEOUT_SECONDSrƒ   r„   r   rd   r   r$   r(   r&   r�   r�   ‡   s@   ‡ áKàƒJØƒLØ!€Gˆ]Ó!Ø*€GˆSÓ*Ø€K�ÓÙ-2¸4ÀeÔ-LÐÐ*×Lr(   r�   Úaccept_hooksÚinteractivec               ó(   € V ^8„  d   QhRRRRRRRR/# )r!   ÚcfgúOptional[dict[str, Any]]rˆ   r<   r‰   r"   úlist[ShellHookSpec]r$   )r%   s   "r&   r'   r'   •   s+   € ÷ 3ñ 3Ð6ð 3Èð 3Ø&*ð3Ø7Jñ3r(   c          	     ól  € \        V 4      w  r4V'       g   . # ^ RIHp V! 4       \        4       rv\        ;_uu_ 4        V Uu. uF  p\        Wx4      \        9  g   K  VNK  	  ppRRR4       \        W4      \        4       r©. pV F]  p\        W‰W¢R7      '       d   VP                  V4       K)  \        P                  RVP                  VP                  \        4       4       K_  	  \        ;_uu_ 4        \!        WgV4      uuRRR4       # u upi   + '       g   i     L³; i  + '       g   i     R# ; i)ab  Register every configured shell hook (idempotent); returns the newly wired specs. Skipped
entries (unknown, malformed, not allowlisted, already registered) are logged only.

``interactive=True`` lets a hook that is not yet allowlisted ask at the terminal; only a
foreground CLI command passes it. Every other caller (gateway startup and profile loads, cron
and managed workers, tui_gateway, force-reload re-registration) never prompts: ``isatty()``
cannot tell a hidden console or ``NUL`` from a person, and a prompt there blocks the event loop
until the liveness watchdog kills the gateway (#120356, #127822).©Úget_plugin_managerN©Úpromptu¯   shell hook for %s (%s) not allowlisted in %s â€” skipped. Use --accept-hooks / HERMES_ACCEPT_HOOKS=1 / hooks_auto_accept: true, or approve it at a CLI prompt for this profile.)Ú_hook_specsÚhermes_cli.pluginsr�   r-   Ú_registered_lockÚ_keyr   Ú_resolve_effective_acceptÚallowlisted_pairsÚ
_consentedÚappendrm   rn   r9   r;   Úallowlist_pathÚ_wire)r‹   rˆ   r‰   ÚspecsÚ	_completer�   Úmanagerr4   ÚspecÚacceptÚallowedÚ	consenteds   &$$         r&   Úregister_from_configr¤   •   sè   € ô # 3Ó'Ñ€EßØˆ	Ý5Ù*Ó,¬i«kˆXß	Ö	Ù"'ÓS¡%˜$¬4°Ó+?Ä{Ñ+R—�¡%ˆÐS÷ 
ä/°ÓBÔDUÓDWˆGà€IÛˆÜ�d G×@Ó@Ø×Ñ˜TÖ"ä�N‰Nð /à04·
±
¸D¿L¹LÌ.ÓJZö\ñ	 ÷ 
Ö	Ü�W¨	Ó2÷ 
Ò	ùò T÷ 
×	ú÷ 
×	Ð	ús/   ¼DÁD
ÁD
Á"DÃ3D"Ä
DÄD	Ä"D3	c               ó    € V ^8„  d   QhRRRR/# )r!   Úload_cfgzCallable[[], dict[str, Any]]r"   r1   r$   )r%   s   "r&   r'   r'   ´   s   € ÷ 6lñ 6lÐ;ð 6lÀñ 6lr(   c                ó¤  € ^ RI Hp \        ;_uu_ 4        V ! 4       p\        V4      w  r4Ve	   V'       g    RRR4       R# \	        4       w  rV\        VR,          4      p\        4       p\        P                  V U	u0 uF  q˜.V	O5kK
  	  up	4       T\         U
UUu0 uF  w  r«qÊV8X  g   K  W¼3kK  	  uppp
,          p\        VR4      p. pV F½  pV'       g   VP                  VP                  3V9   d   VP                  V4       K;  W�P                  VP                  3\        9  g   K^  \        P                  W�P                  VP                  34       \        P!                  RVP                  VP                  \#        4       4       K¿  	  V! 4       p\$        ;_uu_ 4        \'        VWŽ4       V'       d	   V'       gY   VRR3pV\        9  d6   \        P                  V4       \        P!                  RV'       g   R	MR
4        RRR4       RRR4       R# V Uu0 uF  qøVP                  VP                  3kK  	  pp\        P                  \         Uu0 uF  pV^ ,          V8X  g   K  VV9  g   K  VkK   	  up4       V Uu0 uF  p\)        W�4      kK  	  pp\*         Uu0 uF  pV^ ,          V8X  g   K  VV9  g   K  VkK   	  pp\*        P                  V4       V Uu0 uF  pV^,          kK  	  up FP  pVP,                  P/                  V. 4       Uu. uF  p\1        VRR4      V9  g   K  VNK  	  upVP,                  V&   KR  	  RRR4       RRR4       X F  w  pppp\        P3                  RW¼4       K   	  R# u up	i u uppp
i u upi u upi u upi u upi u upi u upi   + '       g   i     Lh; i  + '       g   i     Ls; i)a;  Bring this home's registered shell hooks in step with its config (``load_cfg()``) and
consent, for a long-lived process (the gateway) that must behave as a new process would: hooks
configured and consented since start register, hooks removed from config or revoked are
unregistered. Consent is the allowlist, an opt-in in force (``hooks_auto_accept`` /
``HERMES_ACCEPT_HOOKS`` / this process's own ``--accept-hooks``), or a launch's ``--accept-hooks``
whose allowlist write failed (``accept_for_launch``). Never prompts or writes. An empty config
(a loader that failed open), a malformed ``hooks:`` entry or an unreadable allowlist must never
disarm a ``fail_closed`` guard, so each adds but never removes. Config and allowlist are read
under the same lock as the apply, so the last sync to run always applies the newest state.r�   NÚ	approvalsFu¯   shell hook for %s (%s) not allowlisted in %s â€” skipped. Approve it at a CLI prompt for this profile, or use --accept-hooks / HERMES_ACCEPT_HOOKS=1 / hooks_auto_accept: true.rP   ÚremovalzNshell hooks: %s, so removed or revoked hooks stay registered until it is fixedzthe allowlist is unreadablez*a hooks: entry in config.yaml is malformedÚshell_hook_keyzDshell hook unregistered (removed from config or allowlist): %s -> %s)r”   r�   Ú
_sync_lockr“   Ú_read_allowlistÚ_approved_pairsr-   r   r3   r—   r9   r;   rš   r   Úaddrm   rn   r›   r•   rœ   r–   r   Ú_hooksr@   ÚgetattrÚinfo)r¦   r�   r‹   r�   ÚcompleteÚ	allowlistÚreadabler¢   r4   ÚpairÚhomer9   r;   r¡   Úwantedr    rŸ   Ú	suspendedÚ
configuredÚcÚkeepr5   ÚstaleÚcbÚ_homeÚ_matchers   &                         r&   Úsync_from_configrÀ   ´   s  € õ 6ß	ŽÙ‹jˆÜ% cÓ*‰ˆØŠ=§Ø÷	 
‰ô
 .Ó/Ñˆ	Ü! )¨KÕ"8Ó9ˆÜ“;ˆä×)Ñ)ÉÓ*QÉÀÐ+<°tÔ+<ÉÑ*QÔRØÅÕeÁÑ)=¨°gÐ\dÑTdÔ$�UÓ$ÁÓeÕeˆÜ*¨3°Ó6ˆØˆÛˆDß˜$Ÿ*™* d§l¡lÐ3°wÔ>Ø—‘˜dÖ#ØŸJ™J¨¯©Ð5¼\ÖIÜ× Ñ  (¯J©J¸¿¹Ð!EÔFÜ—‘ð  :à;?¿:¹:ÀtÇ|Á|ÔUcÓUeögñ ñ %Ó&ˆßÖÜ�'˜8Ô,ß§Ø% r¨9Ð5�	Ø¤LÔ0Ü ×$Ñ$ YÔ/Ü—N‘Nð $+ßQYÑ,IØ(TôVð ÷ ÷- 
‰ñB LQÓQÉ5À4 T§Z¡Z°·±Ó>É5ˆJÐQÜ×-Ñ-½/Ó.v¹/°QÈQÈqÍTÐU]ÑM]¬qÐbcÐkuÑbu¯q¨q¹/Ñ.vÔwÙ5;Ó<±V¨T”D˜Ö(±VˆDÐ<Ý +ÓR¡˜1¨q°­t°xÑ/?”QÀAÈTÁM—Q�Q¡ˆEÐRÜ×)Ñ)¨%Ô0Ù(-Ó.© 1˜!˜AŸ$˜$©Ô.�à6=·n±n×6HÑ6HÈÐPRÔ6Só )^Ñ6S°Ü,3°BÐ8HÈ$Ó,OÐW\Ñ,\÷ *,¨Ñ6Sñ )^�—‘˜uÓ%ñ /÷! ÷- 
óT ,1Ñ'ˆˆu�h Ü�‰ÐZÐ\aÖkó ,1ùòC +RùÜeùò. RùÚ.vùÚ<ùÚRùâ.ùò)^÷% ×ú÷- 
�úsÞ   • N?¶N?Á;N?Á<NÂ
N?ÂNÂ,NÂ3A4N?Ä,A8N?Æ$N,	Ç<N,	Ç>	N,	ÈN?ÈN,	È!NÈ>N,	ÉNÉ,NÉ5NÉ;N,	ÊNÊ
N,	Ê$NÊ9NËNËN,	Ë#N"Ë5$N,	ÌN'Ì2N'Ì8N,	ÍN?ÎN?ÎN,	Î,N<Î7N?Î?O	c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r‹   rŒ   rˆ   r<   r"   r�   r$   )r%   s   "r&   r'   r'   í   s(   € ÷ Vñ VÐ$<ð VÈtð VÐ`sñ Vr(   c          
     ó²   € \        V 4      w  r#V'       g   . # \        W4      \        4       rTV Uu. uF  p\        WdVRR7      '       g   K  VNK  	  up# u upi )a   First-use consent without registering anything, for a client whose turns run in a gateway that
has no TTY: the prompt (or an opt-in) for each configured hook not yet allowlisted. The gateway
registers from the same allowlist when the client opens its session. Returns the consented specs.Tr‘   )r“   r—   r˜   r™   )r‹   rˆ   r�   rž   r¡   r¢   r    s   &$     r&   Úrecord_consent_from_configrÃ   í   sQ   € ô # 3Ó'Ñ€EßØˆ	Ü/°ÓBÔDUÓDWˆGÙ"ÓU™U�T¤j°¸wÈt×&TÐ&T�DˆD™UÑUÐUùÒUs   °AÁAc               ó    € V ^8„  d   QhRRRR/# )r!   r‹   rŒ   r"   r1   r$   )r%   s   "r&   r'   r'   ø   s   € ÷ Kñ KÐ3ð K¸ñ Kr(   c                óø   aa€ \        V RR7      pV'       g   R# \        4       \        4       uoo\        ;_uu_ 4        \        P                  VV3R lV 4       4       RRR4       R#   + '       g   i     R# ; i)aT  A launch's ``--accept-hooks`` on the gateway: record every configured hook in the allowlist,
and keep the consent in memory when that write fails, so it still registers
the hook at the next ``sync_from_config`` (main registered it in memory). Only an unsaved approval
is held, so a later ``hermes hooks revoke`` of a saved one takes effect.T©rˆ   Nc              3  ó”   <"  € T F=  pVP                   VP                  3S9  g   K"  SVP                   VP                  3x € K?  	  R # 5ir*   ©r9   r;   )Ú.0r    r4   Úsaveds   & €€r&   Ú	<genexpr>Ú$accept_for_launch.<locals>.<genexpr>  s@   øé € ð KÑPUÈØ#'§:¡:¨t¯|©|Ð"<ÀEÑ"Iô  D ¨$¯*©*°d·l±lÕCÓPUùs
   ƒA§!A)rÃ   r˜   r-   r«   r   Úupdate)r‹   r�   r4   rÊ   s   & @@r&   Úaccept_for_launchrÎ   ø   sV   ù€ ô
 ' s¸Ô>€EßÙÜ'Ó)¬9«;€O€Eˆ8ß	ŽÜ×Ñõ KÑPUó Kô 	K÷ 
��Šús   ½!A(Á(A9	c               ó   € V ^8„  d   QhRR/# rf   r$   )r%   s   "r&   r'   r'     s   € ÷ ñ ˜Dñ r(   c                 ó
   € Rs R# )zÒThis process's own ``--accept-hooks`` (``hermes gateway run --accept-hooks``): an opt-in in
force for its lifetime, as ``HERMES_ACCEPT_HOOKS`` would be, without exporting that variable to
every tool subprocess.TN)Ú_process_acceptr$   r(   r&   Úaccept_for_processrÒ     s	   € ð
 ‚Or(   c               ó    € V ^8„  d   QhRRRR/# )r!   r‹   rŒ   r"   z*tuple[Optional[list[ShellHookSpec]], bool]r$   )r%   s   "r&   r'   r'     s   € ÷ *ñ *Ð-ð *Ð2\ñ *r(   c                óâ   € ^ RI Hp ^ RIHp V! 4       '       g   \	        V \
        4      '       g   R# V! R4      '       d   \        P                  R4       R# \        V P                  R4      4      # )u  ``(specs, complete)``: the configured hooks, or ``None`` when this process must run none
(safe worker, safe mode, no config) â€” the one guard every registrar and the consent path share;
``complete`` is False when a configured entry was dropped as malformed.©Úsafe_worker_enabled©Úenv_var_enabledÚHERMES_SAFE_MODEu6   HERMES_SAFE_MODE=1 â€” shell-hook registration skippedÚhooks)NT)
Úagent.safe_worker_policyrÖ   ÚutilsrØ   r>   r?   rm   r±   Ú_parse_hooksr@   )r‹   rÖ   rØ   s   &  r&   r“   r“     sX   € õ =Ý%Ù×Ò¤J¨s´D×$9Ò$9ØÐÙÐ)×*Ò*Ü�‰ÐLÔMØÐÜ˜Ÿ™ Ó(Ó)Ð)r(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r4   r#   r    r�   r"   z#tuple[str, str, Optional[str], str]r$   )r%   s   "r&   r'   r'     s"   € ÷ >ñ >�3ð >˜mð >Ð0Sñ >r(   c                óH   € WP                   VP                  VP                  3# r*   )r9   rb   r;   )r4   r    s   &&r&   r–   r–     s   € Ø—j‘j $§,¡,°·±Ð=Ð=r(   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r!   rŸ   r   r4   r#   r�   r�   r"   r$   )r%   s   "r&   r'   r'      s*   € ÷ ñ �3ð  #ð Ð.Að ÐFYñ r(   c           	     ó¼  € . pV FÓ  p\        W4      pV\        9   d   K  \        V4      pWVn        V P                  P                  VP                  . 4      P                  V4       \        P                  V4       VP                  V4       \        P                  RVP                  VP                  VP                  VP                  VP                  4       KÕ  	  V# )zRRegister ``specs`` not yet wired for this home; caller holds ``_registered_lock``.zIshell hook registered: %s -> %s (matcher=%s, timeout=%ds, fail_closed=%s))r–   r   Ú_make_callbackrª   r¯   Ú
setdefaultr9   rš   r®   rm   r±   r;   rb   rƒ   r„   )rŸ   r4   r�   Ú
registeredr    ÚkeyÚcallbacks   &&&    r&   rœ   rœ      s¬   € à€JÛˆÜ�8Ó"ˆØ”+ÔÙÜ! $Ó'ˆØ"%ÔØ�‰×!Ñ! $§*¡*¨bÓ1×8Ñ8¸ÔBÜ�‰˜ÔØ×Ñ˜$ÔÜ�‰Ð_Ø—J‘J §¡¨d¯l©l¸D¿L¹LÈ$×JZÑJZö	\ñ ð Ðr(   c               ó    € V ^8„  d   QhRRRR/# )r!   r¨   z	list[Any]r"   úset[tuple[str, str]]r$   )r%   s   "r&   r'   r'   1  s   € ÷ nñ n˜yð nÐ-Añ nr(   c                ó  € V  Uu0 uF{  p\        V\        4      '       g   K  \        VP                  R 4      \        4      '       g   KB  \        VP                  R4      \        4      '       g   Ki  VR ,          VR,          3kK}  	  up# u upi rÈ   )r>   r?   r@   r#   )r¨   r8   s   & r&   r­   r­   1  sv   € Ù09ó n±	¨1Ü˜!œT×"ô 'Ü'1°!·%±%¸³.Ä#×'Fô 'ÜKUÐVW×V[ÑV[Ð\eÓVfÔhk×Klô 'ˆQˆw�Z˜˜9�Ó&±	ñ nð nùò ns   …B	¢"B	Á	"B	Á0B	c               ó   € V ^8„  d   QhRR/# )r!   r"   rè   r$   )r%   s   "r&   r'   r'   6  s   € ÷ :ñ :Ð/ñ :r(   c                 ó6   € \        \        4       R ,          4      # )r¨   )r­   Úload_allowlistr$   r(   r&   r˜   r˜   6  s   € Üœ>Ó+¨KÕ8Ó9Ð9r(   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r!   r    r�   r¡   r<   r¢   rè   r’   r"   r$   )r%   s   "r&   r'   r'   :  s2   € ÷ ñ �]ð ¨Dð Ð;Oð Ð\`ð Ðeiñ r(   c               óà   € V P                   V P                  3pWB9   d   R# V'       g   V'       g   R# \        V P                   V P                  VR7      '       g   R# VP                  V4       R# )znAllowlisted, or approved now (opt-in, or a TTY prompt when ``prompt``; recorded); ``allowed``
caches one read.TFrÆ   )r9   r;   Ú_prompt_and_recordr®   )r    r¡   r¢   r’   rµ   s   &&&$ r&   r™   r™   :  sO   € ð �J‰J˜Ÿ™Ð%€DØ„Ùß—fÙÜ˜dŸj™j¨$¯,©,ÀV×LÓLÙØ‡K�K�ÔÙr(   c               ó    € V ^8„  d   QhRRRR/# )r!   r‹   rŒ   r"   r�   r$   )r%   s   "r&   r'   r'   H  s    € ÷ Qñ QÐ7ð QÐ<Oñ Qr(   c                óf   € \        V \        4      '       d   \        V P                  R4      4      # . # )zHParse config hooks without registering (``hermes hooks list`` / doctor).rÚ   )r>   r?   Ú_parse_hooks_blockr@   )r‹   s   &r&   Úiter_configured_hooksró   H  s(   € ä3=¸cÄ4×3HÒ3HÔ˜cŸg™g gÓ.Ó/ÐPÈbÐPr(   c               ó   € V ^8„  d   QhRR/# rf   r$   )r%   s   "r&   r'   r'   M  s   € ÷ (ñ ( $ñ (r(   c                 óZ   € \        \        \        4       ^ RIHp  \        V ! 4       4       R# )u³  Re-register after a plugin force-reload cleared the manager's hooks; only this home's keys
are cleared (profile A's reload never drops B), never re-prompts.

``PluginManager.discover_and_load(force=True)`` unloads via the ownership ledger and clears the
manager's ``_hooks`` dict, which silently drops shell hooks that were registered from ``config.yaml`` at
startup (they are config-owned, not plugin-owned, so the ledger cannot restore them). Clear the
idempotence set and re-run ``register_from_config()`` so hooks are wired again (#60036 / PR #60267;
tracking #64178 â€” salvaged from PR #64188).
Only the idempotence keys for the *current* Hermes home are cleared â€” ``discover_and_load(force=True)``
only unloads the manager scoped to that one home, so clearing every home's keys would make a
force-reload in profile A drop profile B's still-live registration from the ledger and duplicate it on
B's next registration call (#92682 review).
©Úload_configN)r6   r   r•   Úhermes_cli.configr÷   r¤   rö   s    r&   Úre_register_config_hooksrù   M  s   € ô œ{Ô,<Ô=Ý-Ü™›Ö'r(   c               ó   € V ^8„  d   QhRR/# rf   r$   )r%   s   "r&   r'   r'   `  s   € ÷ ñ ˜ñ r(   c                 óÖ   € \         ;_uu_ 4        \        P                  4        RRR4       \        P                  4        \        P                  4        RsR#   + '       g   i     L<; i)z%Test-only: clear the idempotence set.NF)r•   r   Úclearr   r   rÑ   r$   r(   r&   Úreset_for_testsrý   `  sA   € ÷ 
Ö	Ü×ÑÔ÷ 
ä×ÑÔÜ×ÑÔØ‚O÷	 
×	ús   �AÁA(	c               ó    € V ^8„  d   QhRRRR/# )r!   Ú	hooks_cfgr   r"   r�   r$   )r%   s   "r&   r'   r'   l  s   € ÷ &ñ & #ð &Ð*=ñ &r(   c                ó&   € \        V 4      ^ ,          # )zNNormalise ``hooks:`` into specs; malformed entries warn-and-skip, never raise.)rÝ   )rÿ   s   &r&   rò   rò   l  s   € ä˜	Ó" 1Õ%Ð%r(   c               ó    € V ^8„  d   QhRRRR/# )r!   rÿ   r   r"   z tuple[list[ShellHookSpec], bool]r$   )r%   s   "r&   r'   r'   q  s   € ÷ "ñ "˜Cð "Ð$Dñ "r(   c           
     ó*  € ^ RI HpHp V f   . R3# \        V \        4      '       g   . R3# . pRpV P                  4        EFH  w  rVVR9   d   K  WQ9   d   \        P                  RV4       K-  WR9  d}   \        P                  ! \        V4      V^RR7      pV'       d   \        P                  RWW^ ,          4       M/\        P                  R	VR
P                  \        V4      4      4       RpK¯  Vf   Kµ  \        V\        4      '       g/   \        P                  RV\        V4      P                  4       RpKù  \!        V4       UU	u. uF  w  r‰\#        WXV	4      NK  	  p
pp	T;'       d    RV
9  pVP%                  R V
 4       4       EKK  	  W43# u up	pi )z®``(specs, complete)``: ``complete`` is False when an entry was dropped as malformed (a typo
must not read as a deliberate removal); an absent or empty ``hooks:`` is complete.)ÚSHELL_UNSUPPORTED_HOOKSÚVALID_HOOKSNTFzŠhook event %r is Python-plugin-only: shell hooks cannot return its directive, so this registration is refused rather than silently ignoredg333333ã?)ÚnÚcutoffu;   unknown hook event %r in hooks: config â€” did you mean %r?z2unknown hook event %r in hooks: config (valid: %s)ú, z3hooks.%s must be a list of hook definitions; got %sc              3  ó0   "  € T F  qf   K  Vx € K  	  R # 5ir*   r$   )rÉ   r    s   & r&   rË   Ú_parse_hooks.<locals>.<genexpr>’  s   é € ÐA¡f˜d—T’T£fùs   ‚Œ
)Úoutput_spillÚoutbound)r”   r  r  r>   r?   r\   rm   rn   ÚdifflibÚget_close_matchesr#   ÚjoinÚsortedÚlistÚtypery   Ú	enumerateÚ_parse_single_entryÚextend)rÿ   r  r  r�   r²   Ú
event_nameÚentriesÚ
suggestionÚiÚrawÚparseds   &          r&   rÝ   rÝ   q  sx  € ÷ HØÒØ�4ˆxˆÜ�i¤×&Ò&Ø�5ˆyÐØ!#€EØ€HØ(Ÿ™×0Ñˆ
ØÐ5Ô5ÙØÔ0Ü�N‰Nð ZØ[eôgáØÔ(Ü ×2Ò2´3°z³?ÀKÐSTÐ]`ÔaˆJßÜ—‘Ð\Ð^hÐuvÕjwÕxä—‘ÐSÐU_Ðae×ajÑajÔkqÐr}Ók~Óaô  AØˆHÙØŠ?ÙÜ˜'¤4×(Ò(Ü�N‰NÐPÐR\Ô^bÐcjÓ^k×^tÑ^tÔuØˆHÙÜHQÐRYÔHZÔ[ÑHZ¹f¸aÔ% j°SÖ9ÑHZˆÑ[Ø×2Ð2 ¨FÑ 2ˆØ�‰ÑA¡fÓA×Añ/  1ð0 ˆ?Ðùó \s   ÅFc               ó(   € V ^8„  d   QhRRRRRRRR/# )	r!   r9   r#   Úindexr‚   r  r   r"   zOptional[ShellHookSpec]r$   )r%   s   "r&   r'   r'   –  s/   € ÷ 'zñ 'z˜sð 'z¨3ð 'z°Sð 'zÐ=Tñ 'zr(   c                ó  a a€ R  V V3R llp\        V\        4      '       g   V! R\        V4      P                  4       R# VP	                  R4      p\        V\
        4      '       d   VP                  4       '       g   V! R4       R# VP	                  R4      pVe!   \        V\
        4      '       g   V! R4       RpVe   S \        9  d   V! RVS 4       Rp \        VP	                  R	\        4      4      pV^8  d   V! R\        4       \        pMV\        8”  d   V! RV\        4       \        pVP	                  RVP	                  RR4      4      p\        V\        4      '       g   V! RV4       RpV'       d4   S \        9  d)   V! RRP                  \!        \        4      4      S 4       Rp\#        S VP                  4       WVVR7      #   \        \        3 d(    T! R
TP	                  R	4      \        4       \        p ELi ; i)c               ó$   € V ^8„  d   QhRRRRRR/# )r!   Úmsgr#   rT   r   r"   r1   r$   )r%   s   "r&   r'   Ú)_parse_single_entry.<locals>.__annotate__—  s&   € ÷ Bñ B�#ð B˜cð B dñ Br(   c                óJ   <€ \         P                  ! R V ,           SS.VO5!   R# )zhooks.%s[%d]N)rm   rn   )r  rT   r9   r  s   &*€€r&   ÚwarnÚ!_parse_single_entry.<locals>.warn—  s   ø€ Ü�Š�~¨Õ+¨U°EÐA¸DÖAr(   z/ must be a mapping with a 'command' key; got %sNr;   z' is missing a non-empty 'command' fieldrb   z).matcher must be a string regex; ignoringu—   .matcher=%r will be ignored at runtime â€” the matcher field is only honored for pre_tool_call / post_tool_call.  The hook will fire on every %s event.rƒ   z3.timeout must be an int (got %r); using default %dsz'.timeout must be >=1; using default %dsz&.timeout=%ds exceeds max %ds; clampingr„   Ú
failClosedFzH.fail_closed must be a boolean (got %r); using default false (fail open)už   .fail_closed=true will be ignored at runtime â€” fail_closed only applies to blocking-capable events (%s).  The hook will fail open on %s like any other hook.r  )r9   r;   rb   rƒ   r„   )r>   r?   r  ry   r@   r#   ri   Ú_TOOL_EVENTSr‚   r‡   Ú	TypeErrorÚ
ValueErrorÚMAX_TIMEOUT_SECONDSr<   Ú_BLOCKING_EVENTSr  r  r�   )r9   r  r  r"  r;   rb   rƒ   r„   s   ff&     r&   r  r  –  sÇ  ù€ ÷Bñ Bô �cœ4× Ò ÙÐ>ÄÀSÃ	×@RÑ@RÔSÙØ�g‰g�iÓ €GÜ�gœs×#Ò#¨7¯=©=¯?ª?ÙÐ6Ô7ÙØ�g‰g�iÓ €GØÒ¤:¨g´s×#;Ò#;ÙÐ8Ô9ØˆØÒ˜u¬LÔ8Ùð VØW^Ð`eô	gàˆð*Ü�c—g‘g˜iÔ)@ÓAÓBˆð �„{ÙÐ6Ô8OÔPÜ)‰Ø	Ô&Ô	&ÙÐ5°wÔ@SÔTÜ%ˆà—'‘'˜-¨¯©°¸uÓ)EÓF€KÜ�k¤4×(Ò(ÙÐWÐYdÔeØˆß�uÔ$4Ô4Ùð PØQU×QZÑQZÔ[aÔbrÓ[sÓQtÐv{ô	}àˆÜ˜u¨g¯m©m«oÀwÐmxÔyÐyøô% ”zÐ"ô *ÙÐBÀCÇGÁGÈIÓDVÔXoÔpÜ)‹ð*ús   ÃG Ç4HÈHzcommand not foundzcommand not executableú.shÚbashú.bashú.pyÚpythonzrcannot be run directly on Windows (there is no shebang support): start it with its interpreter, e.g. 'bash <path>'c               ó    € V ^8„  d   QhRRRR/# )r!   Úargvz	list[str]r"   r$   )r%   s   "r&   r'   r'   Ð  s   € ÷ !ñ !˜yð !¨Yñ !r(   c                óZ  € \         P                  P                  V ^ ,          4      ^,          P                  4       p\        P                  V4      pVe-   \         P                  P                  V ^ ,          4      '       g   V # VR8X  d   \        P                  .V O# ^ RI	H
p V! 4       .V O# )z¶``argv`` with the interpreter prepended when element 0 is an existing script we can name an
interpreter for; unchanged otherwise, including on POSIX, where the shebang already works.r.  )Ú
_find_bash)ÚosÚpathÚsplitextÚlowerÚ_WINDOWS_SCRIPT_INTERPRETERSr@   ÚisfileÚsysÚ
executableÚtools.environments.localr2  )r0  ÚsuffixÚkindr2  s   &   r&   Ú_windows_script_argvr>  Ð  s‰   € ô �W‰W×Ñ˜d 1�gÓ& qÕ)×/Ñ/Ó1€FÜ'×+Ñ+¨FÓ3€DØ‚|œ2Ÿ7™7Ÿ>™>¨$¨q­'×2Ò2ØˆØˆxÔÜ—‘Ð& Ð&Ð&õ 4Ù‹LÐ ˜4Ð Ð r(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r    r�   Ú
stdin_jsonr#   r"   rN   r$   )r%   s   "r&   r'   r'   ß  s!   € ÷ 4ñ 4�ð 4¨Cð 4°Nñ 4r(   c                ó\  a€ RRRRRRRRRR	R
R/oR V3R llp \        \        P                  P                  V P                  4      4      pT'       g	   T! R4      # \        P                  ! 4       p\        '       d   R\        4       /MR^ /p^ RI
Hp ^ RIHp  \        '       d   \        T4      p\        P                   ! T3R\        P"                  R\        P"                  R\        P"                  RRRRRRRRRT! T! 4       R7      /TB p	 T	P1                  YP2                  R 7      w  rÍSP=                  T	P@                  T;'       g    RT;'       g    R\?        \        P                  ! 4       T,
          ^4      R#7       S#   \
         d$   pT! RT P                  : RT 24      u Rp?# Rp?ii ; i  \$         d{   p\&         F%  w  r«\)        YJ4      '       g   K  T! T4      u u Rp?# 	  \+        TRR4      ^Á8X  d   T! T^ ,          : R\,         24      u Rp?# T! \/        T4      4      u Rp?# Rp?ii ; i  \4         dâ   p\7        T	4       \9        \$        4      ;_uu_ 4        T	P1                  ^R!7       RRR4       M  + '       g   i     M; i\)        T\$        4      '       g   h \)        T\        P:                  4      '       g   T! \/        T4      4      u Rp?# SP=                  R\?        \        P                  ! 4       T,
          ^4      R"7       Su Rp?# Rp?ii ; i)$zrThe single subprocess site: run ``spec.command`` with ``stdin_json`` on stdin. Same result keys for every outcome.Ú
returncodeNÚstdoutrP   ÚstderrÚ	timed_outFÚelapsed_secondsg        rl   c               ó    € V ^8„  d   QhRRRR/# )r!   rl   r#   r"   rN   r$   )r%   s   "r&   r'   Ú_spawn.<locals>.__annotate__ã  s   € ÷ ñ �cð ˜nñ r(   c                ó   <€ V SR &   S# )rl   r$   )rl   Úresults   &€r&   ÚfailedÚ_spawn.<locals>.failedã  s   ø€ Øˆˆw‰Øˆr(   zcommand z cannot be parsed: zempty commandÚcreationflagsÚprocess_group)Úis_multiplex_active)Úbuild_subprocess_envÚstdinÚtextTÚencodingúutf-8ÚerrorsrJ   ÚshellÚenv)Úscrub_secretsÚwinerrorÚ )Úinputrƒ   )rƒ   )rE  rF  )rB  rC  rD  rF  )!r   r3  r4  r+   r;   r'  ÚtimeÚ	monotonicr   r   Úagent.secret_scoperO  r;  rP  r>  Ú
subprocessÚPopenÚPIPEÚ	ExceptionÚ_POPEN_ERRORSr>   r°   Ú_NOT_DIRECTLY_EXECUTABLEr#   Úcommunicaterƒ   ÚBaseExceptionr   r   ÚTimeoutExpiredrÍ   ÚroundrB  )r    r@  rK  r0  rq   Út0Úpopen_kwargsrO  rP  ÚprocÚclsr  rC  rD  rJ  s   &&            @r&   Ú_spawnrm  ß  sè  ø€ à*¨D°(¸BÀÈ"ÈkÐ[`ÐbsÐuxð  {Bð  DHð  I€F÷ð ðKÜ!¤"§'¡'×"4Ñ"4°T·\±\Ó"BÓCˆ÷ Ù�oÓ&Ð&Ü	�ŠÓ	€B÷ OYËj OÔ5GÓ5IÑ#JÐ_nÐpqÐ^r€Lõ 7Ý=ð ß‹:Ü'¨Ó-ˆDÜ×Ò ñ o¬J¯O©Oð oÄJÇOÁOð oÔ\f×\kÑ\kð oØ%)ðoØ4;ðoØDMðoØUZðoá$8ÑGZÓG\Ô$]ðoàamñoˆðØ×)Ñ)°
ÇLÁLÐ)ÓQ‰ˆð ‡M�M˜TŸ_™_°V·\°\¸rÈ&Ï,È,ÐTVÔhmÔnr×n|Òn|Ón~ð  BDõ  oDð  FGó  iH€Mô  IØ€MøôU ô KÙ˜ §¡Ñ 0Ð0CÀCÀ5ÐIÓJÕJûðKûô& ô  ß%‰HˆCÜ˜#×#Ô#Ù˜c“{×"ñ &ô �3˜
 DÓ)¨SÔ0ñ ˜T !�W™K qÔ)AÐ(BÐCÓDÕDÙ”c˜#“hÓÕûð ûô ô 
ä˜$ÔÜ”i× Õ Ø×Ñ QÐÔ'÷ !× × Ð úä˜#œy×)Ò)ØÜ˜#œz×8Ñ8×9Ò9Ùœ#˜c›(Ó#Õ#Ø�‰ ´e¼D¿NºNÓ<LÈrÕ<QÐSTÓ6UˆÔVØ�ûð
ús£   š2F ÂF7 Â&A(F7 ÄH? ÆF4ÆF/Æ)F4Æ/F4Æ7H<ÇH7Ç 	H7Ç)H<Ç/,H7ÈH<È!H7È1H<È7H<È?L+É
"L&É,JÉ?	L&ÊJÊAL&Ë"L+Ë(8L&Ì L+Ì&L+c               ó    € V ^8„  d   QhRRRR/# )r!   r    r�   r"   z'Callable[..., Optional[dict[str, Any]]]r$   )r%   s   "r&   r'   r'     s   € ÷ ñ ˜ð Ð+Rñ r(   c                ól   a € R V 3R llpRS P                    RS P                   R2;Vn        Vn        V# )z>Build the closure that ``invoke_hook()`` will call per firing.c               ó    € V ^8„  d   QhRRRR/# )r!   rM   r   r"   rŒ   r$   )r%   s   "r&   r'   Ú$_make_callback.<locals>.__annotate__  s   € ÷ \ñ \˜Cð \Ð$<ñ \r(   c            
     óü   <€ ^ RI Hp V! 4       '       d   R# SP                  \        9   d)   SP	                  V P                  R4      4      '       g   R# \        S\        S\        SP                  V 4      4      4      # )é    rÕ   NrR   )	rÛ   rÖ   r9   r%  rw   r@   Ú_evaluate_resultrm  Ú_serialize_payload)rM   rÖ   r    s   , €r&   Ú	_callbackÚ!_make_callback.<locals>._callback  s[   ø€ Ý@á× Ò ÙØ�:‰:œÔ%¨d×.?Ñ.?ÀÇ
Á
È;Ó@W×.XÒ.XÙÜ ¤f¨TÔ3EÀdÇjÁjÐRXÓ3YÓ&ZÓ[Ð[r(   zshell_hook[Ú:Ú])r9   r;   ry   r{   )r    rv  s   f r&   râ   râ     s@   ø€ ÷\ð \ð 5@ÀÇ
Á
¸|È1ÈTÏ\É\ÈNÐZ[Ð2\Ð\€IÔ˜Ô/ØÐr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r    r�   Úreasonr#   r"   rN   r$   )r%   s   "r&   r'   r'   &  s&   € ÷ Zñ Z˜]ð Z°Cð Z¸Nñ Zr(   c                ó.   € R RRRV P                    RV 2/# )ÚactionÚblockÚmessagezhook z failed closed: )r;   )r    r{  s   &&r&   Ú_fail_closed_blockr€  &  s$   € Ø�g˜y¨E°$·,±,°Ð?OÐPVÈxÐ*XÐYÐYr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r    r�   ÚrrN   r"   rŒ   r$   )r%   s   "r&   r'   r'   *  s$   € ÷ 8ñ 8Ø
ð8Ø*ð8àñ8r(   c           	     óÔ  € V P                   \        9   pV P                  ;'       d    TpVR,          '       d5   \        P	                  RV P                   V P
                  VR,          4       MBVR,          '       d4   \        P	                  RVR,          V P                   V P
                  4       VR,          '       g   VR,          '       d5   V'       d+   \        YR,          ;'       g    RV P                   R24      # R# VR	,          P                  4       pV'       d4   \        P                  R
V P                   V P
                  VR\         4       VR,          \        8X  d¢   V'       dš   \        V P                   VR,          4      p\        V\        4      '       d   VP                  R4      R8X  d   V# VR\         ;'       g    \         p\        P#                  R\        V P                   V P
                  V4       RRRV/# VR,          ^ 8w  d<   \        P	                  RVR,          V P                   V P
                  VR\         4       VR,          ;'       g    RP                  4       p\        V P                   V4      pVf.   V'       d&   VR,          ^ 8w  d   \        V RVR,           R24      # Vf.   V'       d&   V'       d   \%        V4      '       g   \        V R4      # V# )uf  Turn a :func:`_spawn` diagnostic dict into the hook's contribution.

Single place that encodes the failure semantics:

* spawn error / timeout â€” fail open (log + ``None``) unless the spec
  is ``fail_closed`` on a blocking-capable event, in which case a
  canonical block shape is returned;
* exit code 2 on a blocking-capable event â€” block, with the message
  taken from stdout block JSON, then stderr, then a default
  (Claude-Code / Cursor compatible);
* other non-zero exits â€” warn, then parse stdout normally; a
  ``fail_closed`` hook blocks if no directive was produced;
* non-JSON / unparseable stdout on a ``fail_closed`` blocking hook â€”
  block instead of silently contributing nothing.

Shared by the live callback path (:func:`_make_callback`) and the CLI
test helper (:func:`run_once`) so ``hermes hooks test`` reflects
production behaviour exactly.
rl   z+shell hook failed (event=%s command=%s): %srE  z6shell hook timed out after %.2fs (event=%s command=%s)rF  ztimed out after ÚsNrD  z+shell hook stderr (event=%s command=%s): %srB  rC  r}  r~  u;   shell hook exited %d â€” blocking (event=%s command=%s): %sr  z5shell hook exited %d (event=%s command=%s); stderr=%srP   zhook exited z with no directivez+unparseable stdout (expected a JSON object))r9   r)  r„   rm   rn   r;   r€  rƒ   ri   ÚdebugÚ_STDERR_MESSAGE_LIMITÚBLOCK_EXIT_CODEÚ_parse_responser>   r?   r@   Ú_DEFAULT_BLOCK_MESSAGEr±   Ú_is_json_object)r    r‚  Úblocking_eventr„   rD  r  r  rC  s   &&      r&   rt  rt  *  s\  € ð, —Z‘ZÔ#3Ñ3€NØ×"Ñ"×5Ð5 ~€KØˆ‡z„zÜ�‰ÐDÀdÇjÁjÐRV×R^ÑR^Ð`aÐbiÕ`jÕkØ	
ˆ;�ŒÜ�‰ÐOÐQRÐSdÕQeÐgk×gqÑgqÐsw×sÑsô  	AØˆ‡z„z�Q�{—^”^ß]hÔ! $¨'­
×(XÐ(XÐ8HÈÏÉÈÐVWÐ6XÓYÐrÐnrÐrØˆx�[×ÑÓ €FßÜ�‰ÐBÀDÇJÁJÐPT×P\ÑP\Ð^dÐe{Ôf{Ð^|Ô}Øˆ…œ/Ô)¯nÜ  §¡¨Q¨x­[Ó9ˆÜ�fœd×#Ò#¨¯
©
°8Ó(<ÀÔ(GØˆMØÐ/Ô/Ð0×JÐJÔ4JˆÜ�‰ÐQÔSbÐdh×dnÑdnÐpt×p|Ñp|ð  Fô  	GØ˜' 9¨gÐ6Ð6àˆ…˜!ÔÜ�‰ÐNØ˜•¨¯
©
°D·L±LÀ&ÐI_ÔJ_ÐB`ô	bà��k×Ð˜R×&Ñ&Ó(€FÜ˜TŸZ™Z¨Ó0€FØ‚~Ÿ+¨!¨L­/¸QÔ*>Ü!Ø�L  <¥Ð 1Ð1CÐDó
ð 	
ð ‚~Ÿ+¯&¼È×9PÒ9Pô " $Ð(UÓVÐVØ€Mr(   c               ó    € V ^8„  d   QhRRRR/# )r!   rR  r#   r"   r<   r$   )r%   s   "r&   r'   r'   e  s   € ÷ ñ ˜#ð  $ñ r(   c                ó„   €  \        \        P                  ! V 4      \        4      #   \        P                   d     R # i ; i)F)r>   ÚjsonÚloadsr?   ÚJSONDecodeError)rR  s   &r&   rŠ  rŠ  e  s5   € ðÜœ$Ÿ*š* TÓ*¬DÓ1Ð1øÜ×Ñô Úðús   ‚#& ¦?¾?c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r9   r#   rM   rN   r"   r$   )r%   s   "r&   r'   r'   l  s&   € ÷ nñ n˜cð n¨>ð n¸cñ nr(   c                óV   € \         P                  ! RV /\        V4      CR\        R7      # )zERender the stdin JSON payload; unserialisable values are stringified.Úhook_event_nameF)Úensure_asciir…   )rŽ  Údumpsr_   r#   )r9   rM   s   &&r&   ru  ru  l  s'   € ä�:Š:Ð(¨%ÐK´?À6Ó3JÐKÐZ_ÔilÔmÐmr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   Úprimaryr   Ú	secondaryr"   r#   r$   )r%   s   "r&   r'   r'   q  s&   € ÷ Kñ K˜Cð K¨Cð K°Cñ Kr(   c                óf   € T ;'       g    Tp\        V\        4      '       d   V'       d   V# \        # )zKValidated string block message (primary wins), falling back to the default.)r>   r#   r‰  )r—  r˜  r  s   && r&   Ú_block_messagerš  q  s)   € à
×
Ð
�Y€CÜ˜S¤#×&Ò&¯3ˆ3ÐJÔ4JÐJr(   c               ó    € V ^8„  d   QhRRRR/# ©r!   ÚdatarN   r"   rŒ   r$   )r%   s   "r&   r'   r'   |  s   € ÷ ñ ˜~ð Ð2Jñ r(   c           
     óZ  € \          FL  w  rr4V P                  V4      R 8X  g   K  RR R\        V P                  V4      V P                  V4      4      /u # 	  \          FR  w  p rEV P                  V4      R8X  g   K  \        V P                  V4      \        4      '       g   KF  RRRW,          /u # 	  V P                  R4      R8X  dc   RR/pR FV  pV P                  V4      p\        V\
        4      '       g   K,  VP                  4       '       g   KD  VP                  4       Wg&   KX  	  V# R# )r~  r}  r  ÚmodifyrT   ÚapproveN)r  Úrule_key)Ú_PRE_TOOL_DIALECTSr@   rš  r>   r?   r#   ri   )	r�  Úverbr—  r˜  Ú_ÚpayloadÚ	directiverå   Úvalues	   &        r&   Ú_parse_pre_tool_callr¨  |  sù   € ß'9Ñ#ˆ�yØ�8‰8�D‹>˜WÖ$Ø˜g y´.ÀÇÁÈ'ÓARÐTX×T\ÑT\Ð]fÓTgÓ2hÐiÒiñ (:÷  2Ñˆˆa�Ø�8‰8�D‹>˜XÖ%¬*°T·X±X¸gÓ5FÌ×*MÔ*MØ˜h¨°µÐ>Ò>ñ  2ð
 ‡x�x�Ó˜YÔ&Ø%-¨yÐ$9ˆ	Û*ˆCØ—H‘H˜S“MˆEÜ˜%¤×%Ô%¨%¯+©+¯-¬-Ø!&§¡£�	“ñ +ð ÐÙr(   c               ó    € V ^8„  d   QhRRRR/# rœ  r$   )r%   s   "r&   r'   r'   �  s   € ÷ ñ ˜Nð Ð/Gñ r(   c                óš  € \        V P                  R 4      ;'       g    V P                  R4      ;'       g    R4      P                  4       P                  4       pV P                  R4      ;'       g    V P                  R4      pVR9   dA   \	        V\         4      '       d+   VP                  4       '       d   R RRVP                  4       /# R# )r}  ÚdecisionrP   r  r{  ÚcontinueN>   r~  r¬  )r#   r@   ri   r6  r>   )r�  r}  r  s   &  r&   Ú_parse_pre_verifyr­  �  s–   € ä�—‘˜(Ó#×AÐA t§x¡x°
Ó';×AÐA¸rÓB×HÑHÓJ×PÑPÓR€FØ�h‰h�yÓ!×7Ð7 T§X¡X¨hÓ%7€GØÐ&Ô&¬:°g¼s×+CÒ+CÈÏÉÏÊØ˜* i°·±³ÐAÐAÙr(   c               ó    € V ^8„  d   QhRRRR/# rœ  r$   )r%   s   "r&   r'   r'   ˜  s   € ÷ Zñ Z˜ð ZÐ,Dñ Zr(   c                óˆ   € V P                  R 4      p\        V\        4      '       d   VP                  4       '       d   R V/# R# )ÚcontextN)r@   r>   r#   ri   )r�  r°  s   & r&   Ú_parse_contextr±  ˜  s7   € Ø�h‰h�yÓ!€GÜ#-¨g´s×#;Ò#;ÀÇÁÇÂˆI�wÐÐYÐUYÐYr(   Ú
pre_verifyz?dict[str, Callable[[dict[str, Any]], Optional[dict[str, Any]]]]Ú_RESPONSE_PARSERSc               ó$   € V ^8„  d   QhRRRRRR/# )r!   r9   r#   rC  r"   rŒ   r$   )r%   s   "r&   r'   r'      s'   € ÷ 
bñ 
b˜3ð 
b¨ð 
bÐ0Hñ 
br(   c                óZ  € T;'       g    RP                  4       pV'       g   R#  \        P                  ! V4      p\        T\        4      '       d!   \        P                  T \        4      ! T4      # R#   \        P                   d"    \        P                  RYR,          4        R# i ; i)zATranslate stdout JSON into a Hermes wire-shape dict, or ``None``.rP   Nz3shell hook stdout was not valid JSON (event=%s): %s:NéÈ   N)ri   rŽ  r�  r�  rm   rn   r>   r?   r³  r@   r±  )r9   rC  r�  s   && r&   rˆ  rˆ     sŽ   € à�lˆl˜×!Ñ!Ó#€FßÙðÜ�zŠz˜&Ó!ˆô BLÈDÔRV×AWÒAWÔ× Ñ  ¬Ô7¸Ó=ÐaÐ]aÐaøô ×Ñô Ü�‰ÐLÈeÐ\`ÕUaÔbÚðús   ¦A4 Á42B*Â)B*c               ó   € V ^8„  d   QhRR/# )r!   r"   r   r$   )r%   s   "r&   r'   r'   ¯  s   € ÷ 2ñ 2˜ñ 2r(   c                 ó,   € \        4       \        ,          # )z/Path to the per-user shell-hook allowlist file.)r   ÚALLOWLIST_FILENAMEr$   r(   r&   r›   r›   ¯  s   € äÓÔ1Õ1Ð1r(   c               ó   € V ^8„  d   QhRR/# )r!   r"   ztuple[dict[str, Any], bool]r$   )r%   s   "r&   r'   r'   ´  s   € ÷ ñ Ð4ñ r(   c                 ór  €  \         P                  ! \        4       P                  RR7      4      p \        T \        4      '       g   R. /R3# \        T P                  R4      \        4      pT'       g   . T R&   Y3#   \         d
    R. /R3u # \         P
                  \        \        3 d
    R. /R3u # i ; i)zÔ``(allowlist, readable)``: the parsed allowlist (an empty skeleton when absent or broken) and
whether it could be trusted; a missing file is readable (nothing approved yet), an unreadable or
malformed one is not.z	utf-8-sig©rS  r¨   TF)rŽ  r�  r›   Ú	read_textÚFileNotFoundErrorr�  rZ   ÚUnicodeDecodeErrorr>   r?   r@   r  )r  r´   s     r&   r¬   r¬   ´  s¶   € ð(Ü�jŠjœÓ)×3Ñ3¸[Ð3ÓIÓJˆô
 �cœ4× Ò Ø˜RÐ  %Ð'Ð'Ü˜#Ÿ'™' +Ó.´Ó5€HßØˆˆKÑØˆ=Ðøô ô 'Ø˜RÐ  $Ð&Ò&Ü× Ñ ¤'Ô+=Ð>ô (Ø˜RÐ  %Ð'Ò'ð(ús   ‚.A; Á;B6ÂB6Â,B6Â5B6c               ó   € V ^8„  d   QhRR/# )r!   r"   rN   r$   )r%   s   "r&   r'   r'   Æ  s   € ÷  ñ  ˜ñ  r(   c                 ó$   € \        4       ^ ,          # )z<Return the parsed allowlist, or an empty skeleton if absent.)r¬   r$   r(   r&   rì   rì   Æ  s   € äÓ˜QÕÐr(   c               ó    € V ^8„  d   QhRRRR/# )r!   r�  rN   r"   r1   r$   )r%   s   "r&   r'   r'   Ë  s   € ÷ hñ h˜ð h¨Dñ hr(   c                ó–   € \        4       p \        WRRR7       R#   \         d"   p\        P	                  RY4        Rp?R# Rp?ii ; i)zFAtomic write; on OSError log and carry on (the approval is not saved).Ti€  )Ú	sort_keysÚmodezñFailed to persist shell hook allowlist to %s: %s. The approval holds for this process only (a gateway keeps a launch's --accept-hooks until it restarts); a gateway session opened from a CLI prompt skips the hook, and the next run re-prompts.N)r›   r   rZ   rm   rn   )r�  Úprq   s   &  r&   Úsave_allowlistrÇ  Ë  sJ   € äÓ€AðhÜ˜!¨T¸×>øÜô hÜ�‰ð _à`a÷	hò 	hûðhús   Œ œA§AÁAc               ó   € V ^8„  d   QhRR/# )r!   r"   zIterator[dict[str, Any]]r$   )r%   s   "r&   r'   r'   ×  s   € ÷ ñ Ð":ñ r(   c            
   #  ó4  "  € \        4       p V P                  P                  RRR7       \        4       ;_uu_ 4       p\        f   VP                  \        4       M†VP                  \        V P                  V P                  R,           4      RRR7      4      p\        P                  ! VP                  4       \        P                  4       VP                  \        V4       \        4       pVx € \!        V4       RRR4       R#   + '       g   i     R# ; i5i)zPSerialise allowlist read-modify-write across processes via a sibling flock file.T)ÚparentsÚexist_okNz.lockza+rT  r¼  )r›   ÚparentÚmkdirr   ÚfcntlÚenter_contextÚ_allowlist_write_lockÚopenÚwith_suffixr<  ÚflockÚfilenoÚLOCK_EXræ   Ú_flock_unlockrì   rÇ  )rÆ  ÚstackÚlock_fhr�  s       r&   Ú_locked_update_approvalsrÙ  Ö  s´   é € ô 	Ó€AØ‡H�H‡N�N˜4¨$€NÔ/Ü	�Œ˜ÜŠ=Ø×ÑÔ 5Õ6à×)Ñ)¬$¨q¯}©}¸Q¿X¹XÈÕ=OÓ/PÐRVÐahÔ*iÓjˆGÜ�KŠK˜Ÿ™Ó(¬%¯-©-Ô8Ø�N‰Nœ=¨'Ô2ÜÓˆØŠ
Ü�tÔ÷ 
��Šüs   ‚:D¼B>DÃ:
DÄD	Ä	Dc               ó    € V ^8„  d   QhRRRR/# )r!   rØ  r   r"   r1   r$   )r%   s   "r&   r'   r'   ç  s   € ÷ 5ñ 5˜3ð 5 4ñ 5r(   c                óÔ   € \        \        4      ;_uu_ 4        \        P                  ! V P	                  4       \        P
                  4       R R R 4       R #   + '       g   i     R # ; ir*   )r   rZ   rÎ  rÓ  rÔ  ÚLOCK_UN)rØ  s   &r&   rÖ  rÖ  ç  s5   € Ü	”'×	Õ	Ü�Š�G—N‘NÓ$¤e§m¡mÔ4÷ 
×	×	Ò	ús   ˜4AÁA'	c               ó(   € V ^8„  d   QhRRRRRRRR/# )r!   r9   r#   r;   rˆ   r<   r"   r$   )r%   s   "r&   r'   r'   ì  s(   € ÷ "ñ "˜cð "¨Cð "À$ð "È4ñ "r(   c               óŠ  € V'       d$   \        W4       \        P                  RW4       R# \        P                  P                  4       '       g   R# \        RV  RV R24        \        R4      P                  4       P                  4       pTR9   d   \        Y4       TR9   #   \        \        3 d    \        4         R# i ; i)	zKApprove an unseen ``(event, command)`` pair; True iff granted and recorded.zDshell hook auto-approved via --accept-hooks / env / config: %s -> %sTFuf   
âš  Hermes is about to register a shell hook that will run a
  command on your behalf.

    Event:   z
    Command: zU

  Commands run with your full user credentials.  Only approve
  commands you trust.zAllow this hook to run? [y/N]: >   ÚyÚyes)Ú_record_approvalrm   r±   r9  rQ  ÚisattyÚprintr[  ri   r6  ÚEOFErrorÚKeyboardInterrupt)r9   r;   rˆ   Úanswers   &&$ r&   rï   rï   ì  s¸   € çÜ˜Ô(Ü�‰ÐZÐ\aÔkÙÜ�9‰9×Ñ×ÒÙÜ	ðØ�w˜o¨g¨Yð 7_ð	`ôð
ÜÐ8Ó9×?Ñ?ÓA×GÑGÓIˆð �ÔÜ˜Ô(Ø�\Ñ!Ð!øô Ô'Ð(ô ÜŒÚðús   Á%'B# Â#CÃCc               ó$   € V ^8„  d   QhRRRRRR/# )r!   r9   r#   r;   r"   r1   r$   )r%   s   "r&   r'   r'     s&   € ÷ vñ v˜Cð v¨#ð v°$ñ vr(   c           
     ó&  € R V RVR\        4       R\        V4      /p\        4       ;_uu_ 4       pVP                  R. 4       Uu. uF  p\	        W@V4      '       d   K  VNK  	  upV.,           VR&   RRR4       R# u upi   + '       g   i     R# ; i)r9   r;   Úapproved_atÚscript_mtime_at_approvalr¨   N)rK   Úscript_mtime_isorÙ  r@   rA   )r9   r;   Úentryr�  r8   s   &&   r&   rá  rá    s‹   € Ø�e˜Y¨°ÄÃÐPjÔl|ð  ~Eó  mFð  G€EÜ	!×	#Ô	# tØ(,¯©°¸bÔ(AÓkÑ(A 1ÌÐXYÐbi×IjŸQ˜QÑ(AÑkÐotÐnuÕuˆˆ[Ñ÷ 
$Ñ	#ùÚk÷ 
$×	#Ð	#ús#   ®A?ÁA:ÁA:Á"A?Á:A?Á?B	c               ó    € V ^8„  d   QhRRRR/# )r!   r;   r#   r"   r‚   r$   )r%   s   "r&   r'   r'   	  s   € ÷ /ñ /�Cð /˜Cñ /r(   c           
     óJ  € \        4       ;_uu_ 4       p\        VP                  R. 4      4      pVP                  R. 4       Uu. uF  p\        VRV 4      '       d   K  VNK  	  upVR&   V\        VR,          4      ,
          uuRRR4       # u upi   + '       g   i     R# ; i)zðRemove every allowlist entry for ``command``; returns the count. A gateway unregisters it at its
next allowlist check (``sync_from_config``, about every 30 s) unless an opt-in approves every hook; other live
processes keep it until restart.r¨   N)rÙ  Úlenr@   rA   )r;   r�  Úbeforer8   s   &   r&   Úrevokerñ  	  sƒ   € ô 
"×	#Ô	# tÜ�T—X‘X˜k¨2Ó.Ó/ˆØ(,¯©°¸bÔ(AÓjÑ(A 1ÌÐXYÐ[_Ðah×IiŸQ˜QÑ(AÑjˆˆ[ÑØœ˜D Õ-Ó.Õ.÷ 
$Ò	#ùâj÷ 
$×	#Ð	#ús#   “0BÁBÁBÁ#BÂBÂB"	ztuple[str, ...]Ú_SCRIPT_EXTENSIONSc               ó    € V ^8„  d   QhRRRR/# )r!   r;   r#   r"   r$   )r%   s   "r&   r'   r'     s   € ÷ \ñ \ #ð \¨#ñ \r(   c                óÔ   €  \        V 4      ;'       g    V .p\        R T 4       R4      ;'       g%    \        R T 4       R4      ;'       g
    T^ ,          #   \         d    T u # i ; i)zZFirst token with a script extension, else the first path-like token, else the first token.c              3  óz   "  € T F1  qP                  4       P                  \        4      '       g   K-  Vx € K3  	  R # 5ir*   )r6  Úendswithrò  ©rÉ   rÆ  s   & r&   rË   Ú'_command_script_path.<locals>.<genexpr>  s$   é € ÐM™U˜§g¡g£i×&8Ñ&8Ô9K×&L—!’!›Uùs   ‚*;±
;Nc              3  óf   "  € T F'  pR V9   g   VP                  R4      '       g   K#  Vx € K)  	  R# 5i)Ú/Ú~N)Ú
startswithr÷  s   & r&   rË   rø    s#   é € ÐG¡˜1¨°¬°Q·\±\À#×5F—Q’Q£ùs   ‚ 1§
1)r   r'  Únext)r;   Úpartss   & r&   Ú_command_script_pathrÿ    sz   € ðÜ" 7Ó+×8Ð8°¨yˆô ÑM™UÓMÈtÓT÷ [ð [ÜÑG¡ÓGÈÓN÷[ð [ØRWÐXYÕRZð\øô ô ØŠðús   ‚A ”A ÁA'Á&A'c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r‹   rN   Úaccept_hooks_argr<   r"   r$   )r%   s   "r&   r'   r'      s&   € ÷ uñ u >ð uÀTð uÈdñ ur(   c                ó$  € ^ RI Hp V'       g   \        '       g   V! R4      '       d   R# V P                  RR4      p\	        V\
        4      '       d   V# \	        V\        4      ;'       d&    VP                  4       P                  4       \        9   # )ztAny truthy opt-in channel wins: explicit arg, this process's --accept-hooks, HERMES_ACCEPT_HOOKS,
hooks_auto_accept.r×   ÚHERMES_ACCEPT_HOOKSTÚhooks_auto_acceptF)
rÜ   rØ   rÑ   r@   r>   r<   r#   ri   r6  Ú_TRUTHY)r‹   r  rØ   Úcfg_vals   &&  r&   r—   r—      sl   € õ &ßŸ?›?©oÐ>S×.TÒ.TÙØ�g‰gÐ)¨5Ó1€GÜ  ¬$×/Ò/ˆ7Ðt´ZÀÌÓ5M×5tÐ5tÐRY×R_ÑR_ÓRa×RgÑRgÓRiÔmtÑRtÐtr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r!   r9   r#   r;   r"   rŒ   r$   )r%   s   "r&   r'   r'   ,  s'   € ÷ oñ o˜sð o¨Sð oÐ5Mñ or(   c                ód   a a€ \        VV 3R l\        4       P                  R. 4       4       R4      # )z2Return the allowlist record for this pair, if any.c              3  óR   <"  € T F  p\        VSS4      '       g   K  Vx € K  	  R # 5ir*   )rA   )rÉ   r8   r;   r9   s   & €€r&   rË   Ú&allowlist_entry_for.<locals>.<genexpr>.  s#   øé € ÐgÑA�qÄ^ÐTUÐW\Ð^e×Ef—’ÓAùs   ƒ'�
'r¨   N)rý  rì   r@   rÈ   s   ffr&   Úallowlist_entry_forr  ,  s'   ù€ äÕgœNÓ,×0Ñ0°¸bÔAÓgÐimÓnÐnr(   c               ó    € V ^8„  d   QhRRRR/# )r!   r;   r#   r"   r:   r$   )r%   s   "r&   r'   r'   1  s   € ÷ oñ o˜cð o mñ or(   c                óJ  € \        V 4      p V'       d=   \        P                  P                  \        P                  P	                  V4      4      MRpTf   R# \        P                  ! T\        R7      P                  4       P                  RR4      #   \
         d     R# i ; i)zCISO-8601 mtime of the resolved script path, or ``None`` if missing.NrD   rF   rG   )rÿ  r3  r4  Úgetmtimer+   rZ   r   Úfromtimestampr
   rI   rJ   )r;   r4  Úmtimes   &  r&   rë  rë  1  s‚   € ä Ó(€Dðß>B”—‘× Ñ ¤§¡×!3Ñ!3°DÓ!9Ô:Èˆð ’=ˆ4Ðn¤h×&<Ò&<¸UÄsÔ&K×&UÑ&UÓ&W×&_Ñ&_Ð`hÐjmÓ&nÐnøô ô Úðús   �AB ÂB"Â!B"c               ó    € V ^8„  d   QhRRRR/# )r!   r;   r#   r"   r<   r$   )r%   s   "r&   r'   r'   ;  s   € ÷ fñ f #ð f¨$ñ fr(   c                óœ  € \        V 4      p\        P                  P                  V4      p V'       d1   \        P                  P	                  V4      '       d   \        V 4      MRpTRJ;'       dK    \        P                  ! Y#'       d   T^ ,          T8X  d   \        P                  M\        P                  4      #   \         d     R# i ; i)zmRunnable as configured: a bare script needs X_OK, an interpreter-prefixed one only R_OK (as ``_spawn`` does).NF)
rÿ  r3  r4  r+   r8  r   r'  ÚaccessÚX_OKÚR_OK)r;   r4  Úexpandedr0  s   &   r&   Úscript_is_executabler  ;  s•   € ä Ó(€DÜ�w‰w×!Ñ! $Ó'€Hðß.2´r·w±w·~±~Àh×7OÒ7OÔ! 'Ô*ÐUYˆð �tÐ×eÐe¤§	¢	¨(¾tÈÈQÍÐSWÌ´B·G²GÔ]_×]dÑ]dÓ eÐeøô ô Úðús   ¬,B< ÁB< Â<CÃ
Cc               ó$   € V ^8„  d   QhRRRRRR/# )r!   r    r�   rM   rN   r"   r$   )r%   s   "r&   r'   r'   F  s!   € ÷ ñ �=ð ¨.ð ¸^ñ r(   c                ób   € \        V \        V P                  V4      4      p\        W4      VR&   V# )zdFire one hook with a synthetic payload (``hermes hooks test`` / doctor) through the production path.r  )rm  ru  r9   rt  )r    rM   rJ  s   && r&   Úrun_oncer  F  s.   € ä�DÔ,¨T¯Z©Z¸Ó@ÓA€FÜ'¨Ó5€Fˆ8ÑØ€Mr(   >   Ú1Úonrà  Útrue>   rT   rR   rU   rV   ))r}  r  r{  rT   )r«  r{  r  rS   )r*  r,  z.zshz.fishr-  z.pywz.rbz.plz.luaz.jsz.mjsz.cjsz.ts)€Ú__conditional_annotations__r}   Ú
__future__r   r  rŽ  Úloggingr3  rj   r_  r9  Ú	threadingr\  Ú
contextlibr   r   r   Údataclassesr   r   r   r	   r
   Úpathlibr   Útypingr   r   r   r   r   r   r   r   Úhermes_cli._subprocess_compatr   r   r   r   rÎ  ÚImportErrorÚhermes_constantsr   rÜ   r   Ú	getLoggerry   rm   r‡   r(  r¹  r‰  r‡  Ú	frozensetr)  r%  r†  r  r]   Úsetr   r~   ÚLockr•   rÐ  r«   r   rÑ   r   r-   r6   rA   rK   r_   ra   r�   r¤   rÀ   rÃ   rÎ   rÒ   r“   r–   rœ   r­   r˜   r™   ró   rù   rý   rò   rÝ   r  r¾  ÚPermissionErrorrc  r7  rd  r>  rm  râ   r€  rt  rŠ  ru  rš  r¢  r¨  r­  r±  r³  rˆ  r›   r¬   rì   rÇ  rÙ  rÖ  rï   rá  rñ  rò  rÿ  r—   r  rë  r  r  )r  s   @r&   Ú<module>r.     s  øðôvõ #ã Û Û Û 	Û 	Û Û 
Û Û ß :Ñ :ß (ß ,Ñ ,Ý ß L× LÓ L÷ pÓ oðÛõ -Ý #à	×	Ò	˜8Ó	$€àÐ ØÐ Ø1Ð Ø1Ð à€á˜oÐ.Ó/Ð Ù˜/Ð+;Ð<Ó=€ØÐ Ú
$€âRÐ ñ 9<»€Ð5Ó =Ø—>’>Ó#Ð ð "ŸšÓ(Ð à�^Š^Ó€
ñ .1«U€Ð*Ó 2Ø€Ù*-«%€Ð'Ó /õ9õNõnõCõ÷$Fñ Fð< ôMÐ%ó Mó ðMð3ÐPUð 3Ø-2÷3õ>6lðrVÐV[÷ VõKõõ*õ>õõ"nõ
:õõQõ
(õ&õ&õ
"õJ'zðZ $Ð%8Ð9¸OÐMeÐ;fÐg€ð !& v¨w¸ÀÀxÐPÐ ð PÐ õ!õ4õnõ Zõ8õvõnõ
Kð pÐ õõ&õZð
 WfÐg{ð  ~Jð  L]ð  V^Ð ÐRó  ^õ
bõ2õ
õ$ õ
hð ôó ðõ 5õ
"õ.võ/ð 'KÐ �Oó  Kõ\õuõoõ
oõf÷øðS ô ØƒEðús   Á4J Ê	JÊJ