
    j
i                        d dl mZ d dlmZmZmZ  G d de          Ze G d de                      Z G d de          ZddZ	 G d de          Z
dS )    )annotations)AnyProtocolruntime_checkablec                  "    e Zd ZdZd
dZddZd	S )UntypedSerializerProtocolz:Protocol for serialization and deserialization of objects.objr   returnbytesc                    d S N selfr	   s     C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\langgraph/checkpoint/serde/base.pydumpszUntypedSerializerProtocol.dumps	             datac                    d S r   r   r   r   s     r   loadszUntypedSerializerProtocol.loads   r   r   N)r	   r   r
   r   )r   r   r
   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r      s.        DD++++,,,,,,r   r   c                  "    e Zd ZdZd
dZddZd	S )SerializerProtocola  Protocol for serialization and deserialization of objects.

    - `dumps_typed`: Serialize an object to a tuple `(type, bytes)`.
    - `loads_typed`: Deserialize an object from a tuple `(type, bytes)`.

    Valid implementations include the `pickle`, `json` and `orjson` modules.
    r	   r   r
   tuple[str, bytes]c                    d S r   r   r   s     r   dumps_typedzSerializerProtocol.dumps_typed   r   r   r   c                    d S r   r   r   s     r   loads_typedzSerializerProtocol.loads_typed   r   r   Nr	   r   r
   r   r   r   r
   r   )r   r   r   r   r!   r#   r   r   r   r   r      s4          >===>>>>>>r   r   c                  &    e Zd ZddZdd	ZddZdS )SerializerCompatserder   r
   Nonec                    || _         d S r   r(   )r   r(   s     r   __init__zSerializerCompat.__init__   s    


r   r	   r   r   c                ^    t          |          j        | j                            |          fS r   )typer   r(   r   r   s     r   r!   zSerializerCompat.dumps_typed!   s&    Cyy!4:#3#3C#8#888r   r   c                B    | j                             |d                   S )N   )r(   r   r   s     r   r#   zSerializerCompat.loads_typed$   s    zQ(((r   N)r(   r   r
   r)   r$   r%   )r   r   r   r,   r!   r#   r   r   r   r'   r'      sP           9 9 9 9) ) ) ) ) )r   r'   r(   .SerializerProtocol | UntypedSerializerProtocolr
   c                N    t          | t                    st          |           S | S )zmWrap serde old serde implementations in a class with loads_typed and dumps_typed for backwards compatibility.)
isinstancer   r'   r+   s    r   maybe_add_typed_methodsr4   (   s*    
 e/00 '&&&Lr   c                  "    e Zd ZdZddZdd
ZdS )CipherProtocolz~Protocol for encryption and decryption of data.

    - `encrypt`: Encrypt plaintext.
    - `decrypt`: Decrypt ciphertext.
    	plaintextr   r
   r   c                    dS )z?Encrypt plaintext. Returns a tuple `(cipher name, ciphertext)`.Nr   )r   r7   s     r   encryptzCipherProtocol.encrypt:       r   
ciphernamestr
ciphertextc                    dS )z*Decrypt ciphertext. Returns the plaintext.Nr   )r   r;   r=   s      r   decryptzCipherProtocol.decrypt>   r:   r   N)r7   r   r
   r   )r;   r<   r=   r   r
   r   )r   r   r   r   r9   r?   r   r   r   r6   r6   3   sF                 r   r6   N)r(   r1   r
   r   )
__future__r   typingr   r   r   r   r   r'   r4   r6   r   r   r   <module>rB      s	   " " " " " " 3 3 3 3 3 3 3 3 3 3- - - - - - - - ? ? ? ? ? ? ? ?) ) ) ) )) ) ) )       X     r   