
    Y j                         % S r SSKrSSKJr  Sr\\S4   \S'   Sr\\\\S4   \4   S4   \S'   S	1\ V Vs1 s H  u  pUiM	     snn -  r	S
\\   4S jr
S
\4S jrgs  snn f )a  Detect whether the process is being invoked by an AI coding agent.

Detection is based on environment variables that AI agents set in their shell
sessions.  ``AI_AGENT`` and ``AGENT`` are treated as a universal standard (any
tool can set it); the remaining checks are tool-specific and ordered by
prevalence.

Inspired by ``@vercel/detect-agent`` (https://github.com/vercel/vercel/tree/main/packages/detect-agent).
    N)Optional)AI_AGENTAGENT._STANDARD_AGENT_VARS)))ANTIGRAVITY_AGENTantigravity))AUGMENT_AGENTzaugment-cli))CLINE_ACTIVEcline))CLAUDE_CODE_IS_COWORKcowork))
CLAUDECODECLAUDE_CODEzclaude-code))CODEX_SANDBOXCODEX_CICODEX_THREAD_IDcodex))CURSOR_TRACE_IDcursor))CURSOR_AGENTz
cursor-cli))
GEMINI_CLIgemini))COPILOT_MODELCOPILOT_ALLOW_ALLCOPILOT_GITHUB_TOKENzgithub-copilot))GOOSE_TERMINALgoose))OPENCLAW_SHELLopenclaw))OPENCODE_CLIENTopencode))PI_CODING_AGENTpi))REPL_IDreplit))
ROO_ACTIVEzroo-code))TRAE_AI_SHELL_IDtrae_TOOL_AGENTSdevinreturnc                     [          HX  n [        R                  R                  U S5      R	                  5       R                  5       nU(       d  MH  U[        ;   a  Us  $ Ss  $    [         H   u  p#[        S U 5       5      (       d  M  Us  $    g)a  Return the name of the detected AI agent or ``None``.

Checks environment variables in priority order and returns on the first
match.  When ``AI_AGENT`` or ``AGENT`` is set, the value is checked against
known agent names, unrecognized values are returned as ``"unknown"``.
 unknownc              3   `   #    U  H$  n[         R                  R                  U5      v   M&     g 7f)N)osenvironget).0vars     t/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/huggingface_hub/utils/_detect_agent.py	<genexpr>detect_agent.<locals>.<genexpr>G   s      7hsrzz~~c""hs   ,.N)	r   r0   r1   r2   striplower_KNOWN_AGENTSr)   any)r4   nameenv_vars
agent_names       r5   detect_agentr?   :   sv     $zz~~c2&,,.4464=04?i? $
 !-7h777 !-     c                      [        5       SL$ )zFReturn ``True`` if the process is being invoked by an AI coding agent.N)r?    r@   r5   is_agentrC   M   s    >%%r@   )__doc__r0   typingr   r   tuplestr__annotations__r)   r:   r?   boolrC   )_agents   00r5   <module>rL      s    
  )> eCHo =9eE%S/3./45 ( 	<@<xqU<@@hsm &&$ &- As   A