+
    jHàjÌ”  ã                  ó  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtHtHtHtHt ^ RIHt ^ RIHt ]P(                  ! R4      t]! 0 R?m4      tR@tRAtR R	 ltR
 R ltR R ltR R ltR R ltR R ltRBt . t!R]"R&   / t#R]"R&   Rt$R R lt%R R lt&R R lt'R R  lt(R! R" lt)R# R$ lt*R% R& lt+R' R( lt,R) R* lt-R+ R, lt.R- R. lt/R/ R0 lt0RCR1 R2 llt1R3 R4 lt2R5 R6 lt3R7 R8 lt4R9 R: lt5 ! R; R<4      t6R= R> lt7R# )Da  Single-use OAuth grant hygiene: strip cloned grants from profiles, heal forked grants.

Split out of ``hermes_cli/auth.py`` and re-exported there; origin helpers are imported lazily
inside each function so ``hermes_cli.auth.<name>`` patches still intercept (and no import cycle).
)ÚannotationsN)ÚPath)ÚAnyÚDictÚListÚOptionalÚTuple)Ú_decode_jwt_claims)Úfile_signaturezhermes_cli.authc               ó    € V ^8„  d   QhRRRR/# ©é   Úblockúdict[str, Any]Úreturn© )Úformats   "ÚA/home/ubuntu/.hermes/hermes-agent/hermes_cli/auth_oauth_grants.pyÚ__annotate__r   '   s   € ÷ 9ñ 9˜ð 9¨Nñ 9ó    c                óX   € V P                  R 4      p\        V\        4      '       d   V# T # )Útokens)ÚgetÚ
isinstanceÚdict)r   r   s   & r   Ú_block_tokensr   '   s'   € à�Y‰Y�xÓ €FÜ ¬×-Ò-ˆ6Ð8°5Ð8r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úprovider_idÚstrÚentryr   r   Úboolr   )r   s   "r   r   r   -   s&   € ÷ Xñ X sð X°3ð X¸4ñ Xr   c                ó¸   € \        V4      '       g   R # V R8g  ;'       g<    \        \        VP                  R4      ;'       g    R4      P	                  4       4      # )FÚnousÚrefresh_tokenÚ )Ú_is_oauth_pool_payloadr    r   r   Ústrip)r   r   s   &&r   Ú_is_forkable_pool_rowr'   -   sI   € ô " %×(Ò(Ùà˜&Ñ ×WÐW¤D¬¨U¯Y©Y°Ó-G×-MÐ-MÈ2Ó)N×)TÑ)TÓ)VÓ$WÐWr   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r    r   )r   s   "r   r   r   7   s   € ÷ Jñ J #ð J¨$ñ Jr   c                ó´  € \        V \        4      '       g   R # \        V P                  R4      ;'       g    R4      P	                  4       P                  4       R8H  ;'       gw    \        \        V P                  R4      ;'       g    R4      P	                  4       4      ;'       g4    \        V P                  R4      ;'       g    R4      P                  R4      # )FÚ	auth_typer$   Úoauthr#   Úaccess_tokenz
sk-ant-oat)r   r   r   r   r&   Úlowerr    Ú
startswith)r   s   &r   r%   r%   7   s­   € Ü�eœT×"Ò"Ùô 	ˆE�I‰I�kÓ"×(Ð( bÓ)×/Ñ/Ó1×7Ñ7Ó9¸WÑD÷ 	Ið 	IÜ”�E—I‘I˜oÓ.×4Ð4°"Ó5×;Ñ;Ó=Ó>÷	Ið 	Iäˆu�y‰y˜Ó(×.Ð.¨BÓ/×:Ñ:¸<ÓHðJr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Úsnapshot_storer   Ú
live_storer   r   )r   s   "r   r   r   B   s)   € ÷ Kñ KØ"ðKØ0>ðKàñKr   c                óT  a€ ^ RI HpHp \        P                  ! V 4      pVP                  R4      pVP                  R4      p\         EFÔ  o\        V\        4      '       d   VP                  S4      MRp\        V\        4      '       g   . p\        V\        4      '       d   VP                  S4      MRp\        V\        4      '       g   . pV U	u. uF  p	\        SV	4      '       g   K  V	NK  	  p
p	\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      pV
'       g   V'       g   K÷  \        V\        4      '       g   / ;qTR&   V U	u/ uFm  p	\        V	\        4      '       g   K  \        V	P                  R4      \        4      '       g   KB  V	P                  R4      '       g   K[  V	P                  R4      V	bKo  	  pp	VP                  4        UU	u/ uF  w  rÙ\        SV	4      '       g   K  WÙbK  	  ppp	V
 U	u. uFW  p	\        V	P                  R4      \        4      '       d   V	P                  R4      '       d   KA  \        P                  ! V	4      NKY  	  pp	. p\        4       pV EFH  p\        V\        4      '       d   VP                  R4      MRp\        V\        4      '       d   V'       d   VP                  V4      MRp\        SV4      p\        SV4      pV'       dp   Ve   VV9   d   K‹  VP                  V4       V'       d#   VP!                  V! VVSV! V4      R7      4       M%VP!                  \        P                  ! V4      4       Kí  V'       dC   VV9   d   Kþ  VP                  V4       VP!                  \        P                  ! V4      4       EK7  VP!                  V4       EKK  	  VP                  4        UU	u. uF$  w  rÙVV9  g   K  \        P                  ! V	4      NK&  	  ppp	VV,           V,           VS&   EK×  	  VP                  R	4      pVP                  R	4      p\"         EF?  o\        V\        4      '       d   VP                  S4      MRp\        V\        4      '       d   VP                  S4      MRp\        V\        4      ;'       d$    \%        \'        V4      P                  R
4      4      p\        V\        4      ;'       d$    \%        \'        V4      P                  R
4      4      pV'       g   V'       g   KÞ  \        V\        4      '       g   / ;pVR	&   \        V\        4      '       d   \        P                  ! V4      VS&   EK-  VP)                  SR4       EKB  	  V# u up	i u up	i u up	pi u up	i u up	pi )ag  Restore historical auth state without reviving spent single-use OAuth generations.

Snapshot metadata may be restored onto a live grant only when its stable row id proves the
lineage. Historical single-use refresh material with no live counterpart is dropped because
there is no local evidence that it is still redeemable. Current live grants always survive.
)Ú_credential_token_pairÚ_merge_pool_row_generationÚcredential_poolNc              3  ó<   <"  € T F  p\        SV4      x € K  	  R # 5i©N)r'   )Ú.0Úrowr   s   & €r   Ú	<genexpr>ÚHmerge_snapshot_auth_preserving_live_single_use_grants.<locals>.<genexpr>^   s   øé € ð "
Ù?L¸Ô! +¨s×3Ð3»}ùs   ƒTFÚid)Ú	base_pairÚ	providersr#   )Úhermes_cli.authr3   r4   ÚcopyÚdeepcopyr   Ú!SINGLE_USE_REFRESH_POOL_PROVIDERSr   r   Úlistr'   Úanyr   ÚitemsÚsetÚaddÚappendÚ_DEVICE_CODE_BLOCK_PROVIDERSr    r   Úpop)r0   r1   r3   r4   ÚrestoredÚsnapshot_poolÚ	live_poolÚ	live_rowsÚsnapshot_rowsr9   Úlive_grantsÚsnapshot_has_grantsÚlive_rows_by_idÚrow_idÚlive_grants_by_idÚlive_without_idÚmerged_snapshotÚconsumed_idsÚsnapshot_rowÚlive_rowÚlive_is_grantÚsnapshot_is_grantÚ	live_onlyÚsnapshot_providersÚlive_providersÚsnapshot_blockÚ
live_blockÚsnapshot_has_refreshÚlive_has_refreshr   s   &&                           @r   Ú5merge_snapshot_auth_preserving_live_single_use_grantsrc   B   sù  ø€ ÷ Sä�}Š}˜^Ó,€HØ—L‘LÐ!2Ó3€MØ—‘Ð0Ó1€Iç8Ð8ˆÜ2<¸YÌ×2MÒ2M�I—M‘M +Ô.ÐSWˆ	Ü˜)¤T×*Ò*ØˆIä.8¸Ì×.MÒ.MˆM×Ñ˜kÔ*ÐSWð 	ô ˜-¬×.Ò.ØˆMñ %ó
Ù$�CÔ(=¸kÈ3×(O�CˆC™9ð 	ð 
÷ "›cô "
Ù?Ló"
ŸcŸcšcô "
Ù?Ló"
ó 
Ð÷ ×#6Ùä˜-¬×.Ò.Ø:<Ð<ˆMÐ%6Ñ7ñ !ó
á �Ü˜#œt×$ô ô ˜3Ÿ7™7 4›=¬#×.ô ð —‘˜—ô	 ˆC�G‰G�D‹M˜3ÒÙ ð 	ð 
ð  /×4Ñ4Ô6ô
á6‘�Ü$ [°#×6ô ˆFŠKÙ6ð 	ñ 
ñ #ó
á"�Ü˜sŸw™w t›}¬c×2Ò2°s·w±w¸t·}ô ŒD�MŠM˜#ÖÙ"ð 	ð 
ð
 13ˆÜ!$£ˆä)ˆLÜ/9¸,Ì×/MÒ/M�\×%Ñ% dÔ+ÐSWˆFô ˜f¤c×*Ò*¯vð  ×#Ñ# FÔ+àð ô
 2°+¸xÓHˆMÜ 5°kÀ<Ó PÐç ð
 Ò# v°Ô'=ÙØ× Ñ  Ô(ß Ø#×*Ñ*Ù2Ø(Ø$Ø'Ù&<¸\Ó&Jô	õð $×*Ñ*¬4¯=ª=¸Ó+BÔCÙçØ˜\Ô)ÙØ× Ñ  Ô(ð  ×&Ñ&¤t§}¢}°XÓ'>×?ð  ×&Ñ& |×4ñQ *ðX  1×6Ñ6Ô8ô
á8‘�Ø˜\Ñ)ô ŒD�MŠM˜#ÖÙ8ð 	ñ 
ð
 &5°yÕ%@À?Õ%Rˆ�kÔ"ñs 9ðv "Ÿ™ kÓ2ÐØ—^‘^ KÓ0€Nß3Ð3ˆô Ð,¬d×3Ò3ð ×"Ñ" ;Ô/àð 	ô ˜.¬$×/Ò/ð ×Ñ˜{Ô+àð 	ô �~¤tÓ,÷ Ið IÜ”] >Ó2×6Ñ6°ÓGÓHð 	ô
 �z¤4Ó(÷ Eð EÜ”] :Ó.×2Ñ2°?ÓCÓDð 	÷ $×,<ÙäÐ,¬d×3Ò3Ø9;Ð;Ð ¨+Ñ!6Ü�j¤$×'Ò'Ü.2¯mªm¸JÓ.GÐ˜{Ô+ð ×"Ñ" ;°×5ñ; 4ð> €Oùòe
ùò
ùó
ùò

ùód
sH   ÃVÃ+VÅVÅ<"VÆ#VÆ<VÇ'VÈVÈ>VÉVÏV$Ï,V$c               ó    € V ^8„  d   QhRRRR/# )r   r9   r   r   r    r   )r   s   "r   r   r   Ï   s   € ÷ @ñ @�nð @¨ñ @r   c                óh   € \        V P                  R 4      ;'       g    R4      P                  R4      # )Úsourcer$   Úhermes_pkce)r   r   Úendswith)r9   s   &r   Ú_is_pkce_rowri   Ï   s)   € Üˆs�w‰w�xÓ ×&Ð& BÓ'×0Ñ0°Ó?Ð?r   c               ó    € V ^8„  d   QhRRRR/# )r   Úprofile_dirr   r   r   r   )r   s   "r   r   r   Ó   s   € ÷ Lñ L°dð L¸~ñ Lr   c           	     óª  € ^ RI HpHp R. R. R. /p\        V 4      p \         Fb  pW,          p VP                  4       '       g   VP                  4       '       d+   VP                  4        VR,          P                  V4       Kb  Kd  	  V R,          pVP                  4       '       g   V#  ^ R	IHp V! 4       R,          pV! Wh4      '       g.   VP                  4       '       d   VP                  V4      '       d   V#  \"        P$                  ! TP'                  R
R7      4      p	\+        T	\,        4      '       g   T# Rp
T	P/                  R4      p\+        T\,        4      '       d°   \1        T4       F   pTP/                  T4      pT\2        9  g   \+        T\0        4      '       g   K7  T Uu. uF  p\5        YÎ4      '       d   K  TNK  	  pp\7        T4      \7        T4      8w  g   Kv  Rp
TR,          P                  T4       T'       d   YûT&   Kž  Y¼ K¢  	  T	P/                  R4      p\+        T\,        4      '       dv   \8         Fk  pTP/                  T4      p\+        T\,        4      '       g   K,  \;        T4      P/                  R4      '       g   KN  TT TR,          P                  T4       Rp
Km  	  T
'       g   T#  T! Y–R7       T#   \         d    \        P                  RY@RR7        EKÉ  i ; i  \          d    Tu # i ; i  \        \"        P(                  3 d    Rp	 EL i ; iu upi   \          d    \        P                  RTRR7        T# i ; i)ué  Remove forked single-use OAuth grants from a freshly cloned profile.

Called after any path that copies credential files between profiles (``hermes profile create
--clone-all``, the dashboard/TUI ``mirror_credentials`` flow). API-key pool rows are kept â€” a
static key is safe to duplicate. Returns ``{"pool": [...provider ids], "providers": [...],
"files": [...]}`` of what was stripped. Never raises: a clone must not fail because hygiene
could not run â€” the caller logs the summary.
)Ú
_same_pathÚ_save_auth_storeÚpoolr>   Úfilesz"Could not remove cloned %s from %sT©Úexc_infoú	auth.json)Úget_default_hermes_rootú	utf-8-sig©ÚencodingNFr5   r#   ©Útarget_pathz6Failed to strip cloned single-use OAuth grants from %s)r?   rm   rn   r   Ú SINGLE_USE_OAUTH_SINGLETON_FILESÚis_fileÚ
is_symlinkÚunlinkrH   ÚOSErrorÚloggerÚdebugÚhermes_constantsrt   ÚexistsÚsamefileÚ	ExceptionÚjsonÚloadsÚ	read_textÚJSONDecodeErrorr   r   r   rC   rB   r'   ÚlenrI   r   )rk   rm   rn   ÚstrippedÚnameÚtargetÚ	auth_pathrt   Úroot_auth_pathÚstoreÚchangedro   r   ÚentriesÚeÚkeptr>   r   s   &                 r   Ú$strip_cloned_single_use_oauth_grantsr”   Ó   sî  € ÷ =Ø &¨¨K¸¸WÀbÐI€HÜ�{Ó#€Kß0ˆØÕ#ˆð	aØ�~‰~×Ò 6×#4Ñ#4×#6Ò#6Ø—‘”Ø˜Õ!×(Ñ(¨Ö.ñ $7ñ 1ð ˜kÕ)€IØ×Ñ×ÒØˆð
Ý<Ù0Ó2°[Õ@ˆÙ�i×0Ò0Ø×!Ñ!×#Ò#¨	×(:Ñ(:¸>×(JÒ(JàˆOðÜ—
’
˜9×.Ñ.¸Ð.ÓDÓEˆô �eœT×"Ò"ØˆØ€GØ�9‰9Ð&Ó'€DÜ�$œ×ÒÜ ž:ˆKØ—h‘h˜{Ó+ˆGØÔ#DÔDÜ% g¬t×4Ò4ÙÙ&ÓT™w˜!Ô.CÀK×.S—A�A™wˆDÐTÜ�4‹yœC ›LÖ(Ø�Ø˜Õ ×'Ñ'¨Ô4ßØ(,˜Ó%ð Ò)ñ &ð —	‘	˜+Ó&€IÜ�)œT×"Ò"÷ 8ˆKØ—M‘M +Ó.ˆEÜ˜%¤×&Ô&¬=¸Ó+?×+CÑ+CÀO×+TÔ+TØ˜kÐ*Ø˜Õ%×,Ñ,¨[Ô9Ø’ñ 8÷ Øˆð`Ù˜Õ6ð €Oøôu ô 	aÜ�L‰LÐ=¸tÐ[_ˆL×`Ð`ð	aûô  ô ØŠðûô ”T×)Ñ)Ð*ô Ø‹ðüò Uøô. ô `Ü�‰ØDÀiÐZ^ð 	õ 	`à€Oð`úse   ®+KÁ(KÂ*7K/ Ã"K/ Ã9K/ Ã<&L Æ)L&ÇL&Ê9	L+ Ë#K,Ë+K,Ë/K?Ë>K?ÌL#Ì"L#Ì+#MÍMú	list[str]Ú_oauth_heal_noticeszdict[str, tuple[Any, ...]]Ú_oauth_heal_clean_markszoauth_heal_clean.jsonc               ó    € V ^8„  d   QhRRRR/# )r   ÚfingerprintÚtupler   rC   r   )r   s   "r   r   r   4  s   € ÷ /ñ /˜Uð / tñ /r   c                óV   € \         P                  ! \         P                  ! V 4      4      # )zbThe fingerprint as it reads back from JSON (tuples become lists), so the on-disk compare
is exact.)r…   r†   Údumps)r™   s   &r   Ú_json_shaper�   4  s   € ô �:Š:”d—j’j Ó-Ó.Ð.r   c               ó   € V ^8„  d   QhRR/# )r   r   úOptional[Path]r   )r   s   "r   r   r   :  s   € ÷ ñ  ^ñ r   c                 óz   €  ^ RI Hp  V ! 4       P                  R,          \        ,          #   \         d     R# i ; i)z?Where the persisted clean marks live, or None when unavailable.©Ú_auth_file_pathÚcacheN)r?   r¢   ÚparentÚ_OAUTH_HEAL_CLEAN_MARK_FILENAMEr„   r¡   s    r   Ú_oauth_heal_clean_mark_pathr¦   :  s6   € ðÝ3áÓ ×'Ñ'¨'Õ1Ô4SÕSÐSøÜô Úðús   ‚(+ «:¹:c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   zOptional[list]r   )r   s   "r   r   r   D  s   € ÷ 8ñ 8°3ð 8¸>ñ 8r   c                ó  € \        4       pVf   R#  \        P                  ! VP                  RR7      4      p\        T\        4      '       g   R# TP                  T 4      p\        T\        4      '       d   T# R#   \         d     R# i ; i)u  The stored clean-mark fingerprint for ``provider_id``, or None.

Pure cache read: any problem at all (absent, unreadable, corrupt, wrong shape) means "no
mark", which falls through to the locked heal â€” the pre-existing behaviour. It must never
raise into a credential path.
Nru   rv   )	r¦   r…   r†   r‡   r„   r   r   r   rC   )r   ÚpathÚdataÚstoreds   &   r   Ú!_persisted_oauth_heal_fingerprintr¬   D  s}   € ô 'Ó(€DØ‚|ÙðÜ�zŠz˜$Ÿ.™.°+˜.Ó>Ó?ˆô �dœD×!Ò!ÙØ�X‰X�kÓ"€FÜ ¬×-Ò-ˆ6Ð7°4Ð7øô ô Úðús   ’&A; Á;B
Â	B
c               ó$   € V ^8„  d   QhRRRRRR/# ©r   r   r   r™   rš   r   ÚNoner   )r   s   "r   r   r   X  s&   € ÷  ]ñ  ]°ð  ]À%ð  ]ÈDñ  ]r   c                óp  € \        4       pVf   R#  ^ RIHp  \        P                  ! VP                  RR7      4      p\        V\        4      '       g   / pVP                  4        UUu/ uF7  w  rV\        V\        4      '       g   K  \        V\        4      '       g   K5  WVbK9  	  ppp\        V4      pVP                  V 4      V8X  d   R# Y‡V &   ^ RIHp	 V	! VP                   4       V! W'RR7       R#   \         d    / p LÅi ; iu uppi   \         d    \"        P%                  RT R	R
7        R# i ; i)zÁRecord ``provider_id`` as clean for this exact fingerprint.

Best-effort by design: a failed write only means the next process re-runs the heal, which is
what it did before this cache existed.
N)Úatomic_json_writeru   rv   )Úmkdir_under_hermes_homei€  )Úmodez1%s: could not persist the forked-OAuth clean markTrq   )r¦   Úutilsr±   r…   r†   r‡   r„   r   r   rE   r   rC   r�   r   r�   r²   r¤   r   r€   )
r   r™   r©   r±   ÚexistingÚkeyÚvalueÚmarksÚnew_markr²   s
   &&        r   Ú_persist_oauth_heal_clean_markrº   X  s  € ô 'Ó(€DØ‚|Ùð]Ý+ð	Ü—z’z $§.¡.¸+ .Ó"FÓGˆHô ˜(¤D×)Ò)ØˆHà)1¯©Ô)9ô
Ù)9™:˜3Ü˜#œs×#ô Ü(2°5¼$×(?ô ˆCŠJÑ)9ð 	ñ 
ô ˜{Ó+ˆØ�9‰9�[Ó! XÔ-ÙØ%ˆkÑÝ<Ù §¡Ô,á˜$¨E×2øô ô 	ØŠHð	üó
øô ô ]Ü�‰Ø?ÀÐW[ð 	÷ 	]ð]úsQ   ’D ™&C5 ¿+D Á*DÂ	DÂ!DÂ'$D Ã&D Ã5DÄD ÄDÄ	D Ä#D5Ä4D5c               ó$   € V ^8„  d   QhRRRRRR/# r®   r   )r   s   "r   r   r   {  s!   € ÷ =ñ =¨ð =¸%ð =ÀDñ =r   c                ó.   € V\         V &   \        W4       R# )z0Stamp the clean mark both in memory and on disk.N)r—   rº   )r   r™   s   &&r   Ú_mark_oauth_heal_cleanr½   {  s   € à+6Ô˜KÑ(Ü" ;Ö<r   c               ó   € V ^8„  d   QhRR/# )r   r   r•   r   )r   s   "r   r   r   �  s   € ÷ ñ  Iñ r   c                 óH   € ^ RI Hp  \        V 4      pV P                  4        V# )z§Return (and clear) human-readable notes about heals run in this process.

``hermes auth list`` / ``hermes auth status`` print them so the user sees the consolidation.
)r–   )r?   r–   rC   Úclear)r–   Únotess     r   Úconsume_oauth_heal_noticesrÂ   �  s#   € õ
 4ÜÐ$Ó%€EØ×ÑÔØ€Lr   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   zOptional[str]r   )r   s   "r   r   r   Œ  s   € ÷ ñ ˜>ð ¨mñ r   c                óÈ  € ^ RI Hp \        V \        4      '       g   R# V P	                  R4      V P	                  R4      3 F�  p\        V4      pV'       g   K  VP	                  R4      p\        V\        4      '       d   VP	                  R4      MRpWSP	                  R4      VP	                  R4      3 F%  pV! V4      '       g   K  VP                  4       u u # 	  KŸ  	  R# )	uÿ   Stable account identity for an OAuth row when the token carries one.

Codex / xAI access tokens are JWTs with ``sub`` / ``email`` / ``chatgpt_account_id`` claims;
Anthropic ``sk-ant-oat`` tokens carry none (None â†’ lineage rests on id / token material).
©Ú_nonempty_strNr,   Úid_tokenzhttps://api.openai.com/authÚchatgpt_account_idÚsubÚemail)r?   rÆ   r   r   r   r	   r&   )r   rÆ   ÚtokenÚclaimsÚnestedÚaccountr·   s   &      r   Ú_oauth_identityrÏ   Œ  s´   € õ .Ü�eœT×"Ò"ÙØ—)‘)˜NÓ+¨U¯Y©Y°zÓ-BÓCˆÜ# EÓ*ˆßÙØ—‘Ð9Ó:ˆÜ6@ÀÌ×6NÒ6N�&—*‘*Ð1Ô2ÐTXˆØŸz™z¨%Ó0°&·*±*¸WÓ2EÓFˆEÙ˜U×#Ô#Ø—{‘{“}Ô$ó Gñ Dñ r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   Úfloatr   )r   s   "r   r   r   ¡  s   € ÷ ñ ˜Nð ¨uñ r   c                ó  € ^ RI Hp R Uu. uF  q P                  V4      NK  	  pp\        R \	        W4       4       RR7      pVR8X  d<   \        V P                  R4      4      P                  R4      pV! V4      ;'       g    RpV# u upi )zïBest-effort 'how recently was this pair issued' score (epoch seconds).

A rotation always issues a later-expiring access token, so ``expires_at`` ordering identifies
the live copy; ``last_refresh`` and the JWT ``exp`` claim are fallbacks.
)Ú_parse_absolute_timestampc              3  ó8   "  € T F  q'       g   K  Vx € K  	  R # 5ir7   r   )r8   Útss   & r   r:   Ú#_oauth_freshness.<locals>.<genexpr>©  s   é € ÐJÑC�rÃr—’ÓCùs   ‚	�
g        )Údefaultr,   Úexp)Úexpires_at_msÚ
expires_atÚlast_refresh)Úagent.credential_poolrÓ   r   ÚmaxÚmapr	   )r   rÓ   ÚkÚstampsÚbestrØ   s   &     r   Ú_oauth_freshnessrâ   ¡  s   € õ @Ù$SÓTÑ$S˜q�i‰i˜ŽlÑ$S€FÐTÜÑJœSÐ!:ÔCÓJÐTWÔX€DØˆs„{Ü  §¡¨>Ó!:Ó;×?Ñ?ÀÓFˆÙ(¨Ó-×4Ð4°ˆØ€Kùò Us   ‹Bc               ó$   € V ^8„  d   QhRRRRRR/# )r   Úprofile_rowr   Ú	root_rowszlist[dict[str, Any]]r   zOptional[int]r   )r   s   "r   r   r   °  s$   € ÷ ñ ØðØ,@ðØERñr   c                óÆ  € ^ RI Hp \        V4       UUu. uF  w  r4\        V4      '       g   K  VNK  	  pppV'       g   R# V P	                  R4      pV F-  pV'       g   K  W,          P	                  R4      V8X  g   K+  Vu # 	  R FO  pV P	                  V4      pV! V4      '       g   K$  V F%  pW,          P	                  V4      V8X  g   K!  Vu u # 	  KQ  	  R# u uppi )zæIndex of the root OAuth row that shares a grant lineage with *profile_row*.

Only a copied row ID or shared token material establishes lineage. The same
account/client can issue multiple independent grants; identity is not proof.
rÅ   Nr<   )r#   r,   )r?   rÆ   Ú	enumerater%   r   )	rä   rå   rÆ   ÚiÚrÚ
candidatesÚpidr¶   Úp_vals	   &&       r   Ú_find_root_counterpartrí   °  sÁ   € õ .Ü )¨)Ô 4ÔRÑ 4™˜Ô8NÈq×8Q—!�!Ñ 4€JÑRßÙØ
�/‰/˜$Ó
€CÛˆß‰3�9•<×#Ñ# DÓ)¨SÖ0ØŠHñ ó 1ˆØ—‘ Ó$ˆÙ˜U×#Ò#ÙÛˆAØ�|×Ñ Ó$¨Ö-Ø”ó ñ	 1ñ ùó Ss
   •C¯Cc               ó$   € V ^8„  d   QhRRRRRR/# )r   rŒ   r   Úwinnerr   r   )r   s   "r   r   r   É  s!   € ÷ 
ñ 
 .ð 
¸.ð 
È^ñ 
r   c                óì   € ^ RI Hp \        V 4      p\         F4  pVP	                  V4      e   W,          W4&   K"  VP                  VR4       K6  	  VP                  \        P                  V4      4       V# )zGReturn *target* carrying *winner*'s token pair, status markers cleared.)Ú_POOL_STATUS_FIELDSN)r?   rñ   r   Ú_OAUTH_TOKEN_FIELDSr   rJ   ÚupdateÚfromkeys)rŒ   rï   rñ   Úmergedr¶   s   &&   r   Ú_adopt_oauth_materialrö   É  sZ   € å3Ü�&‹\€Fß"ˆØ�:‰:�c‹?Ò&Ø �+ˆF‹Kà�J‰J�s˜DÖ!ñ	 #ð
 ‡M�M”$—-‘-Ð 3Ó4Ô5Ø€Mr   c               ó    € V ^8„  d   QhRRRR/# )r   r©   r   r   úOptional[dict[str, Any]]r   )r   s   "r   r   r   Ö  s   € ÷ 0ñ 0˜Dð 0Ð%=ñ 0r   c                óŠ  €  \         P                  ! V P                  RR7      4      p\        T\        4      '       d9   \        TP                  R4      ;'       g    R4      P                  4       '       g   R# RTP                  R4      RTP                  R4      R	TP                  R
4      /#   \        \        3 d     R# i ; i)zDRead a ``.anthropic_oauth.json`` as a pool-row-shaped dict, or None.ru   rv   NÚaccessTokenr$   r,   r#   ÚrefreshTokenrÙ   Ú	expiresAt)
r…   r†   r‡   r~   Ú
ValueErrorr   r   r   r   r&   )r©   rª   s   & r   Ú_singleton_as_rowrþ   Ö  s£   € ðÜ�zŠz˜$Ÿ.™.°+˜.Ó>Ó?ˆô �dœD×!Ò!¬¨T¯X©X°mÓ-D×-JÐ-JÈÓ)K×)QÑ)Q×)SÒ)SÙà˜Ÿ™ Ó/Ø˜Ÿ™ .Ó1Ø˜Ÿ™ +Ó.ð0ð 0øô	 ”ZÐ ô Úðús   ‚&B- Â-CÃCc               ó    € V ^8„  d   QhRRRR/# ©r   r   r   r   rø   r   )r   s   "r   r   r   ä  s   € ÷ ñ °Sð Ð=Uñ r   c                óˆ   € V \         9  d   R#  \        V 4      #   \         d    \        P	                  RT RR7        R# i ; i)a�  One-time heal for installs that ALREADY forked a single-use grant into a profile.

Forked copies are one credential with several owners: whichever profile rotated last holds the
only live refresh token and every other copy (root included) is spent. Runs at profile
``load_pool()`` time for ``SINGLE_USE_REFRESH_POOL_PROVIDERS``: finds profile rows sharing
LINEAGE with a root row (same pool id or shared token material), keeps the
freshest rotation, writes it into ROOT when root's is older, and strips the profile's copy so
the profile borrows root from then on. Idempotent; never touches API-key rows; never deletes a
row with no root counterpart (an independent ``hermes -p <p> auth add`` grant, or the only
surviving copy); reads only the two auth.json files the root fallback already reads. Returns
``{"adopted", "stripped_ids", "files", "providers_block"}`` when something healed, else None.
Never raises.
Nz%s: forked-OAuth heal skippedTrq   )rB   Ú$_heal_forked_single_use_oauth_grantsr„   r   r€   )r   s   &r   Ú#heal_forked_single_use_oauth_grantsr  ä  sE   € ð Ô;Ô;ÙðÜ3°KÓ@Ð@øÜô Ü�‰Ð4°kÈDˆÔQÚðús   �
 š#AÁ Ac          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   Úprofile_storer   Ú
root_storer   r   Úlineage_provenr    r   zOptional[bool]r   )r   s   "r   r   r   û  s4   € ÷ %ñ %Ø!ð%Ø/=ð%ØLOð%àð%à%3ñ%r   c                ó¸  a
a€ V P                  R4      VP                  R4      rT\        V\        4      '       d   \        V\        4      '       g   R# VP                  V4      VP                  V4      rv\        V\        4      '       d?   \        V4      P                  R4      '       d   \        V\        4      '       d	   V'       g   R# R R lpV! V4      V! V4      uo
oV'       gE   \        ;QJ d     V
V3R lR	 4       F  '       g   K   RM	  RM! V
V3R lR	 4       4      '       g   R# \        S
4      \        S4      8„  p	V	'       d   \        V4      WR&   WB V	# )
aB  Consolidate a forked ``providers.<id>`` device-code block into root.

*lineage_proven* carries the pool-row verdict: a profile row that matched root by copied id
or shared tokens proves the fork even after both sides rotated past token equality. Root's
``load_pool()`` re-seeds its ``device_code`` row FROM this block, so leaving root's block on
the spent pair would undo the pool-row heal on the next root load.

Returns None when nothing matched, False when the profile copy was dropped (root already
newest), True when the profile copy was fresher and was adopted into root.
r>   Nr#   c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   Ú1_heal_forked_provider_block.<locals>.__annotate__  s   € ÷ Sñ S�^ð S¨ñ Sr   c                óB   € / \        V 4      CR V P                  R 4      /C# )rÛ   )r   r   )r   s   &r   Ú_flatÚ*_heal_forked_provider_block.<locals>._flat  s"   € ØR”- Ó&ÐR¨¸¿	¹	À.Ó8QÑRÐRr   c              3  óœ   <"  € T FA  pSP                  V4      ;'       d$    SP                  V4      SP                  V4      8H  x € KC  	  R # 5ir7   )r   )r8   r¶   Úp_flatÚr_flats   & €€r   r:   Ú._heal_forked_provider_block.<locals>.<genexpr>  s@   øé € ð &á4ˆCð 	�
‰
�3‹×>Ð>˜FŸJ™J s›O¨v¯z©z¸#«Ñ>Ô>Û4ùs
   ƒA ,ATF)r,   r#   )r   r   r   r   rD   râ   )r  r  r   r  Úp_providersÚr_providersÚp_blockÚr_blockr  Úadoptedr  r  s   &&&&      @@r   Ú_heal_forked_provider_blockr  û  s  ù€ ð  -×0Ñ0°Ó=¸z¿~¹~ÈkÓ?Z�Ü�{¤D×)Ò)¬j¸Äd×.KÒ.KÙØ"—‘ {Ó3°[·_±_À[Ó5QˆWÜ�w¤×%Ò%¬-¸Ó*@×*DÑ*DÀ_×*UÒ*UÜ˜7¤D×)Ò)¯gÙõSñ ˜7“^¡U¨7£^€N€FˆF÷ §#£#õ &á4ó&§#§#¢#õ &á4ó&÷ #ò #ñ Ü˜vÓ&Ô)9¸&Ó)AÑA€GßÜ#'¨£=ˆÑ ØÐ Ø€Nr   c               ó    € V ^8„  d   QhRRRR/# )r   ÚprŸ   r   z#Optional[tuple[int, int, int, int]]r   )r   s   "r   r   r   #  s   € ÷ :ñ :�ð :Ð$Gñ :r   c                óv   €  V e   V P                  4       MRpTe   \        T4      # R#   \         d     R# i ; i)uœ   File signature from ONE stat, or None when absent â€” a torn pair from two stats could
leave a persisted clean mark matching a store rewritten between them.N)Ústatr~   r
   )r  Ústs   & r   Ú	_stat_sigr  #  sB   € ðØšˆQ�V‰VŒX¨Dˆð "$¢Œ>˜"ÓÐ9°TÐ9øô ô Úðús   ‚) ©8·8c               ó$   € V ^8„  d   QhRRRRRR/# )r   r�   r   r   r   r   ztuple[Any, list[Any]]r   )r   s   "r   r   r   -  s"   € ÷ 8ñ 8�nð 8°3ð 8Ð;Pñ 8r   c                ó°   € V P                  R4      p\        V\        4      '       d   VP                  V4      MRpT\        V\        4      '       d   V3# . 3# )uY   ``(store["credential_pool"], its provider_id rows-or-[])`` â€” pool may be None/non-dict.r5   N)r   r   r   rC   )r�   r   ro   Úrowss   &&  r   Ú
_pool_rowsr!  -  sL   € à�9‰9Ð&Ó'€DÜ$.¨t´T×$:Ò$:ˆ4�8‰8�KÔ À€DØœ D¬$×/Ò/�Ð7Ð7°RÐ7Ð7r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   Ú
auth_storer   r   r   Úsource_pathrŸ   r   r    r   )r   s   "r   r   r   4  s,   € ÷ 
4ñ 
4Ø"ð
4Ø14ð
4ØCQð
4ØVZñ
4r   c                ó¦   € ^ RI HpHp V! 4       p\        VRJ;'       d/    VRJ;'       d#    V! W%4      ;'       d    \	        W4      ^,          4      # )zñTrue when a profile that owns its own pool rows would seed ``providers.<id>`` from ROOT.

Seeding that state re-copies root's single-use refresh token into the profile's pool, which
is the fork #100339 forbids; the singleton seeders skip it.)Ú_global_auth_file_pathrm   N)r?   r&  rm   r    r!  )r#  r   r$  r&  rm   Úglobal_roots   &&&   r   Úowned_profile_reads_root_stater(  4  s^   € ÷ CÙ(Ó*€KÜØ˜4Ð÷ 	3ð 	3 K°tÐ$;÷ 	3ð 	3Á
È;Ó@d÷ 	3ð 	3Ü�zÓ/°Õ2ó4ð 4r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rŒ   r   Ú	candidater   rø   r   )r   s   "r   r   r   A  s)   € ÷ Iñ IØðIØ'5ðIØ:RñIr   c                óZ   € \        V4      \        V 4      8„  pV'       d   \        W4      # R# )zQ*target* carrying *candidate*'s pair when the candidate rotated later, else None.N)râ   rö   )rŒ   r*  Úfreshers   && r   Ú_adopt_if_fresherr-  A  s,   € ô ˜yÓ)Ô,<¸VÓ,DÑD€Gß7>Ô  Ó3ÐHÀDÐHr   c                  ó�   € ] tR tRtRtR R ltR R ltR R 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tRtR# )Ú	_HealPassiH  zGOne heal pass over a profile store vs the root store for *provider_id*.c               ó   € V ^8„  d   QhRR/# )r   Úroot_singletonrŸ   r   )r   s   "r   r   Ú_HealPass.__annotate__K  s   € ÷ Qñ QÈ~ñ Qr   c                	óº  € WuV n         V n        W0n        R RR. R. RR/V n        R;V n        V n        RV n        \        W4      w  V n        V n	        \        W#4      w  V n
        V n        V P                   Uu. uF  p\        V4      '       g   K  VNK  	  upV n        W@n        Ve)   VP                  4       '       d   \!        V4      V n        R# RV n        R# u upi )r  FÚstripped_idsrp   Úproviders_blockN)r  r  r   ÚsummaryÚprofile_changedÚroot_changedr  r!  Úp_poolÚp_rowsÚr_poolÚr_rowsr%   Úr_oauthr1  r‚   rþ   Úroot_singleton_row)Úselfr  r  r   r1  ré   s   &&&&& r   Ú__init__Ú_HealPass.__init__K  sÕ   € Ø.;Ð+ˆÔ˜DœOØ&Ôà�u˜n¨b°'¸2Ð?PÐRWð(YˆŒà38Ð8ˆÔ˜tÔ0Ø#ˆÔÜ#-¨mÓ#IÑ ˆŒ�T”[Ü#-¨jÓ#FÑ ˆŒ�T”[Ø#'§;¢;ÓL¡;˜aÔ2HÈ×2KŸ˜¡;ÑLˆŒØ,Ôð Ò)¨n×.CÑ.C×.EÒ.Eô ˜nÓ-ð 	ÖàKOð 	Öùò Ms   Á7CÂCc               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚidxÚintr9   r   r   r¯   r   )r   s   "r   r   r2  Z  s!   € ÷ ?ñ ? 3ð ?¨^ð ?Àñ ?r   c                	ó”   € \        V P                  V,          V4      pVe'   W0P                  V&   R;V n        V P                  R&   R # R # ©NTr  )r-  r<  r8  r6  )r?  rC  r9   rõ   s   &&& r   Ú_adopt_root_rowÚ_HealPass._adopt_root_rowZ  sD   € Ü" 4§;¡;¨sÕ#3°SÓ9ˆØÒØ%�K‰K˜ÑØ:>Ð>ˆDÔ §¡¨YÓ 7ñ r   c               ó    € V ^8„  d   QhRRRR/# )r   r9   r   r   r¯   r   )r   s   "r   r   r2  `  s   € ÷ +ñ +¨ð +¸Dñ +r   c                	óh   € \        V P                  V4      pVe   W n        RV P                  R&   R # R # rF  )r-  r>  r6  )r?  r9   rõ   s   && r   Ú_adopt_root_singletonÚ_HealPass._adopt_root_singleton`  s3   € Ü" 4×#:Ñ#:¸CÓ@ˆØÒØ&,Ô#Ø&*ˆD�L‰L˜Ó#ñ r   c               ó   € V ^8„  d   QhRR/# ©r   r   r¯   r   )r   s   "r   r   r2  f  s   € ÷ 8ñ 8 ñ 8r   c                	ó  € . pV P                    F÷  p\        V P                  V4      '       g   VP                  V4       K2  \	        W P
                  4      pVe   RV n        V P                  W24       M[VP                  R4      R8X  d3   V P                  e%   V P                  '       g   V P                  V4       MVP                  V4       K¿  V P                  R,          P                  VP                  R4      4       RV n        Kù  	  V P                  '       dm   \        V P                  \         4      '       dK   V'       d   WP                  V P                  &   R # V P                  P#                  V P                  R 4       R # R # R # )NTrf   rg   r4  r<   )r:  r'   r   rH   rí   r<  r  rG  r   r>  r=  rK  r6  r7  r   r9  r   rJ   )r?  Ú	kept_rowsr9   Ú	match_idxs   &   r   Úheal_pool_rowsÚ_HealPass.heal_pool_rowsf  s)  € Ø!ˆ	Ø—;”;ˆCÜ(¨×)9Ñ)9¸3×?Ò?à× Ñ  Ô%ÙÜ.¨s·K±KÓ@ˆIØÒ$Ø&*�Ô#Ø×$Ñ$ YÕ4ð —‘˜Ó" mÔ3¸×8OÑ8OÒ8[Ðdh×dp×dpÐdpØ×*Ñ*¨3Õ/ð × Ñ  Ô%ÙØ�L‰L˜Õ(×/Ñ/°·±¸³Ô>Ø#'ˆDÖ ñ) ð* ××Ð¤J¨t¯{©{¼D×$AÒ$AßØ09—‘˜D×,Ñ,Ó-à—‘—‘ × 0Ñ 0°$Ö7ñ	 %BÑr   c               ó   € V ^8„  d   QhRR/# rN  r   )r   s   "r   r   r2  ƒ  s   € ÷ Cñ C Tñ Cr   c                	ó  € V P                   \        9  d   R # \        V P                  V P                  V P                   V P
                  4      pVe9   R;V n        V P                  R&   V'       d   R;V n        V P                  R&   R # R # R # )NTr5  r  )	r   rI   r  r  r  r  r7  r6  r8  )r?  Úblock_results   & r   Úheal_provider_blockÚ_HealPass.heal_provider_blockƒ  s~   € Ø×ÑÔ#?Ô?ÙÜ2Ø×Ñ §¡°×1AÑ1AÀ4×CVÑCVóXˆàÒ#ØEIÐIˆDÔ  4§<¡<Ð0AÑ#BßØ>BÐB�Ô! D§L¡L°Ó$;ñ ñ $r   c               ó    € V ^8„  d   QhRRRR/# )r   Úprofile_singletonrŸ   r   r¯   r   )r   s   "r   r   r2  �  s   € ÷ Rñ R¸ð RÈ4ñ Rr   c                	ó¦  € Ve   VP                  4       '       g   R # ^ RIHp V P                  e   V! WP                  4      '       d   R # \	        V4      p\        V P                  4      ;'       g    V P                  R JpVe	   V'       g   R # V P                  e   V P                  V4       M;\        R \        V P                  4       4       R 4      pVe   V P                  WS4        VP                  4        V P                  R,          P                  VP                   4       R #   \"         d    \$        P'                  RTRR7        R # i ; i)N)Ú_is_same_auth_storec              3  óv   "  € T F/  w  r\        V4      '       g   K  \        V4      '       g   K+  Vx € K1  	  R # 5ir7   )r%   ri   ©r8   rè   ré   s   &  r   r:   Ú3_HealPass.heal_profile_singleton.<locals>.<genexpr>   s0   é € ð CÑ5‘t�qÜ*¨1×-ô Ü2>¸q·/÷ ’Ó5ùs   ‚9œ9¯
9rp   zcould not remove %sTrq   )r‚   r?   r\  r1  rþ   r    r=  r>  rK  Únextrç   r<  rG  r}   r6  rH   r‹   r~   r   r€   )r?  rZ  r\  Úp_singleÚroot_has_grantrC  s   &&    r   Úheal_profile_singletonÚ _HealPass.heal_profile_singleton�  s"  € ØÒ$Ð,=×,DÑ,D×,FÒ,FÙÝ7Ø×ÑÒ*Ñ/BÐCT×ViÑVi×/jÒ/jÙä$Ð%6Ó7ˆÜ˜dŸl™lÓ+×RÐR¨t×/FÑ/FÈdÐ/Rˆð Ò§>ÙØ×"Ñ"Ò.Ø×&Ñ& xÕ0ô ñCœy¨¯©Ô5ó CØDHóJˆCð ŠØ×$Ñ$ SÔ3ð	RØ×$Ñ$Ô&Ø�L‰L˜Õ!×(Ñ(Ð):×)?Ñ)?Ö@øÜô 	RÜ�L‰LÐ.Ð0AÈDˆL×Qð	Rús   Ã+<D) Ä)#EÅEc               ó   € V ^8„  d   QhRR/# rN  r   )r   s   "r   r   r2  ª  s   € ÷ %ñ %°4ñ %r   c                óÚ  € V P                   R,          '       d   V P                  e   V P                  f   R# \        R \	        V P
                  4       4       R4      pVf   R# V P
                  V,          p\        V4      p\        V P                  4      pW48”  d   \        V P                  V4      V n        R# WC8”  d,   \        W P                  4      V P
                  V&   RV n        R# R# )zòKeep root's singleton and its ``hermes_pkce``-seeded pool row in step.

Root's next load_pool() re-seeds that row FROM the singleton file, so a stale file would
resurrect the spent pair (and a stale row would be overwritten by a fresh file).
r  Nc              3  ó€   "  € T F4  w  r\        V4      '       g   K  VP                  R 4      R8X  g   K0  Vx € K6  	  R# 5i)rf   rg   N)r%   r   r^  s   &  r   r:   Ú>_HealPass.sync_root_singleton_with_pkce_row.<locals>.<genexpr>µ  s9   é € ð PÑ1‘4�1Ü& q×)ô Ø./¯e©e°H«oÀÑ.N÷ ŠQÓ1ùs   ‚>œ>´
>T)	r6  r1  r>  r`  rç   r<  râ   rö   r8  )r?  Úpkce_idxÚpkce_rowÚ	row_freshÚsingle_freshs   &    r   Ú!sync_root_singleton_with_pkce_rowÚ+_HealPass.sync_root_singleton_with_pkce_rowª  sÍ   € ð �L‰L˜×#Ô#¨×(;Ñ(;Ò(GØ×'Ñ'Ò3ÙÜñPœ9 T§[¡[Ô1ó PØQUóWˆð ÒÙØ—;‘;˜xÕ(ˆÜ$ XÓ.ˆ	Ü'¨×(?Ñ(?Ó@ˆØÔ#Ü&;¸D×<SÑ<SÐU]Ó&^ˆDÖ#ØÔ%Ü$9¸(×D[ÑD[Ó$\ˆD�K‰K˜Ñ!Ø $ˆDÖñ &r   c               ó   € V ^8„  d   QhRR/# )r   r   r    r   )r   s   "r   r   r2  Ã  s   € ÷ Zñ Z�tñ Zr   c                	óŠ   € \        V P                  ;'       g(    V P                  ;'       g    V P                  R ,          4      # )r  )r    r7  r8  r6  )r?  s   &r   ÚdirtyÚ_HealPass.dirtyÂ  s2   € ä�D×(Ñ(×XÐX¨D×,=Ñ,=×XÐXÀÇÁÈiÕAXÓYÐYr   c               ó    € V ^8„  d   QhRRRR/# )r   Úprofile_namer   r   r   )r   s   "r   r   r2  Æ  s   € ÷ Bñ B 3ð B¨3ñ Br   c           	     	ó†  € V P                   pR VR,           2VR,          3RV P                   R2VR,          3RP                  VR,          4      VR,          33 UUu. uF  w  r4V'       g   K  VNK  	  pppVR,          '       d   RMR	pR
T RV P                   RRP                  V4      ;'       g    R RV R2	# u uppi )z
pool rows r4  z
providers.z blockr5  z, rp   r  z,profile copy was the live pair; root updatedz.root copy already newest; profile copy droppedzprofile z: consolidated forked z OAuth grant (z; zno-opu   ) into the root grant â€” z3; this profile now borrows the root grant (#100339))r6  r   Újoin)r?  rt  r6  ÚbitÚpresentÚlog_bitsÚverdicts   &&     r   ÚnoticeÚ_HealPass.noticeÆ  sü   € Ø—,‘,ˆà˜' .Õ1Ð2Ð3°W¸^Õ5LÐMØ˜$×*Ñ*Ð+¨6Ð2°GÐ<MÕ4NÐOØ�Y‰Y�w˜wÕ'Ó(¨'°'Õ*:Ð;ñ-=ô Iñ -=™L˜Cô AH÷ �Cñ -=ˆñ Ið �y×!Ô!ñ ;Ø'Wð 	ð �|�nÐ$:¸4×;KÑ;KÐ:Lð MØ—	‘	˜(Ó#×.Ð. wÐ/Ð/IÈ'Èð S@ðAð	BùóIs   ÁB=Á/B=)r  r9  r:  r7  r  r   r=  r;  r<  r8  r1  r>  r  r6  N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r@  rG  rK  rR  rW  rc  rm  Úpropertyrq  r{  Ú__static_attributes__r   r   r   r/  r/  H  sM   † ÙQõQõ?õ+õ8õ:CõRõ:%ð0 ôZó ðZ÷Bñ Br   r/  c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r   Õ  s   € ÷ Yñ Y°cð YÐ>Vñ Yr   c                ó8  € ^ RI HpHpHpHpHpHpHpHpH	p	 V! 4       p
V
f   R# \        P                  P                  R4      '       dQ   \        P                  P                  RR4      pV'       d)   V! V
\        V4      R,          R,          4      '       d   R# V! 4       pVP                  pV R8H  pV'       d
   VR	,          MRpV'       d   V
P                  R	,          MRp\        V4      \!        V4      \!        V4      \        V
4      \!        V
4      \!        V4      3pVP                  V 4      V8X  d   R# \#        V 4      \%        V4      8X  d   VW`&   R# V^,          f   V^,          f   \'        V V4       R# V! WÊ4      '       d%   \'        V V4       \(        P+                  R
W4       R# V! 4       ;_uu_ 4        VP-                  4       '       d	   V! V4      MR/ /pV! V
R7      ;_uu_ 4        V
P-                  4       '       d	   V! V
4      MR/ /p\/        VVV V4      pVP1                  4        VP3                  4        VP5                  V4       VP6                  '       g    \'        V V4        RRR4       RRR4       R# VP9                  4        VP:                  pVP<                  '       dV   \?        VP@                  \B        4      '       d   VPD                  VP@                  V &   MV VPD                  /VR&   V	! VV
R7       VPF                  pVR,          '       dR   VeN   VeJ   ^ RI$H%p T! VP                  R4      ;'       g    RVP                  R4      VP                  R4      VR7       VPL                  '       d!   VP-                  4       '       d   V	! VVR7       RRR4       RRR4       XPO                  VPP                  4      p\(        PS                  V4       VPU                  V4       X#   + '       g   i     L[; i  + '       g   i     Lf; i)é    )	r¢   Ú_auth_store_lockr&  Ú_load_auth_storer\  r—   r–   rm   rn   NÚPYTEST_CURRENT_TESTÚHOMEr$   z.hermesrs   Ú	anthropicú.anthropic_oauth.jsonz3%s: forked-OAuth heal skipped, %s is the root storer>   rx   r5   r  )Ú_write_hermes_oauth_credentialsr,   r#   rÙ   )rŒ   )+r?   r¢   r‡  r&  rˆ  r\  r—   r–   rm   rn   ÚosÚenvironr   r   r¤   r   r  r¬   r�   r½   r   r€   r‚   r/  rR  rW  rc  rq  rm  r6  r8  r   r;  r   r<  r>  Úagent.anthropic_credentialsr�  r7  r{  r‹   ÚinforH   )r   r¢   r‡  r&  rˆ  r\  r—   r–   rm   rn   Ú	root_pathÚreal_home_envÚprofile_pathÚprofile_homeÚis_anthropicrZ  r1  r™   r  r  Úrunr6  Úsingleton_rowr�  Úmessages   &                        r   r  r  Õ  sZ  € ÷÷ õ ñ 'Ó(€IØÒÙÜ	‡z�z‡~�~Ð+×,Ò,ô Ÿ
™
Ÿ™ v¨rÓ2ˆß™Z¨	´4¸Ó3FÈÕ3RÐU`Õ3`×aÒaÙÙ"Ó$€LØ×&Ñ&€LØ +Ñ-€LßBN˜Ð'>Ö>ÐTXÐßCO�Y×%Ñ%Ð(?Ö?ÐUY€Nô 	ˆLÓœ9 \Ó2´IÐ>OÓ4PÜˆI‹œ	 )Ó,¬i¸Ó.Gð€Kð ×"Ñ" ;Ó/°;Ô>Ùô )¨Ó5¼À[Ó9QÔQØ/:ÐÑ,ÙØ�1…~Ò +¨a¥.Ò"8Ü˜{¨KÔ8ÙÙ˜<×3Ò3ô
 	˜{¨KÔ8ä�‰ÐJÈKÔfÙñ 
×	Õ	à.:×.AÑ.A×.CÒ.CÑ˜\Ô*È+ÐWYÐIZð 	á¨)×4Ö4Ø8A×8HÑ8H×8JÒ8JÑ)¨)Ô4ÐQ\Ð^`ÐPaˆJÜ˜M¨:°{ÀNÓSˆCØ×ÑÔ Ø×#Ñ#Ô%Ø×&Ñ&Ð'8Ô9Ø—9—9�9Ü& {°KÔ@Ø÷ 5÷ 
Ñ	ð ×1Ñ1Ô3Ø—k‘kˆGØ××ÐÜ˜cŸj™j¬$×/Ò/Ø.1¯j©j�C—J‘J˜{Ò+à5@À#Ç*Á*Ð4M�JÐ0Ñ1Ù  ¸ÕCØ×2Ñ2ˆMØ�y×!Ô! nÒ&@À]ÒE^ÝWÙ/Ø!×%Ñ% nÓ5×;Ð;¸¸]×=NÑ=NÈÓ=_Ø!×%Ñ% oÓ6¸~õOð ×"×"Ð" |×':Ñ':×'<Ò'<Ù  ¸LÕI÷1 5÷ 
ð8 �j‰j˜×*Ñ*Ó+€GÜ
‡K�K�ÔØ×Ñ˜wÔ'Ø€N÷9 5×4ú÷ 
×	úsP   Æ;4P	Ç/BO6	É0P	Ê-O6	Ê0A/O6	Ì 'O6	Í:O6	ÎO6	Î
O6	Î#P	Ï6PÐP	Ð	P	>   r"   r‹  ú	xai-oauthúopenai-codex)rŒ  )r›  rš  r"   )r,   r#   rÚ   rÙ   rÛ   )F)8Ú__conditional_annotations__r�  Ú
__future__r   r@   r…   ÚloggingrŽ  Úpathlibr   Útypingr   r   r   r   r   Úhermes_cli.auth_constantsr	   r´   r
   Ú	getLoggerr   Ú	frozensetrB   rz   rI   r   r'   r%   rc   ri   r”   rò   r–   Ú__annotations__r—   r¥   r�   r¦   r¬   rº   r½   rÂ   rÏ   râ   rí   rö   rþ   r  r  r  r!  r(  r-  r/  r  )rœ  s   @r   Ú<module>r¥     s  øðôõ #ã Û Û Û 	Ý ß 3Õ 3Ý 8Ý  ð 
×	Ò	Ð,Ó	-€ñ %.Ò.`Ó$aÐ !ð $>Ð  ð
  EÐ õ9õXõJõKõZ@õLð^TÐ ð "$Ð �YÓ #ð 79Ð Ð3Ó 8ð #:Ð õ/õõ8õ( ]õF=õõõ*õõ2
õ0õ÷.%õP:õ8õ
4õI÷JBñ JB÷ZYr   