§
    s�’jy  ã                  óŠ  — d Z ddlmZ ddlmZmZ ddlmZmZm	Z	  G d„ de¦  «        Z
 G d„ de¦  «        Z G d	„ d
e¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        ZdS )z2Pydantic schemas for desktop automation workflows.é    )Úannotations)ÚAnyÚLiteral)Ú	BaseModelÚFieldÚmodel_validatorc                  ó>   — e Zd ZU dZdZded<   dZded<   dZded<   d	S )
ÚDesktopHealthResponsez3Health response for desktop automation integration.ÚokÚstrÚstatusÚdesktop_automationÚserviceÚmcp_macos_desktopÚbackendN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   © ó    ú;C:\Projects\DSCons\app\models\desktop_automation_schemas.pyr
   r
   
   sK   € € € € € € Ø=Ð=à€FÐÐÐÑØ'€GÐ'Ð'Ð'Ñ'Ø&€GÐ&Ð&Ð&Ñ&Ð&Ð&r   r
   c                  óR   — e Zd ZU dZdZded<   dZded<    ee¬¦  «        Z	ded<   dS )	ÚActionEnvelopeErrorz;Structured error content aligned with MCP action envelopes.Nú
str | NoneÚcodeÚmessage©Údefault_factoryúdict[str, Any]Údetails)
r   r   r   r   r   r   r   r   Údictr"   r   r   r   r   r      sX   € € € € € € ØEÐEà€DÐÐÐÑØ€GÐÐÐÑØ#˜e°DÐ9Ñ9Ô9€GÐ9Ð9Ð9Ñ9Ð9Ð9r   r   c                  ó¤   — e Zd ZU dZdZded<   ded<   dZded	<    ee¬
¦  «        Z	ded<    ee¬
¦  «        Z
ded<   dZded<   edd„¦   «         ZdS )ÚDesktopActionResponsezHGeneric desktop action response aligned with the shared action envelope.TÚboolr   r   ÚactionNr   Ú	timestampr   r!   ÚdataÚ	artifactszActionEnvelopeError | NoneÚerrorÚresultÚreturnc           
     óH  —  | t          |                     dd¦  «        ¦  «        t          |                     dd¦  «        ¦  «        |                     d¦  «        |                     d¦  «        pi |                     d¦  «        pi |                     d¦  «        ¬	¦  «        S )
z@Build a response model from adapter/service result dictionaries.r   Tr'   Údesktop_actionr(   r)   r*   r+   )r   r'   r(   r)   r*   r+   )r&   Úgetr   )Úclsr,   s     r   Úfrom_adapter_resultz)DesktopActionResponse.from_adapter_result$   s–   € ð ˆsÝ�F—J’J˜t TÑ*Ô*Ñ+Ô+Ý�v—z’z (Ð,<Ñ=Ô=Ñ>Ô>Ø—j’j Ñ-Ô-Ø—’˜FÑ#Ô#Ð) rØ—j’j Ñ-Ô-Ð3°Ø—*’*˜WÑ%Ô%ð
ñ 
ô 
ð 	
r   )r,   r!   r-   r%   )r   r   r   r   r   r   r(   r   r#   r)   r*   r+   Úclassmethodr2   r   r   r   r%   r%      s®   € € € € € € ØRÐRà€B€O€O€O�OØ€K€K�KØ €IÐ Ð Ð Ñ Ø ˜5°Ð6Ñ6Ô6€DÐ6Ð6Ð6Ñ6Ø % °dÐ ;Ñ ;Ô ;€IÐ;Ð;Ð;Ñ;Ø(,€EÐ,Ð,Ð,Ñ,àð	
ð 	
ð 	
ñ „[ð	
ð 	
ð 	
r   r%   c                  ó¤   — e Zd ZU dZ edd¬¦  «        Zded<    edd¬¦  «        Zded<    edd¬¦  «        Zded	<    edd¬¦  «        Z	ded
<   dS )ÚScreenRegionz2Optional rectangular region for screen operations..r   )ÚgeÚintÚxÚy)ÚgtÚwidthÚheightN)
r   r   r   r   r   r8   r   r9   r;   r<   r   r   r   r5   r5   1   s˜   € € € € € € Ø<Ð<àˆU�3˜1ÐÑÔ€AÐÐÐÑØˆU�3˜1ÐÑÔ€AÐÐÐÑØ��s˜qÐ!Ñ!Ô!€EÐ!Ð!Ð!Ñ!Ø�%˜ Ð"Ñ"Ô"€FÐ"Ð"Ð"Ñ"Ð"Ð"r   r5   c                  ó  — e Zd ZU dZded<    edd¬¦  «        Zded<    ed	d
¬¦  «        Zded<   dZded<   dZ	ded<   dZ
ded<    edd¬¦  «        Zded<    edd¬¦  «        Zded<    ed¬¦  «        dd„¦   «         ZdS )ÚZaloSendRequestz6Request to send a message via Zalo desktop automation.ú!Literal['contact', 'my_document']Útarget_typeNz"Required when target_type=contact.©ÚdefaultÚdescriptionr   Útarget_name.é   ©Ú
min_lengthr   r   Tr&   Úverify_before_sendÚpress_enterÚcapture_evidencez!Optional business label for logs.Úmessage_labelú)Optional caller-defined trace identifier.Úworkflow_idÚafter©Úmoder-   c                óH   — | j         dk    r| j        st          d¦  «        ‚| S ©z5Require a contact name when targeting a contact chat.Úcontactz3target_name is required when target_type='contact'.©r@   rD   Ú
ValueError©Úselfs    r   Úvalidate_target_namez$ZaloSendRequest.validate_target_nameL   ó.   € ð Ô˜yÒ(Ð(°Ô1AÐ(ÝÐRÑSÔSÐSØˆr   )r-   r>   )r   r   r   r   r   r   rD   r   rH   rI   rJ   rK   rM   r   rX   r   r   r   r>   r>   :   s?  € € € € € € Ø@Ð@à2Ð2Ð2Ñ2Ø#˜eØÐ"Fðñ ô €Kð ð ð ñ ð �5˜¨Ð+Ñ+Ô+€GÐ+Ð+Ð+Ñ+Ø#ÐÐ#Ð#Ð#Ñ#Ø€KÐÐÐÑØ!ÐÐ!Ð!Ð!Ñ!Ø % ØÐ"Eð!ñ !ô !€Mð ð ð ñ ð $˜eØÐ"Mðñ ô €Kð ð ð ñ ð €_˜'Ð"Ñ"Ô"ðð ð ñ #Ô"ðð ð r   r>   c                  óp   — e Zd ZU dZ edd¬¦  «        Zded<   dZded	<   dZded
<   dZ	ded<   dZ
ded<   dS )ÚZaloVerifyChatRequestz1Request to verify the currently active Zalo chat..rE   rF   r   rD   Tr&   Úallow_partial_matchrJ   FÚuse_screen_ocrNúScreenRegion | NoneÚregion)r   r   r   r   r   rD   r   r\   rJ   r]   r_   r   r   r   r[   r[   T   s~   € € € € € € Ø;Ð;à�u˜S¨QÐ/Ñ/Ô/€KÐ/Ð/Ð/Ñ/Ø $ÐÐ$Ð$Ð$Ñ$Ø!ÐÐ!Ð!Ð!Ñ!Ø €NÐ Ð Ð Ñ Ø"&€FÐ&Ð&Ð&Ñ&Ð&Ð&r   r[   c                  óD  — e Zd ZU dZ edd¬¦  «        Zded<    edd¬¦  «        Zded<    edd¬¦  «        Zded<    ed	¬
¦  «        Z	ded<    ed¬
¦  «        Z
ded<   dZded<    edd¬¦  «        Zded<   dZded<   dZded<   dZded<    edd¬¦  «        Zded<   dS )ÚZaloDownloadLatestFileRequestzIRequest to download the latest file from a Zalo chat to a project folder..rE   rF   r   rD   Úproject_codeÚproject_pathúincoming/zalo©rB   Ú	subfolderú/Users/pain/DownloadsÚdownload_dirNr   Ú	rename_toç      N@r   ©rB   r:   ÚfloatÚtimeout_secondsTr&   r\   Úverify_before_downloadrJ   rL   rA   rM   ©r   r   r   r   r   rD   r   rb   rc   rf   rh   ri   rm   r\   rn   rJ   rM   r   r   r   ra   ra   ^   sP  € € € € € € ØSÐSà�u˜S¨QÐ/Ñ/Ô/€KÐ/Ð/Ð/Ñ/Ø˜˜c¨aÐ0Ñ0Ô0€LÐ0Ð0Ð0Ñ0Ø˜˜c¨aÐ0Ñ0Ô0€LÐ0Ð0Ð0Ñ0Ø�U ?Ð3Ñ3Ô3€IÐ3Ð3Ð3Ñ3Ø˜Ð&=Ð>Ñ>Ô>€LÐ>Ð>Ð>Ñ>Ø €IÐ Ð Ð Ñ Ø"˜U¨4°AÐ6Ñ6Ô6€OÐ6Ð6Ð6Ñ6Ø $ÐÐ$Ð$Ð$Ñ$Ø#'ÐÐ'Ð'Ð'Ñ'Ø!ÐÐ!Ð!Ð!Ñ!Ø#˜eØÐ"Mðñ ô €Kð ð ð ñ ð ð r   ra   c                  óp   — e Zd ZU dZ edd¬¦  «        Zded<   dZded	<   dZded
<   dZ	ded<   dZ
ded<   dS )ÚDesktopPressKeysRequestzBRequest for pressing one or more keys through the desktop adapter..rE   rF   z	list[str]ÚkeysNr   Úapp_nameÚ	bundle_idÚtarget_descriptionFr&   rJ   )r   r   r   r   r   rr   r   rs   rt   ru   rJ   r   r   r   rq   rq   p   s~   € € € € € € ØLÐLà�e˜C¨AÐ.Ñ.Ô.€DÐ.Ð.Ð.Ñ.Ø€HÐÐÐÑØ €IÐ Ð Ð Ñ Ø%)ÐÐ)Ð)Ð)Ñ)Ø"ÐÐ"Ð"Ð"Ñ"Ð"Ð"r   rq   c                  óŒ   — e Zd ZU dZ edd¬¦  «        Zded<   dZded	<   dZded
<   dZ	ded<   dZ
ded<   dZded<   dZded<   dS )ÚDesktopTypeTextRequestz8Request for typing text into the active desktop control..rE   rF   r   ÚtextNr   rs   rt   Fr&   Úclear_firstrI   ru   rJ   )r   r   r   r   r   rx   r   rs   rt   ry   rI   ru   rJ   r   r   r   rw   rw   z   s    € € € € € € ØBÐBà��c aÐ(Ñ(Ô(€DÐ(Ð(Ð(Ñ(Ø€HÐÐÐÑØ €IÐ Ð Ð Ñ Ø€KÐÐÐÑØ€KÐÐÐÑØ%)ÐÐ)Ð)Ð)Ñ)Ø"ÐÐ"Ð"Ð"Ñ"Ð"Ð"r   rw   c                  óp   — e Zd ZU dZdZded<   dZded<    edd¬¦  «        Zded	<   d
Z	ded<   d
Z
ded<   dS )ÚScreenReadTextRequestzHRequest for OCR-style text extraction from the current screen or region.Nr^   r_   r   Úexpected_containszFuture OCR language hint.rA   Úlanguage_hintTr&   Úcapture_screenshot_firstÚinclude_artifacts)r   r   r   r   r_   r   r|   r   r}   r~   r   r   r   r   r{   r{   †   s‘   € € € € € € ØRÐRà"&€FÐ&Ð&Ð&Ñ&Ø$(ÐÐ(Ð(Ð(Ñ(Ø % ØÐ"=ð!ñ !ô !€Mð ð ð ñ ð &*ÐÐ)Ð)Ð)Ñ)Ø"ÐÐ"Ð"Ð"Ñ"Ð"Ð"r   r{   c                  ó´   — e Zd ZU dZded<   dZded<    edd¬	¦  «        Zd
ed<   dZded<   dZ	ded<   dZ
ded<   dZded<    ed¬¦  «        dd„¦   «         ZdS )ÚZaloSendWorkflowRequestzBHigh-level send workflow contract for service-layer orchestration.r?   r@   Nr   rD   .rE   rF   r   r   Tr&   rH   rI   rJ   rM   rN   rO   r-   c                óH   — | j         dk    r| j        st          d¦  «        ‚| S rR   rT   rV   s    r   rX   z,ZaloSendWorkflowRequest.validate_target_name�   rY   r   )r-   r�   )r   r   r   r   r   rD   r   r   rH   rI   rJ   rM   r   rX   r   r   r   r�   r�   ’   sË   € € € € € € ØLÐLà2Ð2Ð2Ñ2Ø"€KÐ"Ð"Ð"Ñ"Ø�5˜¨Ð+Ñ+Ô+€GÐ+Ð+Ð+Ñ+Ø#ÐÐ#Ð#Ð#Ñ#Ø€KÐÐÐÑØ!ÐÐ!Ð!Ð!Ñ!Ø"€KÐ"Ð"Ð"Ñ"à€_˜'Ð"Ñ"Ô"ðð ð ñ #Ô"ðð ð r   r�   c                  ó.  — e Zd ZU dZ edd¬¦  «        Zded<    edd¬¦  «        Zded<    edd¬¦  «        Zded<    ed	¬
¦  «        Z	ded<    ed¬
¦  «        Z
ded<   dZded<    edd¬¦  «        Zded<   dZded<   dZded<   dZded<   dZded<   dS )ÚZaloIncomingFileWorkflowRequestzBHigh-level contract for verified file collection from a Zalo chat..rE   rF   r   rD   rb   rc   rd   re   rf   rg   rh   Nr   ri   rj   r   rk   rl   rm   Tr&   r\   rn   rJ   rM   ro   r   r   r   r„   r„   ¥   s-  € € € € € € ØLÐLà�u˜S¨QÐ/Ñ/Ô/€KÐ/Ð/Ð/Ñ/Ø˜˜c¨aÐ0Ñ0Ô0€LÐ0Ð0Ð0Ñ0Ø˜˜c¨aÐ0Ñ0Ô0€LÐ0Ð0Ð0Ñ0Ø�U ?Ð3Ñ3Ô3€IÐ3Ð3Ð3Ñ3Ø˜Ð&=Ð>Ñ>Ô>€LÐ>Ð>Ð>Ñ>Ø €IÐ Ð Ð Ñ Ø"˜U¨4°AÐ6Ñ6Ô6€OÐ6Ð6Ð6Ñ6Ø $ÐÐ$Ð$Ð$Ñ$Ø#'ÐÐ'Ð'Ð'Ñ'Ø!ÐÐ!Ð!Ð!Ñ!Ø"€KÐ"Ð"Ð"Ñ"Ð"Ð"r   r„   N)r   Ú
__future__r   Útypingr   r   Úpydanticr   r   r   r
   r   r%   r5   r>   r[   ra   rq   rw   r{   r�   r„   r   r   r   ú<module>rˆ      sU  ðØ 8Ð 8à "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ð Ð à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6ð'ð 'ð 'ð 'ð '˜Iñ 'ô 'ð 'ð:ð :ð :ð :ð :˜)ñ :ô :ð :ð
ð 
ð 
ð 
ð 
˜Iñ 
ô 
ð 
ð.#ð #ð #ð #ð #�9ñ #ô #ð #ðð ð ð ð �iñ ô ð ð4'ð 'ð 'ð 'ð '˜Iñ 'ô 'ð 'ðð ð ð ð  Iñ ô ð ð$#ð #ð #ð #ð #˜iñ #ô #ð #ð	#ð 	#ð 	#ð 	#ð 	#˜Yñ 	#ô 	#ð 	#ð	#ð 	#ð 	#ð 	#ð 	#˜Iñ 	#ô 	#ð 	#ðð ð ð ð ˜iñ ô ð ð&#ð #ð #ð #ð # iñ #ô #ð #ð #ð #r   