
    f3fi{                         d Z ddlZddlZddlmZ  ej
                  e      Z ej                         Z	deddfdZ
d	dZdefdZy)
zThread-local storage utilities for Claude Agent SDK tracing.

This module provides thread-local storage for the parent run tree,
which is used by hooks to maintain trace context when async context
propagation is broken.
    N)Anyrun_treereturnc                     | t         _        y)z0Set the parent run tree in thread-local storage.N)_thread_localparent_run_tree)r   s    l/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langsmith/integrations/claude_agent_sdk/_tools.pyset_parent_run_treer
      s
    $,M!    c                  F    t        t        d      rt        t        d       yy)z4Clear the parent run tree from thread-local storage.r   N)hasattrr   delattr r   r	   clear_parent_run_treer      s    }/001 1r   c                  $    t        t        dd      S )z2Get the parent run tree from thread-local storage.r   N)getattrr   r   r   r	   get_parent_run_treer       s    ="3T::r   )r   N)__doc__logging	threadingtypingr   	getLogger__name__loggerlocalr   r
   r   r   r   r   r	   <module>r      s[      			8	$  	!-# -$ -
2;S ;r   