
    Ki                         d Z ddlZddlmZ defdZddedz  defdZded	edefd
ZdefdZdZ	dede
dz  fdZdZe dZe dZdZe dZe dZdZe dZdS )u   Shared constants for Hermes Agent.

Import-safe module with no dependencies — can be imported from anywhere
without risk of circular imports.
    N)Pathreturnc                  n    t          t          j        dt          j                    dz                      S )u   Return the Hermes home directory (default: ~/.hermes).

    Reads HERMES_HOME env var, falls back to ~/.hermes.
    This is the single source of truth — all other copies should import this.
    HERMES_HOMEz.hermes)r   osgetenvhome     -/home/ubuntu/hermes-agent/hermes_constants.pyget_hermes_homer      s)     	-y)@AABBBr   defaultc                     t          j        dd                                          }|rt          |          S | | S t	                      dz  S )zReturn the optional-skills directory, honoring package-manager wrappers.

    Packaged installs may ship ``optional-skills`` outside the Python package
    tree and expose it via ``HERMES_OPTIONAL_SKILLS``.
    HERMES_OPTIONAL_SKILLS Nzoptional-skills)r   r   stripr   r   )r   overrides     r   get_optional_skills_dirr      sS     y1266<<>>H H~~000r   new_subpathold_namec                 ^    t                      }||z  }|                                r|S || z  S )u  Resolve a Hermes subdirectory with backward compatibility.

    New installs get the consolidated layout (e.g. ``cache/images``).
    Existing installs that already have the old path (e.g. ``image_cache``)
    keep using it — no migration required.

    Args:
        new_subpath: Preferred path relative to HERMES_HOME (e.g. ``"cache/images"``).
        old_name: Legacy path relative to HERMES_HOME (e.g. ``"image_cache"``).

    Returns:
        Absolute ``Path`` — old location if it exists on disk, otherwise the new one.
    )r   exists)r   r   r	   old_paths       r   get_hermes_dirr   "   s:     DhH +r   c                      t                      } 	 dt          |                     t          j                                        z   S # t
          $ r t          |           cY S w xY w)a  Return a user-friendly display string for the current HERMES_HOME.

    Uses ``~/`` shorthand for readability::

        default:  ``~/.hermes``
        profile:  ``~/.hermes/profiles/coder``
        custom:   ``/opt/hermes-custom``

    Use this in **user-facing** print/log messages instead of hardcoding
    ``~/.hermes``.  For code that needs a real ``Path``, use
    :func:`get_hermes_home` instead.
    z~/)r   strrelative_tor   r	   
ValueError)r	   s    r   display_hermes_homer   7   sh     Dc$**49;;778888   4yys   5A A"!A")xhighhighmediumlowminimaleffortc                     | r|                                  sdS |                                                                  } | dk    rddiS | t          v rd| dS dS )aD  Parse a reasoning effort level into a config dict.

    Valid levels: "xhigh", "high", "medium", "low", "minimal", "none".
    Returns None when the input is empty or unrecognized (caller uses default).
    Returns {"enabled": False} for "none".
    Returns {"enabled": True, "effort": <level>} for valid effort levels.
    NnoneenabledFT)r(   r%   )r   lowerVALID_REASONING_EFFORTS)r%   s    r   parse_reasoning_effortr+   N   sn       t\\^^!!##F5!!(((62224r   zhttps://openrouter.ai/api/v1z/modelsz/chat/completionszhttps://ai-gateway.vercel.sh/v1z)https://inference-api.nousresearch.com/v1)N)__doc__r   pathlibr   r   r   r   r   r   r*   dictr+   OPENROUTER_BASE_URLOPENROUTER_MODELS_URLOPENROUTER_CHAT_URLAI_GATEWAY_BASE_URLAI_GATEWAY_MODELS_URLAI_GATEWAY_CHAT_URLNOUS_API_BASE_URLNOUS_API_CHAT_URLr
   r   r   <module>r7      sO    
			      C C C C C1 1TD[ 1D 1 1 1 1 s t    *S    ( H 3 4$;    $ 5 .777 ,??? 7 .777 ,??? ? (;;;   r   