
    epj.                    4    d Z ddlmZ ddlZddlmZ dddZdS )z7Compatibility helper for explicit agent stop producers.    )annotationsN)Anyagentr   message
str | Nonereturnboolc                   	 t          j        | d           t          | dd          }n# t          $ r d}Y nw xY wt	          |          st          | dd          }t	          |          sdS | |             n ||           dS )at  Request an explicit stop, falling back to the legacy interrupt ABI.

    New agents expose ``hard_interrupt(message=None)``. Third-party agents and
    old test doubles may only expose ``interrupt(message=None)``; keep those
    usable without sending the newer ``hard_cancel=`` keyword they do not know.
    Returns ``False`` only when neither callable is available.
    hard_interruptN	interruptFT)inspectgetattr_staticgetattrAttributeErrorcallable)r   r   r   s      </home/thesage/.hermes/hermes-agent/agent/interrupt_compat.pyrequest_hard_interruptr   	   s    ;u&6777 E#3T::		    			 I 6E;55	I u		'4s   ) 88)N)r   r   r   r   r   r	   )__doc__
__future__r   r   typingr   r        r   <module>r      s[    = = " " " " " "             r   