+
    jHàjÛs  ã                  óz  a€ 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHtHtHt ]P,                  ! R4      tRow  ttttttR	t]! ]]04      t R
t!Rt"Rt#Rpt$Rqt%Rrt&Rsw  t't(t)t*t+]! 0 Rtm4      t,RRRRRR/t-R](R](/], U u/ uF  q ]*bK  	  up Ct.]P^                  ! 4       t0]P^                  ! 4       t1]P^                  ! 4       t2]Pf                  t4] ! R R4      4       t5R R lt6R R lt7R R lt8R R lt9R  R! lt:]
R" R# l4       t;R$R%/R& R' llt<R( R) lt=R* R+ lt>R, R- lt?R. R/ lt@R0 R1 ltAR2 R3 ltB]
R4 R5 l4       tCR6 R7 ltDR8 R9 ltER: R; ltFR< R= ltGR> R? ltHRtIRtJ]P–                  ! 4       tL]Pš                  ! 4       tNRsOR@]PRA&   RB RC ltQRuRD RE lltRRF RG ltSRH RI ltT]
RJ RK l4       tURL]"/RM RN lltVRO RP ltWRQ RR ltXRS RT ltYRU RV ltZRW RX lt[RY RZ lt\R[ R\ lt]R] R^ lt^R_ R` lt_Ra Rb lt`Rc Rd ltaRe Rf ltbRg Rh ltcRi Rj ltdRk Rl lteRm Rn ltfR# u up i )va  Guest handoff: after a Nous account replaces the free tier, move the free tier's apps into it.

The account service moves a free-tier identity's connected apps (and its preview cohort) into a
signed-in account with one call, ``POST /api/anonymous/claim {"token": "<anon_...>"}``, authorized by
the account's own ``hermes-cli`` Bearer token. Hermes never asks first: the move just happens after
the account is saved, and the result (the account email, what moved, what needs reconnecting) is
shown afterwards. Sign-in code knows nothing about this; two halves keep it that way:

- :func:`note_replacement` runs at the lowest write seams (``auth._store_provider_state`` and
  ``auth_nous._write_shared_nous_state``), under the caller's auth-store locks, whenever a non-guest
  Nous state replaces a guest. It writes a pending record and does no network. Records sit beside
  the shared Nous store, keyed by a hash of the ``anon_`` credential and bound to the destination
  account, so profiles that share one free-tier identity share one record and one claim.
- :func:`drain` runs the claim outside every lock: when a shared-store write finishes, when a
  :func:`deferred` block exits, after a free-tier reconcile, and on each Nous keepalive tick (a
  retry left by an earlier process). The synchronous run is bounded (``SYNC_BUDGET_SECONDS``) so a
  CLI or the desktop sees a result; what is still retrying resumes on a later run.

The apps only ever go to the record's destination: every attempt is reserved in one locked
read-modify-write that also proves the Bearer about to be sent belongs to that destination.

User copy never says guest / anonymous / claim.
)ÚannotationsN)Úcontextmanager)Ú	dataclassÚfield)ÚUTCÚdatetime)ÚPath)ÚAnyÚIteratorÚOptionalzhermes_cli.authÚpausedzguest_handoff.jsong      $@ç      .@ç      N@Úclient_not_allowedÚaccount_lockedÚretry_window_endedzKThis sign-in can't receive them. Sign in again with `hermes auth add nous`.zThis Nous account is locked.z6Hermes kept trying for nearly two weeks, then stopped.Úunknown_tokenÚalready_retiredc                  óN   € ] tR t^Mt$ Rt]! ]R7      tR]R&   ]	R R l4       t
RtR# )	ÚHandoffBatchzBWhat one :func:`drain` did: the public view of each record it ran.)Údefault_factoryúlist[dict[str, Any]]Úresultsc               ó   € V ^8„  d   QhRR/# )é   ÚreturnúOptional[str]© )Úformats   "Ú=/home/ubuntu/.hermes/hermes-agent/hermes_cli/guest_handoff.pyÚ__annotate__ÚHandoffBatch.__annotate__T   s   € ÷ `ñ `˜}ñ `ó    c                	ó<   € \        R  V P                   4       R4      # )c              3  ód   "  € T F&  qP                  R 4      '       g   K  VR ,          x € K(  	  R# 5i)Úaccount_emailN©Úget)Ú.0Úrs   & r   Ú	<genexpr>Ú-HandoffBatch.account_email.<locals>.<genexpr>U   s$   é € ÐX±¨AÇÁÀ×AWÔ'�Q�×'Ò'³ùs   ‚0Ÿ0N)Únextr   )Úselfs   &r   r%   ÚHandoffBatch.account_emailS   s   € äÑX°·²ÓXÐZ^Ó_Ð_r"   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úlistr   Ú__annotations__Úpropertyr%   Ú__static_attributes__r   r"   r   r   r   M   s)   ‡ áLá$)¸$Ô$?€GÐ!Ó?àô`ó ô`r"   r   c               ó   € V ^8„  d   QhRR/# )r   r   Úfloatr   )r   s   "r   r    r    X   s   € ÷ ñ ˆeñ r"   c                 ó,   € \         P                   ! 4       # ©N)Útimer   r"   r   Ú_nowr=   X   s   € Ü�9Š9‹;Ðr"   c               ó    € V ^8„  d   QhRRRR/# )r   Úepochr9   r   Ústrr   )r   s   "r   r    r    \   s   € ÷ =ñ =�ð =˜#ñ =r"   c                óV   € \         P                  ! V \        R 7      P                  4       # ))Útz)r   Úfromtimestampr   Ú	isoformat)r?   s   &r   Ú_isorE   \   s   € Ü×!Ò! %¬CÔ0×:Ñ:Ó<Ð<r"   c               ó    € V ^8„  d   QhRRRR/# )r   Ú
anon_tokenr@   r   r   )r   s   "r   r    r    `   s   € ÷ Gñ G˜3ð G 3ñ Gr"   c                óv   € \         P                  ! V P                  R 4      4      P                  4       R,          # )zutf-8:Né    N)ÚhashlibÚsha256ÚencodeÚ	hexdigest)rG   s   &r   Ú
_token_keyrN   `   s*   € Ü�>Š>˜*×+Ñ+¨GÓ4Ó5×?Ñ?ÓAÀ#ÕFÐFr"   c               ó   € V ^8„  d   QhRR/# )r   r   r@   r   )r   s   "r   r    r    d   s   € ÷ ñ �3ñ r"   c                 ó   € ^ RI Hp  V ! 4       # )é    ©Úhermes_home_key)Úhermes_constantsrS   rR   s    r   Ú	_home_keyrU   d   s   € Ý0ÙÓÐr"   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r    r    i   s   € ÷ Añ A�tñ Ar"   c                 óB   € ^ RI Hp  V ! 4       P                  \        4      # )rQ   ©Ú_nous_shared_store_path)Úhermes_cli.auth_nousrY   Ú	with_nameÚHANDOFF_FILENAMErX   s    r   Ú_records_pathr]   i   s   € Ý<Ù"Ó$×.Ñ.Ô/?Ó@Ð@r"   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   Úpathr   Úholderzthreading.localÚtimeout_secondsr9   r   úIterator[None]r   )r   s   "r   r    r    o   s(   € ÷ ñ �ð ˜oð Àð È.ñ r"   c              #  óš   "  € ^ RI Hp V! WVRV P                   24      ;_uu_ 4        Rx € RRR4       R#   + '       g   i     R# ; i5i)rQ   )Ú
_file_lockzTimed out waiting for N)Úhermes_cli.authrd   Úname)r_   r`   ra   rd   s   &&& r   Ú_lockrg   n   s5   é € å*Ù	�D /Ð5KÈDÏIÉIÈ;Ð3W×	XÕ	XÛ÷ 
Y×	X×	XÒ	Xüs   ‚&A¨7­
A·A	Á	AÚhealFc               ó$   € V ^8„  d   QhRRRRRR/# )r   r_   r   rh   Úboolr   údict[str, Any]r   )r   s   "r   r    r    u   s&   € ÷ Sñ S�ð S˜tð S°ñ Sr"   c               ó´  €  \         P                  ! V P                  RR7      4      p\        V\        4      '       d   VP                  R4      MRpR	^R\        V\        4      '       d   V/# / /#   \         d    / p LW\         dO    \
        P                  RT T'       d   RMR4       T'       d!   T P                  T P                  R4      4       / p L®i ; i)
z¾The records file. An unparseable one reads as empty; *heal* (writers, under the records lock)
moves it aside to ``.corrupt`` first, so a bad file neither blocks a sign-in nor loses its data.z	utf-8-sig)Úencodingz0Free-tier handoff records at %s are unreadable%sz; moved aside to .corruptÚ z.json.corruptÚrecordsNÚ_schema)ÚjsonÚloadsÚ	read_textÚFileNotFoundErrorÚ
ValueErrorÚloggerÚwarningÚreplaceÚwith_suffixÚ
isinstanceÚdictr'   )r_   rh   Údataro   s   &$  r   Ú_loadr}   u   s¸   € ð	Ü�zŠz˜$Ÿ.™.°+˜.Ó>Ó?ˆô &0°´d×%;Ò%;ˆd�h‰h�yÔ!À€GØ�q˜)´
¸7ÄD×0IÒ0I WÐRÐRÈrÐRÐRøô ô ØŠÜô Ü�‰ÐIÈ4ß6:Ñ2Àô	DçØ�L‰L˜×)Ñ)¨/Ó:Ô;ØŠðús)   ‚&A0 Á0CÁ?CÂCÂ"CÂ2"CÃCc               ó$   € V ^8„  d   QhRRRRRR/# )r   r_   r   r|   rk   r   ÚNoner   )r   s   "r   r    r    †   s!   € ÷ 3ñ 3�ð 3˜Nð 3¨tñ 3r"   c                ó&   € ^ RI Hp V! WRR7       R# )rQ   )Ú_save_private_jsonT)Ú	sort_keysN)re   r�   )r_   r|   r�   s   && r   Ú_saverƒ   †   s   € Ý2Ù�t¨T×2r"   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r_   r   Úkeyr@   r   úOptional[dict[str, Any]]r   )r   s   "r   r    r    ‹   s"   € ÷ ñ �$ð ˜Sð Ð-Eñ r"   c                óJ  € \        V P                  R4      \        R4      ;_uu_ 4        \        V RR7      pV! VR,          P	                  V4      4      pVe-   \        \        4       4      VR&   WCR,          V&   \        W4       VuuRRR4       #   + '       g   i     R# ; i)zëApply *change(record) -> record | None* to one record under the records lock and return what
was written (None: nothing written). The innermost lock: the hook takes it under the auth-store
locks, and it never holds another lock itself.z.lockr   T)rh   ro   NÚ
updated_at)rg   ry   Ú_records_lock_holderr}   r'   rE   r=   rƒ   )r_   r…   Úchanger|   Úrecords   &&&  r   Ú_updaterŒ   ‹   s�   € ô 
ˆt×Ñ Ó(Ô*>À×	EÕ	EÜ�T Ô%ˆÙ˜˜Y�×+Ñ+¨CÓ0Ó1ˆØÒÜ#'¬«£<ˆF�<Ñ Ø#)��O˜CÑ Ü�$ÔØ÷ 
F×	E×	EÓ	Eús   ©ABÂB"	c               ó    € V ^8„  d   QhRRRR/# )r   Úaccess_tokenr	   r   r   r   )r   s   "r   r    r    ™   s   € ÷ %ñ %˜3ð % =ñ %r"   c                óf   € ^ RI Hp V! V 4      P                  R4      pV'       d   \        V4      # R# )rQ   )Ú_decode_jwt_claimsÚsubN)Úhermes_cli.auth_constantsr�   r'   r@   )rŽ   r�   r‘   s   &  r   Ú_subjectr“   ™   s+   € Ý<Ù
˜\Ó
*×
.Ñ
.¨uÓ
5€CßŒ3ˆs‹8Ð$ Ð$r"   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   Ú
auth_storerk   Úprovider_idr@   Ústater	   r   r   r   )r   s   "r   r    r    ¡   s/   € ÷ Jñ J ð J¸cð JÈ#ð JÐRVñ Jr"   c                óJ   € VR8X  d   ^ RI Hp \        V! V R4      V4       R# R# )zš``auth._store_provider_state``'s hook: the Nous state the store holds now is the one replaced
(the profile's own, else the root store's it falls back to).Únous)Ú_load_provider_stateN)re   rš   Únote_replacement)r•   r–   r—   rš   s   &&& r   Únote_store_writerœ   ¡   s&   € ð �fÔÝ8ÜÑ-¨j¸&ÓAÀ5ÖIñ r"   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úpreviousr	   Únewr   r   r   )r   s   "r   r    r    ©   s!   € ÷ ,ñ ,˜sð ,¨ð ,°ñ ,r"   c                ó  aaa€ ^ RI Hp V! V 4      '       d%   V! V4      '       g   \        V\        4      '       g   R# V P	                  R4      \        VP	                  R4      4      uoo\        S\        4      '       d   S'       d	   S'       g   R#  \        4       p\        4       oR TTT3R llp\        T\        S4      T4      p\        P                  RTR,          \        S4      R	,          4       R#   \         d     R# i ; i)
aD  Record that a non-guest Nous state replaced the guest *previous*. Called from the lowest write
seams; idempotent per ``anon_`` credential. A Claimed or Gone record is never reopened; a record
not yet attempted follows the newest destination, one already attempted keeps its own (a lost
answer may have moved the apps there).©Úis_guest_stateNrG   rŽ   c               ó    € V ^8„  d   QhRRRR/# )r   r‹   r†   r   rk   r   )r   s   "r   r    Ú&note_replacement.<locals>.__annotate__º   s   € ÷ ñ Ð/ð °Nñ r"   c                ó   <€ V f%   R\         RSRSR^ R. R\        \        4       4      /p M.V R,          \        9   d   V P	                  R4      '       g   SV R&   SV R,          9  d   V R,          P                  S4       V # )Nr—   rG   ÚdestinationÚattemptsÚprofilesÚ
created_at)ÚPENDINGrE   r=   Ú_ACTIVEr'   Úappend)r‹   rG   r¦   Úhomes   &€€€r   rŠ   Ú note_replacement.<locals>.changeº   sz   ø€ ØŠ>Øœw¨°jÀ-ÐQ\Ø  ! Z°°\Ä4ÌËÃ<ðQ‰Fà�G�_¤Ô'°·
±
¸:×0FÒ0FØ$/ˆF�=Ñ!Ø�v˜jÕ)Ô)Ø�:Õ×%Ñ% dÔ+Øˆr"   z4Nous sign-in replaced the free tier; handoff %s (%s)r—   ºNé   N)Úhermes_cli.anon_authr¢   rz   r{   r'   r“   r@   r]   ÚRuntimeErrorrU   rŒ   rN   rv   Úinfo)	rž   rŸ   r¢   r_   rŠ   r‹   rG   r¦   r­   s	   &&    @@@r   r›   r›   ©   sÎ   ú€ õ
 4Ù˜(×#Ò#¡~°c×':Ò':Ä*ÈSÔRV×BWÒBWÙØ&Ÿl™l¨<Ó8¼(À3Ç7Á7È>ÓCZÓ:[Ð€J�Ü�j¤#×&Ò&¯jÇÙðÜ‹ˆô ‹;€D÷ò ô �Tœ: jÓ1°6Ó:€FÜ
‡K�KÐFÈÈwÍÜ˜:Ó& rÕ*ö,øô ô Úðús   Â
C8 Ã8DÄDc               ó   € V ^8„  d   QhRR/# )r   r   rj   r   )r   s   "r   r    r    Ë   s   € ÷ Bñ B˜4ñ Br"   c                 ó^  € ^ RI Hp Hp \        VP                  R^ 4      '       d   R# V P
                  ;_uu_ 4        \        V P                  P                  4       4      pRRR4       \        ;QJ d    R X 4       F  '       g   K   R# 	  R# ! R X 4       4      #   + '       g   i     LD; i)rQ   )ÚauthÚ	auth_nousÚdepthTNc              3  ó<   "  € T F  p\        VR ^ 4      x € K  	  R# 5i)r¸   N)Úgetattr)r(   r`   s   & r   r*   Ú$_holds_auth_locks.<locals>.<genexpr>Ñ   s   é € ÐA¹¨vŒw�v˜w¨×*Ð*»ùs   ‚F)
Ú
hermes_clir¶   r·   rº   Ú_nous_shared_lock_holderÚ_auth_target_lock_holders_guardr4   Ú_auth_target_lock_holdersÚvaluesÚany)r¶   r·   Úholderss      r   Ú_holds_auth_locksrÃ   Ë   sy   € ß*Üˆy×1Ñ1°7¸A×>Ò>ÙØ	×	-×	-Ó	-Ü�t×5Ñ5×<Ñ<Ó>Ó?ˆ÷ 
.ç‹3ÑA¹ÓA�3Œ3ÐAŠ3ÐAˆ3ÑA¹ÓAÓAÐA÷ 
.×	-ús   ¼$BÂB,	c               ó   € V ^8„  d   QhRR/# )r   r   zIterator[HandoffBatch]r   )r   s   "r   r    r    Õ   s   € ÷ $ñ $Ð(ñ $r"   c               #  ó.  "  € \        4       p \        \        R^ 4      ^,           \        n         V x € \        ;P                  ^,          un        \	        4       pVe   VP
                  V n        R# R#   \        ;P                  ^,          un        i ; i5i)z­Hold every drain on this thread until the block exits, then drain once (outside the caller's
lock): a surface that saves a sign-in under its own lock wraps the save in this.ÚholdsN)r   rº   Ú_localrÆ   Údrainr   )ÚbatchÚrans     r   ÚdeferredrË   Ô   sh   é € ô ‹N€EÜœ6 7¨AÓ.°Õ2„F„LðØŠä�Š˜Õ�Ü
‹'€CØ
‚ØŸ™ˆŽñ øô 	�Š˜ÕŽüs   ‚,B¯A3 ³A BÁ3BÂBc               ó   € V ^8„  d   QhRR/# )r   r   zOptional[HandoffBatch]r   )r   s   "r   r    r    ã   s   € ÷ 	ñ 	Ð%ñ 	r"   c                 ó  € \        \        R^ 4      '       g(   \        \        RR4      '       g   \        4       '       d   R# R\        n         \	        \        \        R7      R7      R\        n        #   R\        n        i ; i)znRun this profile's due records now. None when a lock or a :func:`deferred` block on this
thread holds it back.rÆ   ÚrunningFNT)Úbudget_seconds)r   )rº   rÇ   rÃ   rÎ   r   Úrun_dueÚSYNC_BUDGET_SECONDSr   r"   r   rÈ   rÈ   ã   sV   € ô Œv�w ×"Ò"¤g¬f°iÀ×&GÒ&GÔK\×K^ÒK^ÙØ„F„NðÜ¤GÔ;NÔ$OÔPàŒ�ø˜Œ�ús   ÁA2 Á2A?c               ó    € V ^8„  d   QhRRRR/# )r   Údeadliner9   r   r   )r   s   "r   r    r    ï   s   € ÷ 'ñ '˜ð ' 5ñ 'r"   c                ó:   € V \         P                  ! 4       ,
          # r;   )r<   Ú	monotonic)rÓ   s   &r   Ú
_remainingrÖ   ï   s   € Ø”d—n’nÓ&Õ&Ð&r"   c               ó    € V ^8„  d   QhRRRR/# )r   r‹   rk   r   rj   r   )r   s   "r   r    r    ó   s   € ÷ Dñ D�~ð D¨$ñ Dr"   c                óÜ   € V P                  R4      pV\        9   ;'       gL    V\        8H  ;'       d;    V P                  R4      \        9  ;'       d    \	        V P                  R4      4      # )ah  A record a run may still attempt: active, or Failed on a code that is not final (an older
build closed transient failures after 8 attempts; those re-arm here, on any run: a sign-in,
``hermes auth status``, ``hermes auth upgrade``, the retry worker). The retry window is checked
when the attempt is reserved, so a record past it is closed, not silently skipped.r—   ÚerrorrG   )r'   r«   ÚFAILEDÚ_FINAL_CODESrj   )r‹   r—   s   & r   Ú
_retryablerÜ   ó   sk   € ð
 �J‰J�wÓ€EØ”GÑ÷ Dð D ¬¡÷ !Cð !C°F·J±J¸wÓ4GÌ|Ñ4[÷ !Cð !CÜ$(¨¯©°LÓ)AÓ$BðDr"   c               ó$   € V ^8„  d   QhRRRRRR/# ©r   r‹   rk   Únowr9   r   rj   r   )r   s   "r   r    r    ý   s&   € ÷ Sñ S�ð S eð S°ñ Sr"   c                óv   € \        V 4      ;'       d(    \        V P                  R 4      ;'       g    ^ 4      V8*  # )Únext_attempt_at)rÜ   r9   r'   )r‹   rß   s   &&r   Ú_duerâ   ý   s1   € Ü�fÓ×RÐR¤%¨¯
©
Ð3DÓ(E×(JÐ(JÈÓ"KÈsÑ"RÐRr"   c               ó$   € V ^8„  d   QhRRRRRR/# rÞ   r   )r   s   "r   r    r      s!   € ÷ 1ñ 1˜.ð 1¨uð 1¸ñ 1r"   c                ó¾   €  \         P                  ! \        V P                  R 4      4      4      P	                  4       pY\        ,           8¬  #   \
         d     R# i ; i)r©   T)r   Úfromisoformatr@   r'   Ú	timestampru   ÚRETRY_WINDOW_SECONDS)r‹   rß   Úcreateds   && r   Ú_window_endedré     sS   € ðÜ×(Ò(¬¨V¯Z©Z¸Ó-EÓ)FÓG×QÑQÓSˆð Ô0Õ0Ñ0Ð0øô ô Úðús   ‚<A ÁAÁAzOptional[threading.Thread]Ú_worker_threadc               ó   € V ^8„  d   QhRR/# )r   r   zthreading.Threadr   )r   s   "r   r    r      s   € ÷ 
ñ 
Ð&ñ 
r"   c                 óV  € \         ;_uu_ 4        \        e+   \        P                  4       '       d   \        uuRRR4       # \        P	                  4        \
        P                  ! \        RRR7      s\        P                  4        \        uuRRR4       #   + '       g   i     R# ; i)z1Start the process-wide retry worker (idempotent).NTznous-guest-handoff)ÚtargetÚdaemonrf   )	Ú_worker_lockrê   Úis_aliveÚ_worker_stopÚclearÚ	threadingÚThreadÚ_worker_loopÚstartr   r"   r   Ústart_workerr÷     se   € ÷ 
ŽÜÒ%¬.×*AÑ*A×*CÒ*CÜ!÷ 
Šô 	×ÑÔä"×)Ò)´ÀdÐQeÔfˆÜ×ÑÔÜ÷ 
��‹ús   �"B²BÁA
BÂB(	c               ó    € V ^8„  d   QhRRRR/# ©r   Útimeoutr9   r   r   r   )r   s   "r   r    r    !  s   € ÷ 	"ñ 	"˜ð 	"¨ñ 	"r"   c                óT  € \         ;_uu_ 4        \        p\        P                  4        R R R 4       Xe)   VP	                  4       '       d   VP                  V R7       \         ;_uu_ 4        \        VJ d   R sR R R 4       R #   + '       g   i     La; i  + '       g   i     R # ; i)N©rú   )rï   rê   rñ   Úsetrð   Újoin)rú   Úthreads   & r   Ústop_workerr   !  sj   € ç	ŽÜˆÜ×ÑÔ÷ 
ð Ò˜fŸo™o×/Ò/Ø�‰˜GˆÔ$ß	ŽÜ˜VÓ#Ø!ˆN÷ 
‰÷ 
�ú÷
 
�ˆús   �BÁ,BÂB	ÂB'	c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r    r    -  s   € ÷ (ñ (�dñ (r"   c                 ó¾   € \         p \        P                  V 4      '       g    \        4        \        p K.  R#   \         d    \
        P                  R RR7        L.i ; i)zFFree-tier handoff retry tick failed; the records stay for the next oneT)Úexc_infoN)Ú_WORKER_FIRST_TICK_SECONDSrñ   ÚwaitÚretry_all_profilesÚ	Exceptionrv   rw   Ú_WORKER_INTERVAL_SECONDS)r  s    r   rõ   rõ   -  sU   € Ü%€DÜ×Ñ ×%Ò%ð	tÜÔ ô (Šñ &øô ô 	tÜ�N‰NÐcÐnrˆNÖsð	tús   £
7 ·"AÁAc               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r    r    7  s   € ÷ ñ Ð0ñ r"   c            
     óB  €  \        \        4       4      R,          P                  4       p \	        4       p\        T  UUu0 uF0  p\        Y!4      '       g   K  TP                  RR4       F  q3kK  	  K2  	  upp4      p. pT Fo  p\        T4      P                  4       '       g   K$  \        T4      ;_uu_ 4        \        4       pRRR4       TP                  X'       d   TP                  M. 4       Kq  	  T#   \         d    . u # i ; iu uppi   + '       g   i     LT; i)zùRun every due record under its owning profile's scope (home + secrets), so a named profile's
move retries from a process launched as another profile. The bound-account check and the Bearer
proof in ``_reserve`` still decide whether anything is sent.ro   r¨   Nr   )r}   r]   rÀ   r²   r=   Úsortedrâ   r'   r   Úis_dirÚ_profile_scoperÈ   Úextendr   )ro   rß   r‹   r­   Úhomesr   rÉ   s          r   r  r  7  sà   € ðÜœ›Ó(¨Õ3×:Ñ:Ó<ˆô ‹&€CÜ¡wÔk¡w˜V´$°v×2C”DÐPV×PZÑPZÐ[eÐgiÖPjÈ’DÑPj‘D¡wÒkÓl€EØ$&€GÛˆÜ�D‹z× Ñ ×"Ò"ÙÜ˜D×!Õ!Ü“GˆE÷ "à�‰¯�u—}’}°2Ö6ñ ð €Nøô ô ØŠ	ðüó l÷
 "×!ús(   ‚(C5 ¾D
ÁD
Â7DÃ5DÄDÄDc               ó    € V ^8„  d   QhRRRR/# )r   r­   r@   r   rb   r   )r   s   "r   r    r    L  s   € ÷ /ñ /˜ð / ñ /r"   c              #  ó  "  € ^ RI HpHpHp ^ RIHpHp ^ RIHpHp V! V! 4       4      V 8g  pV! V 4      p	T! V! \        V 4      4      V'       d   T MRR7      p
 Rx € V! V
4       V! V	4       R#   T! T
4       T! T	4       i ; i5i)z“The owning profile's home and secrets for one drain (the cron ticker binds a profile the same
way); no terminal scope: nothing here runs a command.)Úbuild_profile_secret_scopeÚreset_secret_scopeÚset_secret_scope)Úget_routing_process_hermes_homerS   )Úreset_hermes_home_overrideÚset_hermes_home_overrideN)Úprofile_home)
Úagent.secret_scoper  r  r  rT   r  rS   r  r  r   )r­   r  r  r  r  rS   r  r  ÚforeignÚ
home_tokenÚsecret_tokens   &          r   r  r  K  sy   é € ÷ dÑcßQßUÙÑ=Ó?Ó@ÀDÑH€GÙ)¨$Ó/€JÙ#Ñ$>¼tÀD»zÓ$J×ahÑY]ÐnrÔs€Lð/Ûá˜<Ô(Ù" :Ö.øñ 	˜<Ô(Ù" :Õ.üs   ‚ABÁA/ ÁBÁ/BÂBrÏ   c               ó    € V ^8„  d   QhRRRR/# )r   rÏ   r9   r   r   r   )r   s   "r   r    r    \  s   € ÷ ñ ˜uð Ð?Sñ r"   c           	     óê  €  \        4       p\        4       \        4       r2\	        T4      R,          P                  4        UUu. uF2  w  rEY%P                  RR4      9   g   K  \        YS4      '       g   K0  TNK4  	  ppp\        P                  ! 4       T ,           p. pT F9  p\        T4      ^ 8:  d    T# \        YT4      ;p	f   K(  TP                  T	4       K;  	  T#   \         d    . u # i ; iu uppi )z§Attempt every active, due record of this profile within *budget_seconds*. Returns their public
views; a record the budget did not reach stays as it is for a later run.ro   r¨   r   )r]   r²   rU   r=   r}   Úitemsr'   râ   r<   rÕ   rÖ   Ú_run_oner¬   )
rÏ   r_   r­   rß   r…   r‹   ÚduerÓ   r   Úviews
   $         r   rÐ   rÐ   \  sç   € ðÜ‹ˆô “œT›Vˆ#Ü"'¨£+¨iÕ"8×">Ñ">Ô"@ô HÑ"@‘;�3Ø—j‘j ¨RÓ0Ñ0ô Ü59¸&×5F÷ ˆ3Ñ"@€Cñ Hä�~Š~Ó .Õ0€HØ€GÛˆÜ�hÓ 1Ô$Øð €Nô ˜T¨Ó1Ð1ˆDÔ>Ø�N‰N˜4Ö ñ	 ð
 €Nøô ô ØŠ	ðüóHs#   ‚
C ÁC/Á!C/Á4C/ÃC,Ã+C,c               ó    € V ^8„  d   QhRRRR/# )r   r‹   rk   r   r†   r   )r   s   "r   r    r    p  s   € ÷ 	añ 	a˜nð 	aÐ1Iñ 	ar"   c                ó  € ^ RI Hp ^ RIHp V! R4      p\	        V\
        4      '       d&   V! V4      '       g   VP                  R4      '       g   R# V P                  R4      pV'       d   \        VR,          4      V8X  d   V# R# )z¹The profile's account when it is the record's destination; None while the profile still holds
a guest (the save never landed) or holds another account (retries bind to the destination).r¡   ©Úget_provider_auth_stater™   rŽ   Nr¦   )r±   r¢   re   r&  rz   r{   r'   r“   )r‹   r¢   r&  Úaccountr¦   s   &    r   Ú_account_bound_tor(  p  sj   € õ 4Ý7Ù% fÓ-€GÜ�gœt×$Ò$©°w×(?Ò(?ÀwÇ{Á{ÐSa×GbÒGbÙØ—*‘*˜]Ó+€Kß!¤h¨w°~Õ/FÓ&GÈ;Ô&Vˆ7Ð`Ð\`Ð`r"   c               ó(   € V ^8„  d   QhRRRRRRRR/# ©	r   r_   r   r…   r@   rÓ   r9   r   r†   r   )r   s   "r   r    r    |  s)   € ÷ ñ �4ð ˜cð ¨Uð Ð7Oñ r"   c           
     ór  € \        V 4      R ,          P                  V4      pVe   \        V4      f   R#  \        V P	                  \
        R,           4      \        \        R\        V4      4      4      ;_uu_ 4        \        WV4      uuRRR4       #   + '       g   i     R# ; i  \         d     R# i ; i)ro   Nz.claim.lockçš™™™™™¹?)r}   r'   r(  rg   r[   r\   Ú_claim_lock_holderÚmaxrÖ   Ú_claim_lockedÚTimeoutError)r_   r…   rÓ   r‹   s   &&& r   r   r   |  s•   € Ü�4‹[˜Õ#×'Ñ'¨Ó,€FØ‚~Ô*¨6Ó2Ò:ÙðÜ�4—>‘>Ô"2°]Õ"BÓCÔEWÜ�sœJ xÓ0Ó1÷3õ 3ä  ¨HÓ5÷3÷ 3÷ 3ó 3ûô ô Úðús0   ¶AB' Á<BÂ
B' ÂB$	ÂB' Â$B' Â'B6Â5B6c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r_   r   r…   r@   Úbearer_subjectr   r   z$Optional[tuple[dict[str, Any], int]]r   )r   s   "r   r    r    ‹  s)   € ÷ 7ñ 7�4ð 7˜cð 7°=ð 7ÐEiñ 7r"   c                ó`   aa€ . oR VV3R llp\        WV4      pS'       d   VS^ ,          3# R# )al  Reserve one attempt in a single locked read-modify-write: the record is still retryable and
due, inside its retry window, and bound to the very account whose Bearer is about to be sent.
Returns ``(record, attempts before this one)``, or None when nothing may be sent now. A record
past its window is closed as Failed instead; one an older build failed is re-armed.c               ó    € V ^8„  d   QhRRRR/# )r   r‹   r†   r   r   )r   s   "r   r    Ú_reserve.<locals>.__annotate__’  s    € ÷ Eñ EÐ/ð EÐ4Lñ Er"   c           	     ó   <€ \        4       pV e0   \        W4      '       d   S'       d   V P                  R4      S8w  d   R # \        W4      '       d   / V CR\        RR/C# \        V P                  R4      ;'       g    ^ 4      pSP                  V4       / V CRV R,          \        8X  d   \        MV R,          RV^,           R\        V4      /C# )Nr¦   r—   rÙ   r   r§   Úlast_attempt_at)	r=   râ   r'   ré   rÚ   Úintr¬   ÚRETRYINGrE   )r‹   rß   Úpriorr2  Úreserveds   &  €€r   rŠ   Ú_reserve.<locals>.change’  sº   ø€ Ü‹fˆØŠN¤$ v×"3Ò"3ß%¨¯©°MÓ)BÀnÔ)TÙÜ˜×%Ò%ØM�fÐM˜g¤v¨wÐ8LÑMÐMÜ�F—J‘J˜zÓ*×/Ð/¨aÓ0ˆØ�‰˜ÔðE�&ð E˜'¨v°g­Ä&Ô/H¥8ÈfÐU\ÍoØ˜E A�IÐ'8¼$¸s»)ñEð 	Er"   N)rŒ   )r_   r…   r2  rŠ   r‹   r;  s   &&f  @r   Ú_reserver=  ‹  s:   ù€ ð
 €H÷Eñ Eô �T Ó'€Fß$,ˆF�H˜Q•KÐ Ð6°$Ð6r"   c               ó(   € V ^8„  d   QhRRRRRRRR/# r*  r   )r   s   "r   r    r    £  s)   € ÷ "ñ "˜ð " 3ð "°%ð "Ð<Tñ "r"   c                óH  aaaa€ ^ RI Hp ^ RIHp Rp \	        V 4      R,          P                  V4      pVe   \        V4      ^ 8:  d   V'       d   \        V4      # R#  \        V\        V4      R7      p\        T4      ^ 8:  d   \        T4      # \        Y\        T4      4      p	T	f5   \        \	        T 4      R,          P                  T4      ;'       g    T4      # T	w  p
o\        T
R
,          Ys! R4      ;'       g    / \        \         \#        R\        T4      4      4      R7      w  ooo\        P                  RS^,           TR	,          SP                  R4      ;'       g    S4       S\$        8X  d   T'       g   \'        YT3R l4       RpEK€  \'        YTTTT3R l4      p
S\(        8X  d5   SP                  R4      RJ d    \+        \#        R\        T4      4      R7       \#        R\-        T
P                  R4      ;'       g    ^ 4      \/        4       ,
          4      pT
R,          \0        8w  g   T\        T4      8¼  d   \        T
4      # \3        T4       EKJ    T d>   p\        P                  RTR	,          TP                  4       \        T4      u Rp?# Rp?ii ; i)rQ   r%  ©Ú	AuthErrorFTro   N©Úforcerú   z6Free-tier handoff (%s): account token unavailable (%s)r¯   rG   r™   r,  rü   z%Free-tier handoff attempt %d (%s): %srÙ   c                óR   <€ V P                  R 4      S^,           8X  d	   / V CR S/C# R# )r§   Nr&   )r)   r:  s   &€r   Ú<lambda>Ú_claim_locked.<locals>.<lambda>¼  s2   ø€ ÀQÇUÁUÈ:ÓEVÐZ_ÐbcÕZcÔEcÐ)A¨AÐ)A¨z¸5Ñ)AÐ)mÐimÐ)mr"   c                ó"   <€ \        V SSSS4      # r;   )Ú_apply)r)   ÚoutcomeÚpayloadr:  Úretry_afters   &€€€€r   rE  rF  ¿  s   ø€ ¬f°Q¸ÀÈ+ÐW\Ô.]r"   Úcohort_carriedg      ð?g        rá   r—   )re   r&  r’   rA  r}   r'   rÖ   Úpublic_viewÚ_bearerrv   r³   Úcoder=  r“   Ú_postÚminÚCLAIM_TIMEOUT_SECONDSr.  Ú_REAUTHrŒ   Ú_CLAIMEDÚ_refresh_account_tokenr9   r=   r9  Ú_sleep)r_   r…   rÓ   r&  rA  rC  ÚcurrentÚbearerÚexcÚreservationr‹   r  rI  rJ  r:  rK  s   &&&         @@@@r   r/  r/  £  s!  û€ Ý7Ý3Ø€EØ
Ü˜“+˜iÕ(×,Ñ,¨SÓ1ˆØŠ?œj¨Ó2°aÔ7ß+2”;˜wÓ'Ð<¸Ð<ð	(Ü 5´*¸XÓ2FÔGˆFô �hÓ 1Ô$Ü˜wÓ'Ð'Ü˜t¬(°6Ó*:Ó;ˆØÒÜœu T›{¨9Õ5×9Ñ9¸#Ó>×IÐIÀ'ÓJÐJØ#‰ˆ�Ü(-Ø�<Õ  &Ð*AÀ&Ó*I×*OÐ*OÈRÜÔ-¬s°3¼
À8Ó8LÓ/MÓNô)PÑ%ˆ�˜+ô 	�‰Ð;¸UÀQ½YÈÈBÍÐQX×Q\ÑQ\Ð]dÓQe×QpÐQpÐipÔqØ”gÔ§eä�DÔmÔnØˆEÚÜ˜×$]Ó^ˆØ”hÔ 7§;¡;Ð/?Ó#@ÀDÓ#HÜ"¬3¨s´J¸xÓ4HÓ+IÕJÜ�3œ˜fŸj™jÐ):Ó;×@Ð@¸qÓAÄDÃFÕJÓKˆØ�'�?œhÔ&¨$´*¸XÓ2FÔ*FÜ˜vÓ&Ð&Üˆt�øð1 ô 	(Ü�K‰KÐPÐRUÐVXÕRYÐ[^×[cÑ[cÔdÜ˜wÓ'Õ'ûð	(ús   ÁI ÉJ!É$2JÊJ!ÊJ!c               ó$   € V ^8„  d   QhRRRRRR/# )r   rC  rj   rú   r9   r   r@   r   )r   s   "r   r    r    È  s&   € ÷ Gñ G�dð G Uð G¨sñ Gr"   c           	     ó.  € ^ RI Hp ^ RIHp VP                  ;_uu_ 4        VP
                  P                  \        4       R4       RRR4       VP                  V4      ;_uu_ 4        V! VR7      ;_uu_ 4        V '       d,   VP                  V\        R7      uuRRR4       uuRRR4       # VP                  VR7      uuRRR4       uuRRR4       #   + '       g   i     L•; i  + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)rQ   )r¶   )Ú_nous_shared_store_lockN)ra   )ra   Úrefresh_skew_seconds)r¼   r¶   rZ   r]  Ú_RESOLVE_TOKEN_CACHE_LOCKÚ_RESOLVE_TOKEN_CACHEÚpoprU   Ú_auth_store_lockÚresolve_nous_access_tokenÚ_FORCE_REFRESH_SKEW)rC  rú   r¶   r]  s   $$  r   rN  rN  È  s¸   € ÝÝ<à	×	'×	'Ó	'Ø×!Ñ!×%Ñ%¤i£k°4Ô8÷ 
(ð
 
×	Ñ	˜w×	'Õ	'Ñ)@ÐQX×)YÖ)YßØ×1Ñ1À'Ô`sÐ1Ót÷ *ZÑ)Y×	'Ò	'ð ×-Ñ-¸gÐ-ÓF÷ *ZÑ)Y×	'Ò	'÷ 
(×	'ú÷
 *Z×)Yú×	'×	'×	'Ò	'ús;   ¡%CÁ'DÁ9C&	Â
DÂ-C&	Â>
DÃC#	Ã&C6Ã1DÄD	c               ó    € V ^8„  d   QhRRRR/# rù   r   )r   s   "r   r    r    ×  s   € ÷ _ñ _ uð _°ñ _r"   c                ó„   € ^ RI Hp  \        RV R7       R#   T d"   p\        P	                  RT4        Rp?R# Rp?ii ; i)zVThe account's token picks up the carried cohort only on its next mint, so mint it now.r@  TrB  zBFree-tier handoff: account token refresh after the move failed: %sN)r’   rA  rN  rv   r³   )rú   rA  rY  s   $  r   rU  rU  ×  s:   € å3ð_Ü�d G×,øØô _Ü�‰ÐXÐZ]×^Ò^ûð_ús   ˆ —?ž:º?c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   rG   r@   rX  r'  rk   rú   r9   r   z+tuple[str, dict[str, Any], Optional[float]]r   )r   s   "r   r    r    à  s8   € ÷ jñ j�cð j 3ð j°ð jØðjØHñjr"   c          	     ór  € ^ RI Hp ^ RIHp ^ RIHpHp ^ RIHp ^ RI	H
p	 V! RRVR7      p
 V	! W:4      ;_uu_ 4       pVP                  V! V4      P                  R4       R	2/ V! 4       CR
RV 2/CRV /R7      pRRR4        XP#                  4       p\'        T\(        4      '       d   TM/ p\+        XP,                  T4      Yä! TP.                  4      3#   + '       g   i     Lc; i  TP                   d+   p\        RRR\        T4      P                   /R3u Rp?# Rp?ii ; i  \$         d    / p L¢i ; i)rQ   )Úparse_retry_after_seconds)Ú_anon_headers)Ú_nous_portal_base_urlÚ_resolve_verify)Úhttpx)Ú_nous_http_clientN)ÚinsecureÚ	ca_bundleÚ
auth_stateÚ/z/api/anonymous/claimÚauthorizationzBearer Útoken)Úheadersrq   rÙ   ÚunreachableÚdetail)Úagent.retry_utilsri  r±   rj  re   rk  rl  r’   rm  rZ   rn  ÚpostÚrstripÚ	HTTPErrorÚ_RETRYÚtyper/   rq   ru   rz   r{   Ú	_classifyÚstatus_coderu  )rG   rX  r'  rú   ri  rj  rk  rl  rm  rn  ÚverifyÚclientÚresponserY  rJ  s   &&&$           r   rP  rP  à  s)  € å;Ý2ßFÝ/Ý6Ù d°dÀwÔO€FðTÙ˜w×/Ô/°6Ø—{‘{Ù(¨Ó1×8Ñ8¸Ó=Ð>Ð>RÐSØP™=›?ÐP¨O¸wÀvÀhÐ=OÑPÐX_ÐakÐWlð #ó nˆH÷ 0ðØ—-‘-“/ˆô $ G¬T×2Ò2‰g¸€GÜ�X×)Ñ)¨7Ó3°WÐ>WÐX`×XhÑXhÓ>iÐiÐi÷ 0×/ûð �?‰?ô TÜ˜ °¼$¸s»)×:LÑ:LÐMÈtÐSÕSûðTûô ô ØŠðúsL   ­C( ½=CÁ:C( ÂD& ÃC%	Ã C( Ã%C( Ã(D#Ã9DÄD#ÄD#Ä&D6Ä5D6c               ó$   € V ^8„  d   QhRRRRRR/# )r   Ústatusr8  rJ  rk   r   r@   r   )r   s   "r   r    r    ÷  s&   € ÷ Bñ B�cð B Nð B°sñ Br"   c                óæ   € V ^È8X  d#   VP                  R4      R8X  d   \        # \        # V R8X  d   \        # \        P                  \        VP                  R4      ;'       g    R4      \        4      # )éÈ   r„  Úclaimedi‘  rÙ   rn   )r'   rT  r|  rS  Ú	_REFUSALSr@   )r„  rJ  s   &&r   r~  r~  ÷  sW   € Ø�„}Ø"Ÿ;™; xÓ0°IÔ=ŒxÐIÄ6ÐIØ�„}ÜˆÜ�=‰=œ˜WŸ[™[¨Ó1×7Ð7°RÓ8¼&ÓAÐAr"   c               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r   r‹   rk   rI  r@   rJ  rK  zOptional[float]Úprior_attemptsr8  r   r   )r   s   "r   r    r    ÿ  s9   € ÷ ñ �>ð ¨Cð ¸.ð ÐWfð ØðØ#1ñr"   c                óX  € V R ,          \         8X  d   V # / V CRVP                  R4      RR/Cp V\        8X  Ed   \        VP                  R4      \        4      '       d   VP                  R4      MRpT P                  \         RRVP                  R4      RVP                  R4      RT;'       g    / P                  R4      ;'       g    R	R
\        T;'       g    / P                  R
4      ;'       g    . 4      R\        T;'       g    / P                  R4      ;'       g    . 4      RVP                  R4      RJ /R7       M¿V\        8X  d8   T P                  \        VP                  R4      R8H  ;'       g    V^ 8„  R7       M}V\        8X  d   V P                  \        R7       M[\        \        V\        \        4      ^,
          4      ,          pT P                  \        \        4       V'       d   TMT,           R7       V R ,          \         \        39   d   V P!                  RR4       V # )r—   rÙ   rá   NÚ
connectorsr%   Údestination_org_idÚconnectors_kindÚkindÚunknownÚmoved_toolkitsÚdropped_toolkitsrL  T)r—   rÙ   Úresultr   )r—   Úprobably_moved©r—   )r—   rá   rG   )ÚCLAIMEDr'   rT  rz   r{   Úupdater4   Ú_GONEÚGONEÚ_FAILrÚ   Ú_BACKOFF_SECONDSrQ  Úlenr9  r=   ra  )r‹   rI  rJ  rK  rŠ  rŒ  Úladders   &&&&&  r   rH  rH  ÿ  sÁ  € àˆg…œ'Ô!ØˆØO�ÐO˜ §¡¨WÓ!5Ð7HÈ$ÑO€FØ”(ÕÜ2<¸W¿[¹[ÈÓ=VÔX\×2]Ò2]�W—[‘[ Ô.Ðcgˆ
Ø�‰œG¨4Ø˜WŸ[™[¨Ó9Ø  '§+¡+Ð.BÓ"Cà 
× 0Ð 0¨b×5Ñ5°fÓ=×JÐJÀØœd J×$4Ð$4°"×#9Ñ#9Ð:JÓ#K×#QÐ#QÈrÓRØ¤ j×&6Ð&6°B×%;Ñ%;Ð<NÓ%O×%UÐ%UÐSUÓ VØ˜gŸk™kÐ*:Ó;¸tÐCð9Eˆõ 	Fð 
”EÔ	à�‰œD°·±¸WÓ1EÐIZÑ1Z×1pÐ1pÐ^lÐopÑ^pˆÕqØ	”EÔ	Ø�‰œFˆÕ#ä!¤# n´cÔ:JÓ6KÈaÕ6OÓ"PÕQˆØ�‰œH´d³fÏ{ÁÐ`fÕ6gˆÔhØˆg…œ7¤D˜/Ô)Ø�
‰
�< Ô&Ø€Mr"   c               ó    € V ^8„  d   QhRRRR/# ©r   r‹   rk   r   r   )r   s   "r   r    r      s   € ÷ 
0ñ 
0˜ð 
0¨>ñ 
0r"   c                óü  € V P                  R4      ;'       g    / pV P                  R4      pRV P                  R\        4      RVP                  R4      RVP                  R4      RVP                  R. 4      RVP                  R. 4      R\        V P                  R4      4      R	V P                  R	4      R
V'       d.   \        ^ \	        \        V4      \        4       ,
          4      4      M^ RV P                  R4      /	# )z7The wire shape the surfaces read; never the credential.r“  rá   r—   r%   rŽ  r‘  r’  r”  rÙ   rK  rˆ   )r'   ÚIDLErj   r.  r8  r9   r=   )r‹   r“  Únext_ats   &  r   rM  rM    sÓ   € à�Z‰Z˜Ó!×'Ð' R€FØ�j‰jÐ*Ó+€Gà�—‘˜G¤TÓ*¨O¸V¿Z¹ZÈÓ=XØ˜6Ÿ:™:Ð&7Ó8Ø˜&Ÿ*™*Ð%5°rÓ:Ð<NÐPV×PZÑPZÐ[mÐoqÓPrØœ$˜vŸz™zÐ*:Ó;Ó<¸gÀvÇzÁzÐRYÓGZØ¿w”s˜1œc¤%¨£.´4³6Õ"9Ó:Ô;ÈAØ�f—j‘j Ó.ð0ð 0r"   c               ó    € V ^8„  d   QhRRRR/# rŸ  r   )r   s   "r   r    r    *  s   € ÷ ñ �~ð ¨.ñ r"   c                ó~   € \        V 4      p\        V 4      '       d!   \        V 4      '       d   \        M\        VR &   V# r•  )rM  rÜ   r(  r9  ÚPAUSED)r‹   r"  s   & r   Ú
_status_ofr¦  *  s1   € Ü�vÓ€DÜ�&×ÒÜ$5°f×$=Ò$=�Ä6ˆˆW‰Ø€Kr"   c               ó   € V ^8„  d   QhRR/# )r   r   rk   r   )r   s   "r   r    r    1  s   € ÷ Oñ O˜ñ Or"   c                 óD  €  \        \        4       4      R,          P                  4       p \        4       pT  Uu. uF  q!TP                  RR4      9   g   K  TNK  	  ppT'       g	   R\        /# \        \        TR R7      4      #   \         d    R\        /u # i ; iu upi )z°This profile's latest handoff, or ``{"state": "idle"}``. A pure read (no lock, no network). An
active move bound to an account this profile no longer holds reads as ``paused``.ro   r—   r¨   c                óJ   € \        V P                  R 4      ;'       g    R4      # )rˆ   rn   )r@   r'   )r)   s   &r   rE  Ú handoff_status.<locals>.<lambda><  s   € ¬c°!·%±%¸Ó2E×2KÐ2KÈÔ.Lr"   )r…   r   )	r}   r]   rÀ   r²   r¡  rU   r'   r¦  r.  )ro   r­   r)   Úmines       r   Úhandoff_statusr¬  1  s�   € ðÜœ›Ó(¨Õ3×:Ñ:Ó<ˆô ‹;€DÙÓ@‘w�!¨!¯%©%°
¸BÓ*?Ñ"?�AˆA‘w€DÐ@ßØœˆÐÜ”c˜$Ñ$LÔMÓNÐNøô ô ØœˆÒðüò As   ‚(B ¸BÁBÂBÂBc               ó    € V ^8„  d   QhRRRR/# )r   rG   r@   r   r†   r   )r   s   "r   r    r    ?  s   € ÷ 2ñ 2˜cð 2Ð&>ñ 2r"   c                ó¶   €  \        \        4       4      R,          P                  \        V 4      4      pT'       d   \        T4      # R#   \         d     R# i ; i)zòThe handoff of one free-tier credential (as :func:`handoff_status` reads it), or None when no
record exists. A pure read: what a sign-in reports when its own run attempted nothing (another
process held the claim, or the budget ran out first).ro   N)r}   r]   r'   rN   r²   r¦  )rG   r‹   s   & r   Úrecord_statusr¯  ?  sP   € ðÜ”}“Ó'¨	Õ2×6Ñ6´zÀ*Ó7MÓNˆ÷ "(Œ:�fÓÐ1¨TÐ1øô ô Úðús   ‚2A	 Á	AÁAc               ó    € V ^8„  d   QhRRRR/# )r   r„  rk   r   r   )r   s   "r   r    r    J  s   € ÷ 5ñ 5˜ð 5¨>ñ 5r"   c                ó$   € / V CR\        V 4      /C# )zaA status as the desktop reads it: the fields, plus the user copy for them (:func:`result_lines`).Úlines)Úresult_lines)r„  s   &r   Úwire_statusr´  J  s   € à4ˆfÐ4�gœ|¨FÓ3Ñ4Ð4r"   c               ó    € V ^8„  d   QhRRRR/# ©r   r„  rk   r   z	list[str]r   )r   s   "r   r    r    O  s   € ÷ ñ ˜ð ¨Iñ r"   c                ó"  € \        V 4      pV P                  R4      pVR	9   ;'       d    V P                  R4      pV P                  R4      \        8X  d;   V'       g3   VR8w  d,   RV P                  R4      ;'       g    R RV^ ,           2V^ &   V# )
z?User copy for a non-idle handoff (``hermes auth status nous``).rŽ  r‘  r—   ÚconflictzSigned in as r%   úyour accountz. ©ÚmovedÚswapped)r³  r'   r–  )r„  r²  r�  Ú
moved_somes   &   r   Ústatus_linesr¾  O  sˆ   € ä˜Ó €EØ�:‰:Ð'Ó(€DØÐ-Ñ-×NÐN°&·*±*Ð=MÓ2N€JØ‡z�z�'ÓœgÔ%¯j¸TÀZÔ=OØ" 6§:¡:¨oÓ#>×#PÐ#PÀ.Ð"QÐQSÐTYÐZ[ÕT\ÐS]Ð^ˆˆa‰Ø€Lr"   c               ó    € V ^8„  d   QhRRRR/# r¶  r   )r   s   "r   r    r    Y  s   € ÷  ñ  ˜ð  ¨Iñ  r"   c                ó4  € V P                  R4      pV P                  R4      ;'       g    RpV P                  R4      ;'       g    . V P                  R4      ;'       g    . rCV\        9   d   R.# V\        8X  d   R.# V\        8X  dV   \        P                  \        V P                  R4      ;'       g    R	4      4      pR
V'       d   RV 2,           .# R	,           .# V\        8X  d   V P                  R4      '       d   R.# R.# V\        8w  d   . # V P                  R4      pVR9   d#   V'       d   RV RRP                  V4       R2.pMVR8X  d   V R2.pMVR9   d   R.pMR.pV'       d(   VP                  RV RRP                  V4       R24       V# )zoWhat a handoff did, for the line after "Signed in as ..." (every sign-in surface) and for
:func:`status_lines`.r—   r%   r¹  r‘  r’  zRMoving your free-tier apps to this account; Hermes keeps trying in the background.zkYour free-tier apps are set to move to another Nous account. Sign in to that account to finish moving them.rÙ   rn   z'Your free-tier apps could not be moved.Ú r”  z0Your free-tier apps were probably moved already.z(Nothing left to move from the free tier.rŽ  zYour apps moved to z: z, Ú.r¸  z? already had its own apps, so the free-tier apps stayed behind.z%There were no free-tier apps to move.z+Any free-tier apps are in this account now.zReconnect in rº  )Únoner»  r¼  )
r'   r«   r¥  rÚ   Ú_FAILURE_COPYr@   r™  r–  rþ   r¬   )r„  r—   Úwherer»  ÚdroppedÚreasonr�  r²  s   &       r   r³  r³  Y  s§  € ð �J‰J�wÓ€EØ�J‰J�Ó'×9Ð9¨>€EØ—Z‘ZÐ 0Ó1×7Ð7°R¸¿¹ÐDVÓ9W×9]Ð9]Ð[]ˆ7Ø”ÔØdÐeÐeØ”„ð)ð *ð 	*à”„Ü×"Ñ"¤3 v§z¡z°'Ó':×'@Ð'@¸bÓ#AÓBˆØ9ÏV¸qÀÀ¸\Õ\Ð]Ð]ÐY[Õ\Ð]Ð]Ø”„}ØFLÇjÁjÐQa×FbÒFbÐBð Að 	AØ?ðAð 	Aà”ÔØˆ	Ø�:‰:Ð'Ó(€Dð Ð#Ô#¯Ø& u g¨R°·	±	¸%Ó0@Ð/AÀÐCÐD‰Ø	�Ô	Ø�7ÐYÐZÐ[‰Ø	Ð-Ô	-Ø8Ð9‰à>Ð?ˆßØ�‰�} U G¨2¨d¯i©i¸Ó.@Ð-AÀÐCÔDØ€Lr"   )ÚidleÚpendingÚretryingr‡  ÚgoneÚfailedi€# )g       @ç      @r   r   g     Àr@g      Œ@g      ¬@i Êš;)r‡  rË  ÚretryÚfailÚreauth>   r   Úinvalid_requestr   r   )rÍ  )gÚ__conditional_annotations__r3   Ú
__future__r   rJ   rq   Úloggingró   r<   Ú
contextlibr   Údataclassesr   r   r   r   Úpathlibr   Útypingr	   r
   r   Ú	getLoggerrv   r¡  rª   r9  r–  r™  rÚ   r¥  Ú	frozensetr«   r\   rÑ   rR  rç   r›  rd  rT  r˜  r|  rš  rS  rÛ   rÄ  rˆ  Úlocalr‰   r-  rÇ   ÚsleeprV  r   r=   rE   rN   rU   r]   rg   r}   rƒ   rŒ   r“   rœ   r›   rÃ   rË   rÈ   rÖ   rÜ   râ   ré   r  r  ÚLockrï   ÚEventrñ   rê   r5   r÷   r   rõ   r  r  rÐ   r(  r   r=  r/  rN  rU  rP  r~  rH  rM  r¦  r¬  r¯  r´  r¾  r³  )rO  rÒ  s   0@r   Ú<module>rß     s’  øðôõ0 #ã Û Û Û Û Ý %ß (ß "Ý ß *Ñ *à	×	Ò	Ð,Ó	-€à1kÑ .€€gˆx˜ $¨à	€Ù
�W˜hÐ'Ó
(€Ø'Ð ØÐ ØÐ ð &Ð Ø?Ð àÐ ð +WÑ '€ˆ%�˜ ñ ÒjÓk€ð ÐgØÐ4ØÐRð€ð �UÐ-¨uðá+Ó,™|�tˆU‚{™|Ñ,ð€	ð
 !—’Ó(Ð Ø—_’_Ó&Ð Ø	�ŠÓ	€Ø	�‰€ð ÷`ð `ó ð`õõ=õGõõ
Að
 ôó ððS e÷ Sõ"3õ
õ%õJõ,õDBð ô$ó ð$õ	õ'õDõSõ1ð "Ð ØÐ Ø�~Š~Ó€Ø�ŠÓ €Ø-1€Ð*Ó 1õ
÷	"õ(õð( ô/ó ð/ð Ð':÷ õ(	aõõ7õ0"õJGõ_õjõ.Bõõ<
0õõOõ2õ5õ
÷ ùòk -s   ÂH8