§
    øžyjù  ã                   ó<   — d Z ddlZddlZdZdZd„ Z e¦   «          dS )aº  
Hermes CLI - Unified command-line interface for Hermes Agent.

Provides subcommands for:
- hermes chat          - Interactive chat (same as ./hermes)
- hermes gateway       - Run gateway in foreground
- hermes gateway start - Start gateway service
- hermes gateway stop  - Stop gateway service
- hermes setup         - Interactive setup wizard
- hermes status        - Show status of all components
- hermes cron          - Manage cron jobs
é    Nz0.20.0z2026.8.3c            	      óh  — d} dD ]è}t          t          |d¦  «        }|€Œ	 t          |dd¦  «        pd                     ¦   «                              dd¦  «        }|dk    rŒ\t          |dd¦  «        }t	          |¦  «        r |d	d
¬¦  «         d} ŒŒt          |                     ¦   «         dd	d
dd¬¦  «        }t          t          ||¦  «         d} ŒÌ# t          t          t          f$ r Y Œåw xY w| rBt          j                             dd¦  «         t          j                             dd	¦  «         dS dS )u.  Force UTF-8 stdout/stderr to prevent UnicodeEncodeError crashes.

    Several environments select a legacy, non-UTF-8 encoding for the standard
    streams:

    - Windows services and terminals default to cp1252.
    - Linux hosts with a latin-1 / C / POSIX locale (common on minimal Debian
      installs and Raspberry Pi) select latin-1 or ASCII.

    The CLI prints box-drawing characters (â”Œâ”‚â”œâ””â”€) and the âš• glyph in the setup
    wizard, doctor, and status banners. Encoding those under a non-UTF-8 codec
    raises an unhandled UnicodeEncodeError that crashes the command before it
    can even start â€” e.g. `hermes setup` on a fresh Pi.

    This runs at import time so it protects every CLI subcommand, on any
    platform. It re-wraps stdout/stderr as UTF-8 when their encoding is not
    already UTF-8, preferring TextIOWrapper.reconfigure() so the existing
    stream object is fixed in place (cached `sys.stdout` references keep
    working) and falling back to reopening the file descriptor with
    closefd=False (the CPython-recommended safe variant).

    No-op when the streams are already UTF-8: a healthy UTF-8 system sees no
    stream change and no environment mutation.

    Note: this is intentionally the earliest, platform-agnostic guard.
    hermes_cli/stdio.py::configure_windows_stdio() runs later from the entry
    points and layers on the Windows-only extras (console code-page flip,
    EDITOR default, PATH augmentation); its stream reconfiguration is a
    harmless idempotent no-op once we have already repaired the streams here.
    F)ÚstdoutÚstderrNÚencodingÚ ú-Úutf8Úreconfigurezutf-8Úreplace)r   ÚerrorsTÚwé   )r   r   Ú	bufferingÚclosefdÚ
PYTHONUTF8Ú1ÚPYTHONIOENCODING)ÚgetattrÚsysÚlowerr   ÚcallableÚopenÚfilenoÚsetattrÚAttributeErrorÚOSErrorÚ
ValueErrorÚosÚenvironÚ
setdefault)ÚrepairedÚstream_nameÚstreamr   r
   Ú
new_streams         ú9/home/ragecks/.hermes/hermes-agent/hermes_cli/__init__.pyÚ_ensure_utf8r&      sp  € ð> €Hà+ð ð ˆÝ�˜k¨4Ñ0Ô0ˆØˆ>Øð	Ý ¨
°BÑ7Ô7Ð=¸2×DÒDÑFÔF×NÒNÈsÐTVÑWÔWˆHØ˜6Ò!Ð!Øõ
 " &¨-¸Ñ>Ô>ˆKÝ˜Ñ$Ô$ð Ø� W°YÐ?Ñ?Ô?Ð?Ø�Øõ
 Ø—’‘” ¨wØ ¨A°uðñ ô ˆJõ •C˜ jÑ1Ô1Ð1ØˆHˆHøÝ¥­Ð4ð 	ð 	ð 	ØˆDð	øøøð ð ;Ý
Œ
×Ò˜l¨CÑ0Ô0Ð0Ý
Œ
×ÒÐ0°'Ñ:Ô:Ð:Ð:Ð:ð;ð ;s   ¡?CÁ!/CÂ?CÃC+Ã*C+)Ú__doc__r   r   Ú__version__Ú__release_date__r&   © ó    r%   ú<module>r,      sR   ððð ð 
€	€	€	Ø 
€
€
€
à€ØÐ ðD;ð D;ð D;ðN €�„€€€r+   