§
    éŽ’j©  ã                  óð   — d Z ddlmZ ddlZddlZddlmZmZmZ ddl	Z	 G d„ de¦  «        Z
 G d„ d¦  «        Zeeged         f         Zdd„Z G d„ deej        ¦  «        Z G d„ de	j        ¦  «        ZdS )zìCore trigger interface for the Google Antigravity SDK.

A Trigger is a long-lived async function that runs alongside an agent
session. It reacts to external events (cron, file changes, webhooks)
and pushes messages back into the agent.
é    )ÚannotationsN)Ú	AwaitableÚCallableÚProtocolc                  ó   — e Zd Zdd„ZdS )ÚTriggerConnectionÚcontentÚstrÚreturnÚNonec              ƒ  ó
   K  — d S ©N© ©Úselfr	   s     úRC:\Projects\DSCons\.venv\Lib\site-packages\google\antigravity\triggers\triggers.pyÚsend_trigger_notificationz+TriggerConnection.send_trigger_notification!   s   è è € Ø€Có    N©r	   r
   r   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s(   € € € € € ðð ð ð ð ð r   r   c                  ó"   — e Zd ZdZdd„Zdd	„Zd
S )ÚTriggerContextz–Handle provided to every trigger at startup.

  Provides the capability to send messages to the agent. One
  TriggerContext is created per trigger.
  Ú
connectionr   r   r   c                ó   — || _         d S r   )Ú_connection)r   r   s     r   Ú__init__zTriggerContext.__init__,   s   € ð "€DÔÐÐr   r	   r
   c              ƒ  óJ   K  — | j                              |¦  «        ƒ d{V —† dS )zQSends a message to the agent.

    Args:
      content: The message content.
    N)r   r   r   s     r   ÚsendzTriggerContext.send2   s7   è è € ð Ô
×
4Ò
4°WÑ
=Ô
=Ð=Ð=Ð=Ð=Ð=Ð=Ð=Ð=Ð=r   N)r   r   r   r   r   )r   r   r   Ú__doc__r   r    r   r   r   r   r   %   sF   € € € € € ðð ð"ð "ð "ð "ð	>ð 	>ð 	>ð 	>ð 	>ð 	>r   r   Úfuncú+Callable[[TriggerContext], Awaitable[None]]c                ó&  — t          j        | ¦  «        st          d¦  «        ‚t          j        | ¦  «        }t	          |j                             ¦   «         ¦  «        }t          |¦  «        dk    rt          d¦  «        ‚t          | dd¦  «         | S )a!  Decorator for Triggers.

  Validates that the function is async and accepts exactly one argument
  (TriggerContext). Adds __is_trigger__ = True metadata.

  Args:
    func: The async function to wrap as a trigger.

  Returns:
    The original function with __is_trigger__ attribute set.
  z!Trigger must be an async functioné   z)Trigger must accept exactly one parameterÚ__is_trigger__T)	ÚinspectÚiscoroutinefunctionÚ
ValueErrorÚ	signatureÚlistÚ
parametersÚvaluesÚlenÚsetattr)r"   ÚsigÚparamss      r   Útriggerr2   B   s‰   € õ 
Ô	$ TÑ	*Ô	*ð :Ý
Ð8Ñ
9Ô
9Ð9åÔ˜$ÑÔ€#Ý�”×%Ò%Ñ'Ô'Ñ(Ô(€&Ýˆ�[„[�AÒÐÝ
Ð@Ñ
AÔ
AÐAå	ˆ$Ð  $Ñ'Ô'Ð'Ø	€+r   c                  ó   — e Zd ZdZdZdZdZdS )ÚFileChangeKindz>Kind of filesystem change detected by a file-watching trigger.ÚaddedÚmodifiedÚdeletedN)r   r   r   r!   ÚADDEDÚMODIFIEDÚDELETEDr   r   r   r4   r4   Z   s#   € € € € € ØFÐFà
€%Ø€(Ø€'€'€'r   r4   c                  óJ   — e Zd ZU dZ ej        d¬¦  «        Zded<   ded<   dS )	Ú
FileChangez·A single filesystem change detected by a file-watching trigger.

  Attributes:
    kind: The type of change (added, modified, deleted).
    path: Absolute path to the changed file.
  T)Úfrozenr4   Úkindr
   ÚpathN)r   r   r   r!   ÚpydanticÚ
ConfigDictÚmodel_configÚ__annotations__r   r   r   r<   r<   b   sF   € € € € € € ðð ð %�Ô$¨DÐ1Ñ1Ô1€,àÐÐÑØ€)€)�)€)€)r   r<   )r"   r#   )r!   Ú
__future__r   Úenumr'   Útypingr   r   r   r@   r   r   ÚTriggerr2   r
   ÚEnumr4   Ú	BaseModelr<   r   r   r   ú<module>rJ      s?  ððð ð #Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0à €€€ðð ð ð ð ˜ñ ô ð ð>ð >ð >ð >ð >ñ >ô >ð >ð4 �NÐ# Y¨t¤_Ð4Ô
5€ðð ð ð ð0ð ð ð ð �S˜$œ)ñ ô ð ðð ð ð ð �Ô#ñ ô ð ð ð r   