+
    jHàj  ã                  óR   € R t ^ RIHt ^ RIt^ RIt^ RItR R ltR R ltR R ltR# )	uz  ``hermes usage`` â€” the account-limits block of the REPL ``/usage`` without starting a session.

Script-friendly Codex / Anthropic / OpenRouter quota view (issue #33094): same fetch and renderer as
``/usage`` (``agent.account_usage``), same credential resolution as a session with no live agent, plus
``--json`` for cron jobs and shell loops. Slim redo of #81819 (@himanusia).
)ÚannotationsNc               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚdict© )Úformats   "ÚA/home/ubuntu/.hermes/hermes-agent/hermes_cli/subcommands/usage.pyÚ__annotate__r
      s   € ÷ ñ ¨ñ ó    c                óÂ  € RV P                   RV P                  RV P                  RV P                  RV P                  P                  4       RV P                   Uu. uFW  pRVP                  RVP                  R	VP                  '       d   VP                  P                  4       MR
RVP                  /NKY  	  upR\        V P                  4      RV P                  /# u upi )u–   ``hermes usage --json`` document. Schema is documented in website/docs/reference/cli-commands.md â€”
keep the keys stable; extend only by adding keys.ÚproviderÚsourceÚtitleÚplanÚ
fetched_atÚwindowsÚlabelÚused_percentÚ	resets_atNÚdetailÚdetailsÚunavailable_reason)r   r   r   r   r   Ú	isoformatr   r   r   Úreset_atr   Úlistr   r   )ÚsnapshotÚwindows   & r	   Úusage_snapshot_documentr      sÐ   € ð 	�H×%Ñ%Ø�(—/‘/Ø�—‘Ø�—‘Ø�h×)Ñ)×3Ñ3Ó5Øð #×*Ò*ó
ñ +�ð ˜Ÿ™Ø × 3Ñ 3Ø¸F¿O¿O¸O˜VŸ_™_×6Ñ6Ô8ÐQUØ˜&Ÿ-™-ó	ñ +ñ
ð 	”4˜×(Ñ(Ó)Ø˜h×9Ñ9ð!ð ùò
s   Á/CÂ
-Cc               ó    € V ^8„  d   QhRRRR/# )r   Úargszargparse.Namespacer   Úintr   )r   s   "r	   r
   r
   &   s   € ÷ ñ Ð&ð ¨3ñ r   c                ó`  € ^ RI HpHp ^ RIHp V! \        V RR4      4      pV! V4      pVf"   \        RV R2\        P                  R7       ^# \        V RR	4      '       d-   \        \        P                  ! \        V4      ^R
7      4       ^ # \        RP                  V! V4      4      4       ^ # )zgPrint the configured (or ``--provider``) account's usage windows; exit 1 when nothing could be fetched.)Úfetch_account_usageÚrender_account_usage_lines)Úresolve_requested_providerr   Nz)No account usage available for provider 'z_': no credential is configured for it, the provider has no usage endpoint, or the fetch failed.)ÚfileÚjsonF)ÚindentÚ
)Úagent.account_usager#   r$   Úhermes_cli.runtime_providerr%   ÚgetattrÚprintÚsysÚstderrr'   Údumpsr   Újoin)r    r#   r$   r%   r   r   s   &     r	   Ú	cmd_usager2   &   sž   € çSÝFá)¬'°$¸
ÀDÓ*IÓJ€Hñ # 8Ó,€HØÒÜØ7¸°zð BGð Gä—‘õ	
ñ
 Üˆt�V˜U×#Ò#ÜŒd�jŠjÔ0°Ó:À1ÔEÔFñ ô 	ˆd�i‰iÑ2°8Ó<Ó=Ô>Ùr   c               ó   € V ^8„  d   QhRR/# )r   r   ÚNoner   )r   s   "r	   r
   r
   =   s   € ÷ .ñ . dñ .r   c                óª   € V P                  RRRR7      pVP                  RRRR7       VP                  R	R
RR7       VP                  \        R7       R# )z2Attach the ``usage`` subcommand to ``subparsers``.ÚusagezMShow account rate-limit windows (the /usage block) without starting a sessionu  Fetch the configured provider's account limits (Codex 5h/weekly windows, plan, banked resets; Anthropic OAuth windows; OpenRouter credits) â€” the same block the /usage slash command prints â€” and exit. Exit code 1 when no credential is configured or the fetch fails.)ÚhelpÚdescriptionz
--providerNz:Provider to query (default: the configured model provider))Údefaultr7   z--jsonÚ
store_truez;Print one JSON document instead of the human-readable block)Úactionr7   )Úfunc)Ú
add_parserÚadd_argumentÚset_defaultsr2   )Ú
subparsersÚusage_parsers   & r	   Úbuild_usage_parserrB   =   sn   € à×(Ñ(ØÐeðtð )ó €Lð ×ÑØ˜dÐ)eð ô gà×ÑØ˜Ð,ið ô kà×Ñ¤9ÐÖ-r   )	Ú__doc__Ú
__future__r   Úargparser'   r.   r   r2   rB   r   r   r	   Ú<module>rF      s'   ðñõ #ã Û Û 
õõ.÷..r   