
    %j                        d Z ddlmZ ddlZddlmZ ddlmZmZm	Z	  e	dd          Z
 G d	 d
ej        ee
                   ZdS )zBase dependency class.    )annotationsN)TracebackType)AnyGenericTypeVarTT)	covariantc                  T    e Zd ZU dZdZded<   ddZej        dd            Z	ddZ
dS )
Dependencya  Base class for all injectable dependencies.

    Subclasses implement ``__aenter__`` to produce the injected value and
    optionally ``__aexit__`` for cleanup. The resolution engine enters each
    dependency as an async context manager, so resources are cleaned up in
    reverse order when the call completes.

    Set ``single = True`` on a subclass to enforce that only one instance
    of that dependency type may appear in a function's signature.
    Fboolsinglenamestrvaluer   returnDependency[T]c                    | S )zReturn a copy bound to a parameter's name and value.

        Called when the dependency appears as ``Annotated`` metadata.
        Subclasses override to capture context; the default returns *self*.
         )selfr   r   s      Y/home/rurouni/.hermes/hermes-agent/venv/lib/python3.11/site-packages/uncalled_for/base.pybind_to_parameterzDependency.bind_to_parameter   s	         r   c                
   K   d S Nr   )r   s    r   
__aenter__zDependency.__aenter__"   s      %(Sr   exc_typetype[BaseException] | None	exc_valueBaseException | None	tracebackTracebackType | NoneNonec                
   K   d S r   r   )r   r   r   r    s       r   	__aexit__zDependency.__aexit__%   s       	r   N)r   r   r   r   r   r   )r   r   )r   r   r   r   r    r!   r   r"   )__name__
__module____qualname____doc__r   __annotations__r   abcabstractmethodr   r$   r   r   r   r   r      sw         	 	 F    	((( (     r   r   )r(   
__future__r   r*   typesr   typingr   r   r   r   ABCr   r   r   r   <module>r0      s      " " " " " " 



       ( ( ( ( ( ( ( ( ( (GC4       '!*     r   