+
    5mj 1                        ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHtHtHtHt ]! RR	7       ! R
 R4      4       t ! R R4      tR# )    )annotationsN)	dataclass)Path)Iterator)AccountAccountRegistry)DeviceAuthFlowDeviceAuthPromptDeviceAuthSessionterminate_processT)frozenc                      ] tR t^t$ R]R&   R]R&   RtR]R&   RtR]R&   RtR	]R
&   RtR]R&   Rt	R]R&   Rt
R]R&   RtR]R&   RtR]R&   RtR]R&   RtR# )	FlowEventstrkind	operationNAccount | Noneaccount
str | NonealiaszDeviceAuthSession | NonesessionzDeviceAuthPrompt | Nonepromptzlist[tuple[str, str]] | Noneexisting_accounts	collisionzbool | Noneretry_availablemessagezException | Noneerror )__name__
__module____qualname____firstlineno____annotations__r   r   r   r   r   r   r   r   r   __static_attributes__r       _/home/user/overdeck-private-tests/workstation-ai-broad/modules/systray/device_auth_operation.pyr   r      sk    
IN"G^"E:(,G%,&*F#*6:3: $I~$#'O['GZ"E"r%   r   c                      ] tR t^tR R ltR R ltR R ltR R ltR	R
/R R lltR	R
/R R llt	R	R
/R R llt
R R ltR	R
/R R lltR R ltR R ltR R ltR R lt]R R l4       t]R R  l4       tR!tR
# )"DeviceAuthOperationc               $    V ^8  d   QhRRRRRR/# )   registryr   device_auth_flowr	   returnNoner   )formats   "r&   __annotate__ DeviceAuthOperation.__annotate__   s(     2 2!2 )2 
	2r%   c                	    Wn         W n        R # N)r+   _device_auth_flow)selfr+   r,   s   &&&r&   __init__DeviceAuthOperation.__init__   s    
 !!1r%   c                    V ^8  d   QhRRRR/# r*   r   r   r-   Iterator[FlowEvent]r   )r/   s   "r&   r0   r1   $   s     - -g -*= -r%   c              #  	D   "   V P                  V4       R j  xL
  R #  L5ir3   _run_repairr5   r   s   &&r&   repairDeviceAuthOperation.repair$        ##G,,,     c                    V ^8  d   QhRRRR/# r9   r   )r/   s   "r&   r0   r1   '   s     - -' -.A -r%   c              #  	D   "   V P                  V4       R j  xL
  R #  L5ir3   r<   r>   s   &&r&   
run_repairDeviceAuthOperation.run_repair'   rA   rB   c                    V ^8  d   QhRRRR/# r9   r   )r/   s   "r&   r0   r1   *   s     - -g -2E -r%   c              #  	D   "   V P                  V4       R j  xL
  R #  L5ir3   r<   r>   s   &&r&   repair_account"DeviceAuthOperation.repair_account*   rA   rB   slugNc               $    V ^8  d   QhRRRRRR/# r*   r   r   rK   r   r-   r:   r   )r/   s   "r&   r0   r1   -   s"     3 3 3z 3=P 3r%   c             #  	F   "   V P                  WR 7       Rj  xL
  R#  L5i)rK   N_run_addr5   r   rK   s   &&$r&   addDeviceAuthOperation.add-        ===222   !!c               $    V ^8  d   QhRRRRRR/# rM   r   )r/   s   "r&   r0   r1   0   s"     3 3S 3: 3AT 3r%   c             #  	F   "   V P                  WR 7       Rj  xL
  R#  L5irO   rP   rR   s   &&$r&   run_addDeviceAuthOperation.run_add0   rU   rV   c               $    V ^8  d   QhRRRRRR/# rM   r   )r/   s   "r&   r0   r1   3   s"     3 3 3z 3EX 3r%   c             #  	F   "   V P                  WR 7       Rj  xL
  R#  L5irO   rP   rR   s   &&$r&   add_accountDeviceAuthOperation.add_account3   rU   rV   c                    V ^8  d   QhRRRR/# r9   r   )r/   s   "r&   r0   r1   6   s     }
 }
7 }
/B }
r%   c              #  	  "   R p V P                   P                  VP                  RR7      p\        RRTTR7      x   T P                   P                  T4      p\        RRTTTR7      x   T P                   P                  T4      pT'       d    T P                   P                  TP                  4       T P                  P                  4       TP                  8X  d   T P                  P                  T4       \        RRTTR7      x  \        RRTTR7      x  R # T P                   P!                  TP                  4       \        R	RTTR7      x  \        RRTTRR7      x  R #   \         dL   pT P	                  T4       \        RRTT P                  RTP                   2T4      TR7      x   R p?R # R p?ii ; i  \         dy   pT P	                  T4       T P                  Y!P                  4       \        R	RTTR7      x  \        RRTTT P                  RTP                   2T4      TR
7      x   R p?R # R p?ii ; i  \         dz   pT P	                  T4       T P                  Y!P                  4       \        R	RTTR7      x  \        RRTTT P                  RTP                   2T4      TRR7      x   R p?R # R p?ii ; i  \         dz   pT P	                  T4       T P                  Y!P                  4       \        R	RTTR7      x  \        RRTTT P                  RTP                   2T4      TRR7      x   R p?R # R p?ii ; i5i)NTbackup_existingfailurer?   zRe-authentication failed for )r   r   r   r   r   process_started)r   r   r   r   rollback)r   r   r   r   r   r   prompt_ready)r   r   r   r   r   )r   r   r   r   r   r   r   commitsuccess)r   r   r   r   r   )r4   startaccount_home	Exception_log_exceptionr   _failure_messager   read_prompt_abort_repair_sessionawait_completionrg   r+   default_slugrK   set_defaultre   )r5   r   r   excr   	completeds   &&    r&   r=   DeviceAuthOperation._run_repair6   s    	,,2273G3GY]2^G "	
 	
	++77@F( 
 	
	..??HI* &&--g.B.BC* }}))+w||;))'2"	  "	  ''(<(<=	
 	
  
 	
g  		$"--0Mgmm_.]_bc  		(  	$&&w0D0DE"	  "--0Mgmm_.]_bc  #	:  	$&&w0D0DE"	  "--0Mgmm_.]_bc $  %	.  ##C(**74H4HI#&##	   "&## 114QRYR_R_Q`2acfg$(  %s   M'E( MG M-I M%K 6B2M(F>3A F93M9F>>MIA-H?9M?IMKA.K MKMMA.MMMMc               $    V ^8  d   QhRRRRRR/# rM   r   )r/   s   "r&   r0   r1      s'     ^
 ^
c ^
J ^
BU ^
r%   c             #  	r  "   V P                  4       p Vf   V P                  P                  V4      pMV P                  P                  V4      pV P                  P	                  W!4      pT P                  T4      p T P                  P                  TRR7      p\        RRTTTR7      x   T P                  P                  T4      p\        RRTTTTTR7      x   T P                  P!                  T4      p	T	'       gG   T P                  P                  T4       \        RRTTTR	T 2R7      x  \        RRTTTRR7      x  R # T P#                  T4      p
T
eB   T P                  P                  T4       \        RRTTTT
RT RT
P$                   2R7      x  R # \        RRTTTR7      x  R #   \
         dD   pT P                  T4       \        RRTT P                  RT R2T4      TRR7      x   R p?R # R p?ii ; i  \
         dv   pT P                  T4       T P                  P                  T4       \        RRTTR	T 2TR
7      x  \        RRTTT P                  RT R2T4      TRR7      x   R p?R # R p?ii ; i  \
         d   pT P                  T4       \        TP                  4       T P                  P                  T4       \        RRTTTR	T 2TR7      x  \        RRTTTT P                  RT R2T4      TRR7      x   R p?R # R p?ii ; i  \
         d   pT P                  T4       \        TP                  4       T P                  P                  T4       \        RRTTTR	T 2TR7      x  \        RRTTTT P                  RT R2T4      TRR7      x   R p?R # R p?ii ; i5i)Nrc   rS   zAdding account z failedF)r   r   r   r   r   r   ra   re   zRemoved new account )r   r   r   r   r   r   )r   r   r   r   r   r   r   rd   )r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   rf   )r   r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   r   z  collided with existing account )r   r   r   r   r   r   r   rh   )_existing_accounts_for_addr+   new_slugnormalize_slugadd_dirrk   rl   r   rm   _account_by_slugr4   ri   removern   r   processrp   _find_collisionr   )r5   r   rK   r   
codex_homers   r   r   r   rt   r   s   &&$        r&   rQ   DeviceAuthOperation._run_add   s.     ;;=	|}}--e4}}33D9..t;J ''-	,,22:u2UG. "
 	
	++77@F4 /
 	
	..??HI4 MM  &.ug6   %  ((1	 MM  & #)%0PQZQ`Q`Pab  
 	
a  
	$--wg.NPST %  
	   	$MM  &.ug6  --wg.NPST %  )	@  	$goo.MM  &.ug6  --wg.NPST %	 	 /	J  	$goo.MM  &.ug6  --wg.NPST %	 	 /	s   N7AF/ *N7<H  N7,J N7L 7N7?B0N7/G=:8G82N78G==N7 J A*I;5N7;J  N7LBLN7LN7N4(BN/)N7/N44N7c                   V ^8  d   QhRR/# )r*   r-   zlist[tuple[str, str]]r   )r/   s   "r&   r0   r1   U  s     
 
,A 
r%   c                	    V P                   P                  4        Uu. uF+  pVP                  f   K  VP                  VP                  3NK-  	  up# u upi r3   )r+   listemailr   r>   s   & r&   rx   .DeviceAuthOperation._existing_accounts_for_addU  sL      ==--/
/}} +W]]GMM*/
 	
 
s
   AAc                    V ^8  d   QhRRRR/# )r*   new_accountr   r-   r   )r/   s   "r&   r0   r1   \  s      > n r%   c                	    Ve   VP                   '       g   R # V P                  P                  4        F?  pVP                  VP                  8X  d   K   VP                   VP                   8X  g   K=  Vu # 	  R # r3   )
account_idr+   r   rK   )r5   r   r   s   && r&   r   #DeviceAuthOperation._find_collision\  s`    k&<&<&<}}))+G||{///!![%;%;;	 ,
 r%   c                    V ^8  d   QhRRRR/# )r*   rK   r   r-   r   r   )r/   s   "r&   r0   r1   f  s      S ^ r%   c                	r    V P                   P                  4        F  pVP                  V8X  g   K  Vu # 	  R # r3   )r+   r   rK   )r5   rK   r   s   && r&   r|   $DeviceAuthOperation._account_by_slugf  s/    }}))+G||t# , r%   c               $    V ^8  d   QhRRRRRR/# )r*   r   r   r   r   r-   r.   r   )r/   s   "r&   r0   r1   l  s#     	4 	4-> 	4D 	4UY 	4r%   c                	   \        V P                  R R4      p\        V4      '       d    V! W4       R# \        VP                  4       V P                  P                  V4       R#   \         d   pT P	                  T4        Rp?LSRp?ii ; i)abortN)getattrr4   callablerk   rl   r   r~   re   )r5   r   r   r   rs   s   &&&  r&   ro   )DeviceAuthOperation._abort_repair_sessionl  st    ..>E??)g* 	'//*''
3  )##C(()s   A& &B1BBc               $    V ^8  d   QhRRRRRR/# )r*   prefixr   rs   rk   r-   r   )r/   s   "r&   r0   r1   x  s!     % % %9 % %r%   c                	:    \        V4      pV'       g   V # V  R V 2# )z: )r   )r   rs   details   && r&   rm   $DeviceAuthOperation._failure_messagew  s$    SMF8$$r%   c                    V ^8  d   QhRRRR/# )r*   rs   rk   r-   r.   r   )r/   s   "r&   r0   r1     s     E EI E$ Er%   c                	Z    \         P                  ! \        V 4      W P                  4       R # r3   )	tracebackprint_exceptiontype__traceback__)rs   s   &r&   rl   "DeviceAuthOperation._log_exception~  s    !!$s)S2C2CDr%   )r4   r+   )r   r    r!   r"   r6   r?   rE   rI   rS   rY   r]   r=   rQ   rx   r   r|   ro   staticmethodrm   rl   r$   r   r%   r&   r(   r(      s    2---3D 33 33D 3}
~^
 ^
@
	4 % % E Er%   r(   )
__future__r   r   dataclassesr   pathlibr   typingr   account_registryr   r   device_authr	   r
   r   r   r   r(   r   r%   r&   <module>r      sI    "  !   5 ^ ^ $# # #eE eEr%   