
    ވin                         S r SSKrSSKrSSKJr  SSKJrJr  SSKJrJ	r	  \R                  " S5      r\" S5      r " S S	5      rg)
u   
Genesis Superior Browser (GSB) — Antigravity Delegation (Layer 3)
===============================================================
Bridges to the Antigravity Master Agent for high-stealth/complex tasks.
    N)Path)datetimetimezone)DictOptionalz"genesis_v2.core.browser.delegationz+/mnt/e/genesis-system/data/antigravity-syncc                   D    \ rS rSrS rS\S\4S jrS\S\\   4S jr	Sr
g	)
AntigravityDelegator   c                     [         S-  U l        [         S-  U l        U R                  R                  SSS9  U R                  R                  SSS9  g )Nbrowser_requestsbrowser_resultsT)parentsexist_ok)SYNC_DIRrequests_dirresults_dirmkdir)selfs    >E:\genesis-system\genesis_v2\core\browser_engines\delegator.py__init__AntigravityDelegator.__init__   sP    $'99#&77t<td;    task_descriptionreturnc                   #    S[        [        R                  " [        R                  5      R                  5       5       3nU R                  U S3-  nUU[        R                  " [        R                  5      R                  5       SS.nUR                  [        R                  " USS95        [        R                  SU SU S	35        U$ 7f)
zt
Signals to the Antigravity Conductor that a browser task is needed.
Genesis will wait for a result file to appear.
task_.jsonpending)idtask	timestampstatus   )indentzTask 'z ' delegated to Antigravity (ID: ))intr   nowr   utcr!   r   	isoformat
write_textjsondumpsloggerinfo)r   r   
request_idrequest_filerequest_datas        r   delegate_task"AntigravityDelegator.delegate_task   s     
 Shll!;!E!E!GHIJ
((j\+?? $!hll3==?	
 	

< BCf-..NzlZ[\] s   C
Cr/   c                     U R                   U S3-  nUR                  5       (       a%   [        R                  " UR	                  5       5      $ g! [
         a%  n[        R                  SU SU 35         SnAgSnAff = f)z*Checks if the delegated task has a result.r   zFailed to read result z: N)r   existsr+   loads	read_text	Exceptionr-   error)r   r/   result_filees       r   check_result!AntigravityDelegator.check_result/   s    &&J<u)==Izz+"7"7"9::   I5j\A3GHHIs   #A 
A=A88A=)r   r   N)__name__
__module____qualname____firstlineno__r   strr2   r   r   r<   __static_attributes__ r   r   r	   r	      s1    <C C ,s x~ r   r	   )__doc__r+   loggingpathlibr   r   r   typingr   r   	getLoggerr-   r   r	   rD   r   r   <module>rJ      sC       ' !			?	@ =>% %r   