+
    iHàj  ã                  óF  a € 0 t $ R t^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	H
t
Ht RtRtRt]! ]]04      t]! R04      tR	 R
 lt]! RR7       ! R R4      4       tR R ltR&tR R ltR R ltR R ltR R ltRR'RR(RR)RR*/tR]R&   R R ltR  R! ltR" R# ltR$ R% ltR# )+aQ  Usage-window allowances as the server sends them: one list, in display order.

The Portal account (``usage_window.gauges``) and the API (``x-nous-credits-window-gauges``, also on the 402)
send the same shape, so Hermes draws whatever arrives and a new allowance needs no Hermes release.
``scope`` says which models a full gauge stops: ``all`` = every paid model, ``top_tier`` = the models the
gateway marks top tier. Free models draw on nothing.

Hermes keeps only its own words for the ids it knows (they are translated and fitted to each surface);
any other id shows the server's ``label``.
)ÚannotationsN)Ú	dataclass)ÚAnyÚIterableÚOptionali'  ÚallÚtop_tierÚpayment_past_duec               ó    € V ^8„  d   QhRRRR/# )é   Úreasonr   ÚreturnÚbool© )Úformats   "Ú7/home/ubuntu/.hermes/hermes-agent/agent/usage_gauges.pyÚ__annotate__r      s   € ÷ +ñ +˜sð + tñ +ó    c                ó   € V \         9   # ©N)ÚPAYMENT_PAUSE_REASONS)r   s   &r   Úpaused_for_paymentr      s   € ØÔ*Ñ*Ð*r   T)Úfrozenc                  óz   € ] tR t^ t$ R]R&   R]R&   R]R&   R]R&   RtR]R	&   ]R
 R l4       t]R R l4       tRt	R# )ÚWindowGaugeÚstrÚidÚscopeÚlabelÚintÚused_bpNúOptional[int]Úresets_at_msc               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   ÚWindowGauge.__annotate__)   s   € ÷ 'ñ '�dñ 'r   c                	ó(   € V P                   \        8¬  # r   )r    ÚBP_FULL©Úselfs   &r   ÚfullÚWindowGauge.full(   s   € à�|‰|œwÑ&Ð&r   c               ó   € V ^8„  d   QhRR/# )r   r   Úfloatr   )r   s   "r   r   r$   -   s   € ÷ :ñ :˜uñ :r   c                	óX   € \        R \        RV P                  \        ,          4      4      # )g      ð?g        )ÚminÚmaxr    r&   r'   s   &r   Úused_fractionÚWindowGauge.used_fraction,   s   € ä�3œ˜C §¡´Õ!7Ó8Ó9Ð9r   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__r"   Úpropertyr)   r0   Ú__static_attributes__r   r   r   r   r       sF   ‡ àƒGØƒJØƒJØƒLØ"&€L�-Ó&àô'ó ð'ð ô:ó ô:r   r   c               ó    € V ^8„  d   QhRRRR/# )r   Úvaluer   r   z!Optional[tuple[WindowGauge, ...]]r   )r   s   "r   r   r   1   s   € ÷ ñ ˜ð Ð Añ r   c                ód  € \        V \        4      '       dG   \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       d   T ;'       g    R# \        V \        4      '       d    \        P
                  ! V 4      p \        V \        4      '       g   R# . p\        4       pV  EFV  p\        V\        4      '       g   K  VP                  R4      VP                  R4      VP                  R4      rep\        V\        4      '       d   V'       d   WB9   g   V\        9  d   K  \        V\        4      '       g,   \        V\        4      '       d   ^ Tu;8:  d   \        8:  g   M KÂ  \        VP                  R4      4      pVP                  R	4      pVP!                  V4       TP#                  \%        YE\        V\        4      '       d'   VP'                  4       '       d   VP'                  4       MTWg4      4       EKY  	  \        V4      ;'       g    R#   \         d     R# i ; i)
u
  The wire list (a JSON array, or its string form from a header) â†’ gauges in order. None when absent,
unreadable or empty. An entry with an unknown scope, a repeated id or a bad percent is dropped: an
older Hermes must never misread a kind of limit it does not know.c              3  óB   "  € T F  p\        V\        4      x € K  	  R # 5ir   )Ú
isinstancer   ©Ú.0Úgs   & r   Ú	<genexpr>Úparse_gauges.<locals>.<genexpr>5   s   é € Ð'RÉEÀq¬
°1´k×(BÐ(BËEùs   ‚FTNr   r   r    r"   r   )r=   Útupler   r   ÚjsonÚloadsÚ
ValueErrorÚlistÚsetÚdictÚgetÚ_SCOPESr   r   r&   Ú_plausible_reset_msÚaddÚappendr   Ústrip)	r:   ÚoutÚseenÚitemÚgidr   ÚbpÚresetr   s	   &        r   Úparse_gaugesrV   1   s‘  € ô �%œ×Ò§C£CÑ'RÉEÓ'R§C§C¢CÑ'RÉEÓ'R×$RÒ$RØ�}ˆ}˜ÐÜ�%œ×Òð	Ü—J’J˜uÓ%ˆEô �eœT×"Ò"ÙØ€CÜ“U€DÜˆÜ˜$¤×%Ò%ÙØŸ™ $›¨¯©°'Ó):¸D¿H¹HÀYÓ<O�BˆÜ˜#œs×#Ò#¯3°#´+ÀÌgÔAUÙÜ�bœ$×Ò¤z°"´c×':Ò':À!ÀrÖBTÌWÖBTÙÜ# D§H¡H¨^Ó$<Ó=ˆØ—‘˜Ó!ˆØ�‰�ŒØ�
‰
”;˜s¼JÀuÌc×<RÒ<RÐW\×WbÑWb×WdÒWd¨5¯;©;¬=ÐjmØ!ó*÷ 	+ñ ô �‹:×Ð˜Ðøô' ô 	Úð	ús   Á4H  È H/È.H/c               ó    € V ^8„  d   QhRRRR/# )r   r:   r   r   r!   r   )r   s   "r   r   r   U   s   € ÷ Tñ T˜sð T }ñ Tr   c                óÐ   € \        V \        4      '       d   \        V \        4      '       d   R # ^ T u;8  d.   \        P                  ! 4       R,          \        ,           8:  d   V #  R # )Niè  )r=   r   r   ÚtimeÚ_RESET_MAX_AHEAD_MS)r:   s   &r   rL   rL   U   sI   € Ü�eœS×!Ò!¤Z°´t×%<Ò%<ÙØ˜ÖI¤§¢£¨tÕ!3Ô6IÕ!IÔIˆ5ÐSÐIÈtÐSr   c               ó    € V ^8„  d   QhRRRR/# )r   ÚgaugesúIterable[WindowGauge]r   ztuple[WindowGauge, ...]r   )r   s   "r   r   r   [   s   € ÷ <ñ <Ð+ð <Ð0Gñ <r   c                óZ   € \         ;QJ d    . R  V  4       F  NK  	  5# ! R  V  4       4      # )c              3  óR   "  € T F  qP                   \        8X  g   K  Vx € K  	  R # 5ir   )r   Ú	SCOPE_ALLr>   s   & r   rA   Úall_scope.<locals>.<genexpr>\   s   é € Ð;™F�q§g¡g´Ñ&:—’›Fùó   ‚'�
')rC   ©r\   s   &r   Ú	all_scoperd   [   s$   € ßŒ5Ñ;™FÓ;�5Ð;ˆ5Ñ;™FÓ;Ó;Ð;r   c               ó    € V ^8„  d   QhRRRR/# ©r   r\   r]   r   zOptional[WindowGauge]r   )r   s   "r   r   r   _   s    € ÷ Hñ HÐ0ð HÐ5Jñ Hr   c                ó(   € \        R  V  4       R4      # )c              3  óR   "  € T F  qP                   \        8X  g   K  Vx € K  	  R # 5ir   )r   ÚSCOPE_TOP_TIERr>   s   & r   rA   Ú!top_tier_gauge.<locals>.<genexpr>`   s   é € Ð@™F�q§g¡g´Ñ&?—’›Fùrb   N)Únextrc   s   &r   Útop_tier_gaugerl   _   s   € ÜÑ@™FÓ@À$ÓGÐGr   c               ó    € V ^8„  d   QhRRRR/# rf   r   )r   s   "r   r   r   c   s   € ÷ 	.ñ 	.Ð/ð 	.Ð4Iñ 	.r   c                óÆ   € \        V 4      pV'       g   R# V Uu. uF  q"P                  '       g   K  VNK  	  ppV'       d   \        VR R7      # \        VR R7      # u upi )uÉ   The all-scope gauge that binds: of the full ones, the one that frees up LAST (with the day and the
week both full, the day's reset alone lets nothing through); else the fullest (ties â†’ first listed).Nc                ó.   € V P                   ;'       g    ^ # )é    )r"   ©r@   s   &r   Ú<lambda>Úbinding_gauge.<locals>.<lambda>k   s   €  q§~¡~×':Ð':¸Ð':r   )Úkeyc                ó   € V P                   # r   )r    rq   s   &r   rr   rs   l   s   €  1§9¢9r   )rd   r)   r/   )r\   Úallsr@   r)   s   &   r   Úbinding_gaugerw   c   sR   € ô �VÓ€DßÙÙÓ&‘t�!Ÿv�v�AˆA‘t€DÐ&ßÜ�4Ñ:Ô;Ð;ÜˆtÑ,Ô-Ð-ùò 's
   šA²AÚdayÚweekÚmonthz$dict[str, tuple[str, str, str, str]]Ú_WORDSc               ó    € V ^8„  d   QhRRRR/# )r   r@   r   r   z#Optional[tuple[str, str, str, str]]r   )r   s   "r   r   r   x   s   € ÷ ñ ˆkð ÐAñ r   c                ó@   € \         P                  V P                  4      # r   )r{   rJ   r   rq   s   &r   Ú_wordsr~   x   s   € Ü�:‰:�a—d‘dÓÐr   c               ó    € V ^8„  d   QhRRRR/# ©r   r@   r   r   r   r   )r   s   "r   r   r   |   ó   € ÷ 1ñ 1�;ð 1 3ñ 1r   c                óR   € \        V 4      ;p'       d
   V^ ,          # V P                  # )zKRow title in ``/usage``: ``Today``; an unknown id shows the server's label.©r~   r   ©r@   Úws   & r   Úgauge_titler†   |   ó!   € ä ›�N�A–Nˆ1ˆQ�4Ð0¨¯©Ð0r   c               ó    € V ^8„  d   QhRRRR/# r€   r   )r   s   "r   r   r   �   s   € ÷ 1ñ 1˜ð 1¨ñ 1r   c                óR   € \        V 4      ;p'       d
   V^,          # V P                  # )zT``You've hit your <name> limit``: ``daily``; an unknown id shows the server's label.rƒ   r„   s   & r   Úgauge_limit_namerŠ   �   r‡   r   c               ó    € V ^8„  d   QhRRRR/# r€   r   )r   s   "r   r   r   †   r�   r   c                óR   € \        V 4      ;p'       d
   V^,          # V P                  # )zKPicker summary row name: ``today``; an unknown id shows the server's label.rƒ   r„   s   & r   Úgauge_shortr�   †   r‡   r   l    ¯9 )ÚTodayÚtodayÚdailyr�   )z	This weekz	this weekÚweeklyry   )z
This monthz
this monthÚmonthlyrz   )zLarge models (monthly)zyour monthly large-model usagezmonthly large-modelzlarge models (monthly)) Ú__conditional_annotations__Ú__doc__Ú
__future__r   rD   rY   Údataclassesr   Útypingr   r   r   r&   r`   ri   Ú	frozensetrK   r   r   r   rV   rZ   rL   rd   rl   rw   r{   r6   r~   r†   rŠ   r�   )r“   s   @r   Ú<module>r™      sÒ   øðô	õ #ã Û Ý !ß *Ñ *à
€Ø€	Ø€Ù
�Y Ð/Ó
0€ñ "Ð#5Ð"6Ó7Ð õ+ñ �$Ô÷:ð :ó ð:õ ðB 'Ð õTõ<õHõ	.ð 
Ð/Ø
Ð8ØÐ=ØÐ}ð	0€Ð,ó õõ1õ
1÷
1r   