
    1bi^                    p    d Z ddlmZ ddlZddlmZ 	 ddlmZ ddlmZ dS # e	e
f$ r dd	ZddZY dS w xY w)a  Resolve HERMES_HOME for standalone skill scripts.

Skill scripts may run outside the Hermes process (e.g. system Python,
nix env, CI) where ``hermes_constants`` is not importable.  This module
provides the same ``get_hermes_home()`` and ``display_hermes_home()``
contracts as ``hermes_constants`` without requiring it on ``sys.path``.

When ``hermes_constants`` IS available it is used directly so that any
future enhancements (profile resolution, Docker detection, etc.) are
picked up automatically.  The fallback path replicates the core logic
from ``hermes_constants.py`` using only the stdlib.

All scripts under ``google-workspace/scripts/`` should import from here
instead of duplicating the ``HERMES_HOME = Path(os.getenv(...))`` pattern.
    )annotationsN)Path)display_hermes_home)get_hermes_homereturnr   c                     t           j                            dd                                          } | rt	          |           nt	          j                    dz  S )zoReturn the Hermes home directory (default: ~/.hermes).

        Mirrors ``hermes_constants.get_hermes_home()``.HERMES_HOME z.hermes)osenvirongetstripr   home)vals    J/DATA/.hermes/skills/productivity/google-workspace/scripts/_hermes_home.pyr   r      sE     jnn]B//5577<tCyyyTY[[9%<<    strc                     t                      } 	 dt          |                     t          j                                        z   S # t
          $ r t          |           cY S w xY w)ztReturn a user-friendly ``~/``-shortened display string.

        Mirrors ``hermes_constants.display_hermes_home()``.z~/)r   r   relative_tor   r   
ValueError)r   s    r   r   r   "   sh       	#d..ty{{;;<<<< 	 	 	t99	s   5A A"!A")r   r   )r   r   )__doc__
__future__r   r   pathlibr   hermes_constantsr   r   ModuleNotFoundErrorImportError r   r   <module>r      s      # " " " " " 				      KKKKKKCCCCCCCC[)   = = = =      s   " 55