+
    O(i                        R t ^ RIHt ^ RIt^ RIHtHt ^ RIHtH	t	 ^ RI
Ht ^ RIHt ^RIHt ^RIHt ^R	IHtHt  ! R
 R4      t]	RR R ll4       t]! RR7      R R l4       tR# )zADependency resolution: resolving, wrapping, and failure handling.)annotationsN)AsyncGeneratorCallable)AsyncExitStackasynccontextmanager)	lru_cache)Any)get_annotation_dependencies)_Depends)get_dependency_parametersget_signaturec                  &    ] tR t^tRtR R ltRtR# )FailedDependencyz;Placeholder for a dependency that raised during resolution.c               $    V ^8  d   QhRRRRRR/# )   	parameterstrerror	ExceptionreturnNone )formats   "]/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/uncalled_for/resolution.py__annotate__FailedDependency.__annotate__   s!      # i D     c                	    Wn         W n        R # N)r   r   )selfr   r   s   &&&r   __init__FailedDependency.__init__   s    "
r   )r   r   N)__name__
__module____qualname____firstlineno____doc__r    __static_attributes__r   r   r   r   r      s    E r   r   c               $    V ^8  d   QhRRRRRR/# )r   functionCallable[..., Any]kwargszdict[str, Any] | Noner   zAsyncGenerator[dict[str, Any]]r   )r   s   "r   r   r      s&     .* .* .*!.* $.*r   c           	    @  "   T;'       g    / p\         P                  P                  / 4      p \        4       ;_uu_4       GRj  xL
 p\         P                  P                  V4      p / p\        V 4      pVP                  4        F3  w  rW9   d   W(,          Wh&   K   VP                  V	4      G Rj  xL
 Wh&   K5  	  \        V 4      pVP                  4        FX  w  rVP                  WP                  V4      4      pV F-  p	V	P                  W4      pVP                  V4      G Rj  xL
  K/  	  KZ  	  V5x  \         P                  P                  V4       RRR4      GRj  xL
  \         P                  P                  V4       R#  ELE L  \         d   p
\        Y4      Yh&    Rp
?
EK'  Rp
?
ii ; i L  \         P                  P                  T4       i ; i Lw  + GRj  xL 
 '       g   i     L; i  \         P                  P                  T4       i ; i5i)aU  Resolve all dependencies declared on a function's signature.

Yields a dict mapping parameter names to resolved values. Dependencies
are entered as async context managers and cleaned up when the context
exits.

Parameters already present in *kwargs* are passed through without
resolution, allowing callers to override specific dependencies.
N)r
   cachesetr   stackr   itemsenter_async_contextr   r   r	   getbind_to_parameterreset)r)   r+   providedcache_tokenr/   stack_token	arguments
parametersr   
dependencyr   annotation_dependenciesparameter_namedependenciesvaluebounds   &&              r   resolved_dependenciesr@      s     ||H..$$R(K*!###u"..,,U3K2,.	6x@
-7-=-=-?)I ,/7/B	, R5:5N5N&6 0	, .@ +Fh*O'4K4Q4Q4S0N$LL~9VWE&2
 * < <^ S#77>>> '3 5T  $$[17 $#: 	[); $0 % R/?	/Q	,,R ? $$[17 $###: 	[)s   ,HG: F
G: 	 G*4F8F3F
4F:A.F8(F6)F8:GG: $G%G: )!H
G: FF3	F.	'F8.F3	3F88!GGG: G7	$G'%
G7	0G7	2G: :!HHi  )maxsizec                    V ^8  d   QhRRRR/# )r   r)   r*   r   r   )r   s   "r   r   r   K   s     ( (#5 (:L (r   c                r  a a \        \        S 4      4      p\        S 4      pV'       g   V'       g   S # \        S 4      pVP                  P                  4        UUu. uF  w  rEWA9  g   K  VNK  	  pppVP                  V\        P                  P                  R7      p\        P                  ! S 4      oR V V3R llpS P                  Vn        S P                  Vn        Wxn        S P                  P                  4        U	U
u/ uF  w  rW9  g   K  V	R8w  g   K  WbK  	  up
p	Vn        V# u uppi u up
p	i )a  Produce a wrapper whose signature hides dependency parameters.

If *function* has no ``Dependency`` defaults, it is returned unchanged.
Otherwise an async wrapper is returned that resolves dependencies
automatically and forwards user-supplied keyword arguments.
)r9   return_annotationc                    V ^8  d   QhRRRR/# )r   r+   r   r   r   )r   s   "r   r   *without_dependencies.<locals>.__annotate__c   s     * * * *r   c                 $  <"   \        SV 4      ;_uu_4       GR j  xL
 p/ VCV CpS'       d#   S! R/ VB G R j  xL
 uuR R R 4      GR j  xL
  # S! R/ VB uuR R R 4      GR j  xL
  #  LN L2 L# L  + GR j  xL 
 '       g   i     R # ; i5i)Nr   )r@   )r+   resolved
all_kwargsr)   is_asyncs   ,  r   wrapper%without_dependencies.<locals>.wrapperc   sn     (6:::h/H//J%3
33 ;:: )j)	 ;:: 4 ;:::sw   BA+BA3A-A3BA/BA3B%A1&B-A3/B1B3B	9A<:
B	B		Br   )r.   r   r	   r   r9   r0   replaceinspect	Parameteremptyiscoroutinefunctionr"   r&   __signature____annotations__)r)   dependency_namesr;   original_signaturenamepfiltered_parametersnew_signaturerK   kvrJ   s   f          @r   without_dependenciesr\   J   s3    4X>?9(C$;&x0 *44::<<GD' 	
<  
 '..&':K:K:Q:Q / M **84H* *  ((G&&GO) ,,2244DA$ 	)*h 	4G N7*s   
D-+D-
D3D3D3r   )r&   
__future__r   rN   collections.abcr   r   
contextlibr   r   	functoolsr   typingr   r	   
functionalr
   introspectionr   r   r   r@   r\   r   r   r   <module>rd      s[    G "  4 :   4   C  .* .*b 5( (r   