
    .cj                     	   U d Z ddlZddlmZmZ ddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ  ej        e          Ze G d d                      Zd	d
i ddddddddddddddddddddddddd dd!d"d#d$d%dd&d'd(dd)d*dd+d"d,d-d.d"d/i dd0dd1dddd2dd1dd3dd4dd5dd6dd2d d0d7d3d#d8d%d0d&d9d:d4d;d0d<d=d>d?d@dAd?d?dBi dCdDdEdFdGdHdIdJdKdLdMi ddNddOddPddQddRddPddOddddddddRddNd dOd!dSd#dRd%dOd&dTdUdOdPdVdOdWdSdXdYdPdSd/g dZg d[g d\d]d^gd_d`gdadbgdcddggdedfdgdhdidjdkdIdldmdndodpdqi ddrddsddtdduddvddtddwddwddxddyddvddud dtd!dzd#d{d%d|d&d}d~ddddwdrdzdddtdzd/i dCdDdEdFdGddIdJdddi ddddddddddvddddddddddddvddd dd!dd#d{d%dd&ddddddddddddd/i dCdDdEdFdGdHdIdJdddi dddddddddddddddddd=ddddddd dd!dd#dd%dd&ddddd=ddddddddddi dCdDdEdFdGddIddddi dddddddddddddddd4dd5ddddddd dd!dd#dd%dd&dd4ddd5ddddddddddi dCdDdEdFdGdHdIdJdddi ddddddddddddddddddddddddd dd!dÓd#dd%dd&dēdddddddddddd/g dˢg d̢g d͢ddgddgddgddggdedddddddIddddoddi dddd?dddddddddddddddddd?ddd dd!dd#dd%d?d&ddddd?dddddddd/g dg dg dddgddgddgddggdedddddddIddddoddi dddddddd ddddddddddddddddd dd!dd#dd%dd&dddddVddddd	d
d
dddg dg dg dddgd_d`gddgddggdedddddddIddddod	Ze	ee	eef         f         ed<   daee         ed<   d	aeed<   defdZd edee	eef                  fd!Zd"ed#ed$ede	eef         fd%Zd&e	eef         defd'Zde
e	eef                  fd(Zd)edefd*Zdefd+Zd)edefd,Zdefd-Z d.e!ddfd/Z"d5d0edefd1Z#d6d0edefd2Z$d7d0edefd3Z%de	eef         fd4Z&dS (8  u  Hermes skin/theme engine — the theme SDK for every surface.

A data-driven skin system that lets users (and Hermes itself) customize the
visual appearance across the CLI, the TUI, and the desktop GUI from a single
file. Skins are defined as YAML files in ~/.hermes/skins/ or as built-in presets.
No code changes are needed to add a new skin.

This module is the source of truth: it resolves the active skin, and the gateway
pushes the resolved palette to the TUI and desktop (see tui_gateway's
``resolve_skin`` / ``skin.changed``). A skin dropped in ~/.hermes/skins/ therefore
themes all three surfaces at once — the theme analogue of the plugin SDK.

SKIN YAML SCHEMA
================

All fields are optional. Missing values inherit from the ``default`` skin.

.. code-block:: yaml

    # Required: skin identity
    name: mytheme                         # Unique skin name (lowercase, hyphens ok)
    description: Short description        # Shown in /skin listing

    # Colors: hex values for Rich markup (banner, UI, response box)
    colors:
      background: "#0e0e12"               # App/base surface — the seed the TUI
                                          # status bar and the desktop GUI derive
                                          # their whole palette from (see below).
      banner_border: "#CD7F32"            # Panel border color
      banner_title: "#FFD700"             # Panel title text color
      banner_accent: "#FFBF00"            # Section headers (Available Tools, etc.)
      banner_dim: "#B8860B"               # Dim/muted text (separators, labels)
      banner_text: "#FFF8DC"              # Body text (tool names, skill names)
      ui_accent: "#FFBF00"               # General UI accent
      ui_label: "#DAA520"                # UI labels (warm gold; teal clashed w/ default banner gold)
      ui_ok: "#4caf50"                   # Success indicators
      ui_error: "#ef5350"                # Error indicators
      ui_warn: "#ffa726"                 # Warning indicators
      ui_tool: "#FFBF00"                 # Tool-call markers (● / spinner); falls back to ui_accent
      ui_thinking: "#CC9B1F"             # Reasoning/thinking text; falls back to banner_dim
      diff_added: "#dcffdc"              # Diff added-line background (TUI)
      diff_removed: "#ffdcdc"            # Diff removed-line background
      diff_added_word: "#248a3d"         # Diff added word-level foreground
      diff_removed_word: "#cf222e"       # Diff removed word-level foreground
      syntax_string: "#FFBF00"           # Code strings; falls back to ui_accent
      syntax_number: "#FFF8DC"           # Code numbers; falls back to ui_text
      syntax_keyword: "#CD7F32"          # Code keywords; falls back to ui_border
      syntax_comment: "#CC9B1F"          # Code comments; falls back to banner_dim
      prompt: "#FFF8DC"                  # Prompt text color
      input_rule: "#CD7F32"              # Input area horizontal rule
      response_border: "#FFD700"         # Response box border (ANSI)
      status_bar_bg: "#1a1a2e"           # Status bar background
      status_bar_text: "#C0C0C0"         # Status bar default text
      status_bar_strong: "#FFD700"       # Status bar highlighted text
      status_bar_dim: "#8B8682"          # Status bar separators/muted text
      status_bar_good: "#8FBC8F"         # Healthy context usage
      status_bar_warn: "#FFD700"         # Warning context usage
      status_bar_bad: "#FF8C00"          # High context usage
      status_bar_critical: "#FF6B6B"     # Critical context usage
      session_label: "#DAA520"           # Session label color
      session_border: "#8B8682"          # Session ID dim color
      status_bar_bg: "#1a1a2e"          # TUI status/usage bar background
      voice_status_bg: "#1a1a2e"        # TUI voice status background
      selection_bg: "#333355"           # TUI mouse-selection highlight background
      completion_menu_bg: "#1a1a2e"      # Completion menu background
      completion_menu_current_bg: "#333355"  # Active completion row background
      completion_menu_meta_bg: "#1a1a2e"     # Completion meta column background
      completion_menu_meta_current_bg: "#333355"  # Active completion meta background

    # Optional paired palette for the opposite terminal polarity (mirrors the
    # desktop app's colors/darkColors pairing). If `colors` above is authored
    # for dark terminals, `light_colors` supplies the hand-tuned light-terminal
    # variant (same keys); light-authored skins supply `dark_colors` instead.
    # Without a paired block, the TUI adapts `colors` automatically
    # (contrast-clamped foregrounds, polarity-corrected fills).
    light_colors:
      banner_title: "#8B6914"
      # ... same keys as `colors` ...

    # Spinner: customize the animated spinner during API calls
    spinner:
      waiting_faces:                      # Faces shown while waiting for API
        - "(⚔)"
        - "(⛨)"
      thinking_faces:                     # Faces shown during reasoning
        - "(⌁)"
        - "(<>)"
      thinking_verbs:                     # Verbs for spinner messages
        - "forging"
        - "plotting"
      wings:                              # Optional left/right spinner decorations
        - ["⟪⚔", "⚔⟫"]                  # Each entry is [left, right] pair
        - ["⟪▲", "▲⟫"]

    # Branding: text strings used throughout the CLI
    branding:
      agent_name: "Hermes Agent"          # Banner title, status display
      welcome: "Welcome message"          # Shown at CLI startup
      goodbye: "Goodbye! ⚕"              # Shown on exit
      response_label: " ⚕ Hermes "       # Response box header label
      prompt_symbol: "❯"                 # Input prompt symbol (bare token; renderers add trailing space)
      help_header: "(^_^)? Commands"      # /help header text

    # Tool prefix: character for tool output lines (default: ┊)
    tool_prefix: "┊"

    # Tool emojis: override the default emoji for any tool (used in spinners & progress)
    tool_emojis:
      terminal: "⚔"           # Override terminal tool emoji
      web_search: "🔮"        # Override web_search tool emoji
      # Any tool not listed here uses its registry default

USAGE
=====

.. code-block:: python

    from hermes_cli.skin_engine import get_active_skin, list_skins, set_active_skin

    skin = get_active_skin()
    print(skin.colors["banner_title"])    # "#FFD700"
    print(skin.get_branding("agent_name"))  # "Hermes Agent"

    set_active_skin("ares")               # Switch to built-in ares skin
    set_active_skin("mytheme")            # Switch to user skin from ~/.hermes/skins/

BUILT-IN SKINS
==============

- ``default`` — Classic Hermes gold/kawaii (the current look)
- ``ares``    — Crimson/bronze war-god theme with custom spinner wings
- ``mono``    — Clean grayscale monochrome
- ``slate``   — Cool blue developer-focused theme
- ``daylight`` — Light background theme with dark text and blue accents
- ``warm-lightmode`` — Warm brown/gold text for light terminal backgrounds

USER SKINS
==========

Drop a YAML file in ``~/.hermes/skins/<name>.yaml`` following the schema above.
Activate with ``/skin <name>`` in the CLI or ``display.skin: <name>`` in config.yaml.
    N)	dataclassfield)Path)AnyDictListOptionalTupleget_hermes_homec                      e Zd ZU dZeed<   dZeed<    ee          Z	e
eef         ed<    ee          Ze
eef         ed<    ee          Ze
eef         ed<    ee          Ze
eef         ed	<    ee          Ze
eef         ed
<   dZeed<    ee          Ze
eef         ed<   dZeed<   dZeed<   ddededefdZdeeeef                  fdZddededefdZdS )
SkinConfigzComplete skin configuration.name description)default_factorycolorslight_colorsdark_colorsspinnerbranding   ┊tool_prefixtool_emojisbanner_logobanner_herokeyfallbackreturnc                 8    | j                             ||          S )z Get a color value with fallback.)r   getselfr   r   s      8/home/ice/.hermes/hermes-agent/hermes_cli/skin_engine.py	get_colorzSkinConfig.get_color   s    {sH---    c                 "   | j                             dg           }g }|D ]n}t          |t          t          f          rPt          |          dk    r=|                    t          |d                   t          |d                   f           o|S )z.Get spinner wing pairs, or empty list if none.wings   r      )r   r!   
isinstancelisttuplelenappendstr)r#   rawresultpairs       r$   get_spinner_wingszSkinConfig.get_spinner_wings   s    lw++ 	< 	<D$u.. <3t99>>s47||Sa\\:;;;r&   c                 8    | j                             ||          S )z#Get a branding value with fallback.)r   r!   r"   s      r$   get_brandingzSkinConfig.get_branding   s    }  h///r&   N)r   )__name__
__module____qualname____doc__r0   __annotations__r   r   dictr   r   r   r   r   r   r   r   r   r   r   r%   r   r
   r4   r6    r&   r$   r   r      s        &&
IIIK"U4888FDcN888 $)5#>#>#>L$sCx.>>>"'%"="="=Kc3h===#eD999GT#s(^999$uT:::Hd38n:::K"'%"="="=Kc3h===KK. .S .C . . . . .4c3h#8    0 0 0s 0C 0 0 0 0 0 0r&   r   defaultu"   Classic Hermes — gold and kawaiibanner_border#CD7F32banner_title#FFD700banner_accentz#FFBF00
banner_dimz#B8860Bbanner_text#FFF8DC	ui_accentui_labelz#DAA520ui_okz#4caf50ui_errorz#ef5350ui_warnz#ffa726prompt
input_ruleresponse_borderstatus_bar_bg#1a1a2estatus_bar_textz#C0C0C0status_bar_strongstatus_bar_dimz#8A7A4A#8FBC8F#FF8C00#FF6B6Bz#8B8682#333355z#3a3a55z#4dabf7)status_bar_goodstatus_bar_warnstatus_bar_badstatus_bar_criticalsession_labelsession_bordercompletion_menu_bgcompletion_menu_current_bgselection_bgshell_dollarvoice_status_bgz#C8961Ez#D89B04z#5C4718z#A97E10z#2E7D32z#C62828z#D97706r\   z#6F6F6Fz#9A8A5ArX   rY   z#C2410Cz#B91C1Cz#1E6FC0z#F5F5F5z#E0D1BFz#D4E4F7)rZ   r[   ra   r^   r_   r`   rO   rb   zHermes AgentzAWelcome to Hermes Agent! Type your message or /help for commands.   Goodbye! ⚕u    ⚕ Hermes    ❯(^_^)? Available Commands)
agent_namewelcomegoodbyeresponse_labelprompt_symbolhelp_headerr   )r   r   r   r   r   r   r   aresu$   War-god theme — crimson and bronzez#A93333z#C7A96Bz#DD4A3Az#905151z#F1E6CFz#2A1212z#756054z#7BC96Fz#EF5350z#6E584Bz#5C221Dz#692620)   (⚔)   (⛨)   (▲)(<>)z(/))rm   rn   ro      (⌁)rp   )forgingmarchingzsizing the fieldzholding the linezhammering plansztempering steelzplotting impactzraising the shieldu   ⟪⚔u   ⚔⟫u   ⟪▲u   ▲⟫u   ⟪╸u   ╺⟫u   ⟪⛨u   ⛨⟫)waiting_facesthinking_facesthinking_verbsr(   z
Ares Agentz?Welcome to Ares Agent! Type your message or /help for commands.u   Farewell, warrior! ⚔u
    ⚔ Ares u   ⚔u   (⚔) Available Commandsu   ╎uW  [bold #A3261F] █████╗ ██████╗ ███████╗███████╗       █████╗  ██████╗ ███████╗███╗   ██╗████████╗[/]
[bold #B73122]██╔══██╗██╔══██╗██╔════╝██╔════╝      ██╔══██╗██╔════╝ ██╔════╝████╗  ██║╚══██╔══╝[/]
[#C93C24]███████║██████╔╝█████╗  ███████╗█████╗███████║██║  ███╗█████╗  ██╔██╗ ██║   ██║[/]
[#D84A28]██╔══██║██╔══██╗██╔══╝  ╚════██║╚════╝██╔══██║██║   ██║██╔══╝  ██║╚██╗██║   ██║[/]
[#E15A2D]██║  ██║██║  ██║███████╗███████║      ██║  ██║╚██████╔╝███████╗██║ ╚████║   ██║[/]
[#EB6C32]╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝      ╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═══╝   ╚═╝[/]u  [#9F1C1C]⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#9F1C1C]⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⠟⠻⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#C7A96B]⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⠋⠀⠀⠀⠙⢿⣷⣄⠀⠀⠀⠀⠀⠀⠀[/]
[#C7A96B]⠀⠀⠀⠀⠀⢀⣾⡿⠋⠀⠀⢠⡄⠀⠀⠙⢿⣷⡀⠀⠀⠀⠀⠀[/]
[#DD4A3A]⠀⠀⠀⠀⣰⣿⠟⠀⠀⠀⣰⣿⣿⣆⠀⠀⠀⠻⣿⣆⠀⠀⠀⠀[/]
[#DD4A3A]⠀⠀⠀⢰⣿⠏⠀⠀⢀⣾⡿⠉⢿⣷⡀⠀⠀⠹⣿⡆⠀⠀⠀[/]
[#9F1C1C]⠀⠀⠀⣿⡟⠀⠀⣠⣿⠟⠀⠀⠀⠻⣿⣄⠀⠀⢻⣿⠀⠀⠀[/]
[#9F1C1C]⠀⠀⠀⣿⡇⠀⠀⠙⠋⠀⠀⚔⠀⠀⠙⠋⠀⠀⢸⣿⠀⠀⠀[/]
[#6B1717]⠀⠀⠀⢿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡿⠀⠀⠀[/]
[#6B1717]⠀⠀⠀⠘⢿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⠃⠀⠀⠀[/]
[#C7A96B]⠀⠀⠀⠀⠈⠻⣿⣷⣦⣤⣀⣀⣤⣤⣶⣿⠿⠋⠀⠀⠀⠀[/]
[#C7A96B]⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⠿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀[/]
[#DD4A3A]⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⚔⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[dim #6B1717]⠀⠀⠀⠀⠀⠀⠀⠀war god online⠀⠀⠀⠀⠀⠀⠀⠀[/])r   r   r   r   r   r   r   r   monou   Monochrome — clean grayscalez#5E5E5Ez#e6edf3z#aaaaaaz#606060z#c9d1d9z#888888z#ccccccz#999999z#1F1F1Fz#C9D1D9z#E6EDF3z#777777z#B5B5B5z#AAAAAAz#D0D0D0z#F0F0F0z#464646z#505050z[?] Available Commands)r   r   r   r   r   r   slateu   Cool blue — developer-focusedz#4169e1z#7eb8f6z#8EA8FFz#545E6Bz#63D0A6z#F7A072z#e6a855z#151C2Fz#7EB8F6z#5D6672z#E6A855z#FF7A7Az#324867z#3A5375daylightzELight theme for bright terminals with dark text and cool blue accentsz#2563EBz#0F172Az#1D4ED8z#475569z#111827z#0F766Ez#15803Dz#B45309z#6E94BEz#E5EDF8z#838890z#64748Bz#F8FAFCz#DBEAFEz#EEF2FFz#BFDBFEz#D3E0FB)rX   rY   rZ   r[   r\   r]   r^   r_   completion_menu_meta_bgcompletion_menu_meta_current_bgr`   ra   rb   u   │warm-lightmodeuG   Warm light mode — dark brown/gold text for light terminal backgroundsz#8B6914z#5C3D11z#8B4513z#8B7355z#2C1810z#E65100z#F5F0E8z#8A8F98z#DA4D00z#A0845Cz#F5EFE0z#E8DCC8z#F0E8D8z#DFCFB0z#E8DAD0poseidonu)   Ocean-god theme — deep blue and seafoamz#2A6FB9z#A9DFFFz#5DB8F5z#44638Fz#EAF7FFz#0F2440z#52708Az#6ED7B0z#3576BCz#D94F4Fz#496884z#254D73z#2A587F)   (≈)   (Ψ)   (∿)   (◌)u   (◠))r   r   r~   rq   r   )zcharting currentszsounding the depthzreading foam lineszsteering the tridentztracking undertowzplotting sea laneszcalling the swellzmeasuring pressureu   ⟪≈u   ≈⟫u   ⟪Ψu   Ψ⟫u   ⟪∿u   ∿⟫u   ⟪◌u   ◌⟫zPoseidon AgentzCWelcome to Poseidon Agent! Type your message or /help for commands.u   Fair winds! Ψu    Ψ Poseidon u   Ψu   (Ψ) Available Commandsu=  [bold #B8E8FF]██████╗  ██████╗ ███████╗███████╗██╗██████╗  ██████╗ ███╗   ██╗       █████╗  ██████╗ ███████╗███╗   ██╗████████╗[/]
[bold #97D6FF]██╔══██╗██╔═══██╗██╔════╝██╔════╝██║██╔══██╗██╔═══██╗████╗  ██║      ██╔══██╗██╔════╝ ██╔════╝████╗  ██║╚══██╔══╝[/]
[#75C1F6]██████╔╝██║   ██║███████╗█████╗  ██║██║  ██║██║   ██║██╔██╗ ██║█████╗███████║██║  ███╗█████╗  ██╔██╗ ██║   ██║[/]
[#4FA2E0]██╔═══╝ ██║   ██║╚════██║██╔══╝  ██║██║  ██║██║   ██║██║╚██╗██║╚════╝██╔══██║██║   ██║██╔══╝  ██║╚██╗██║   ██║[/]
[#2E7CC7]██║     ╚██████╔╝███████║███████╗██║██████╔╝╚██████╔╝██║ ╚████║      ██║  ██║╚██████╔╝███████╗██║ ╚████║   ██║[/]
[#1B4F95]╚═╝      ╚═════╝ ╚══════╝╚══════╝╚═╝╚═════╝  ╚═════╝ ╚═╝  ╚═══╝      ╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═══╝   ╚═╝[/]u9  [#2A6FB9]⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#5DB8F5]⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#5DB8F5]⠀⠀⠀⠀⠀⠀⠀⢠⣿⠏⠀Ψ⠀⠹⣿⡄⠀⠀⠀⠀⠀⠀⠀[/]
[#A9DFFF]⠀⠀⠀⠀⠀⠀⠀⣿⡟⠀⠀⠀⠀⠀⢻⣿⠀⠀⠀⠀⠀⠀⠀[/]
[#A9DFFF]⠀⠀⠀≈≈≈≈≈⣿⡇⠀⠀⠀⠀⠀⢸⣿≈≈≈≈≈⠀⠀⠀[/]
[#5DB8F5]⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀[/]
[#2A6FB9]⠀⠀⠀⠀⠀⠀⠀⢿⣧⠀⠀⠀⠀⠀⣼⡿⠀⠀⠀⠀⠀⠀⠀[/]
[#2A6FB9]⠀⠀⠀⠀⠀⠀⠀⠘⢿⣷⣄⣀⣠⣾⡿⠃⠀⠀⠀⠀⠀⠀⠀[/]
[#153C73]⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#153C73]⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#5DB8F5]⠀⠀⠀⠀⠀≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈⠀⠀⠀⠀⠀[/]
[#A9DFFF]⠀⠀⠀⠀⠀⠀≈≈≈≈≈≈≈≈≈≈≈≈≈⠀⠀⠀⠀⠀⠀[/]
[dim #153C73]⠀⠀⠀⠀⠀⠀⠀deep waters hold⠀⠀⠀⠀⠀⠀⠀[/]sisyphusu6   Sisyphean theme — austere grayscale with persistencez#B7B7B7z#E7E7E7z#5C5C5Cz#D3D3D3z#919191z#656565z#202020z#6D6D6Dz#585858z#666666)   (◉)r      (◬)u   (⬤)z(::))r   r   r   u   (○)u   (●))zfinding tractionzmeasuring the gradezresetting the boulderzcounting the ascentztesting leveragezsetting the shoulderzpushing uphillzenduring the loopu   ⟪◉u   ◉⟫u   ⟪◬u   ◬⟫u   ⟪⬤u   ⬤⟫zSisyphus AgentzCWelcome to Sisyphus Agent! Type your message or /help for commands.u   The boulder waits. ◉u    ◉ Sisyphus u   ◉u   (◉) Available Commandsu  [bold #F5F5F5]███████╗██╗███████╗██╗   ██╗██████╗ ██╗  ██╗██╗   ██╗███████╗       █████╗  ██████╗ ███████╗███╗   ██╗████████╗[/]
[bold #E7E7E7]██╔════╝██║██╔════╝╚██╗ ██╔╝██╔══██╗██║  ██║██║   ██║██╔════╝      ██╔══██╗██╔════╝ ██╔════╝████╗  ██║╚══██╔══╝[/]
[#D7D7D7]███████╗██║███████╗ ╚████╔╝ ██████╔╝███████║██║   ██║███████╗█████╗███████║██║  ███╗█████╗  ██╔██╗ ██║   ██║[/]
[#BFBFBF]╚════██║██║╚════██║  ╚██╔╝  ██╔═══╝ ██╔══██║██║   ██║╚════██║╚════╝██╔══██║██║   ██║██╔══╝  ██║╚██╗██║   ██║[/]
[#8F8F8F]███████║██║███████║   ██║   ██║     ██║  ██║╚██████╔╝███████║      ██║  ██║╚██████╔╝███████╗██║ ╚████║   ██║[/]
[#626262]╚══════╝╚═╝╚══════╝   ╚═╝   ╚═╝     ╚═╝  ╚═╝ ╚═════╝ ╚══════╝      ╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═══╝   ╚═╝[/]ur  [#B7B7B7]⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#D3D3D3]⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#E7E7E7]⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀[/]
[#F5F5F5]⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀[/]
[#E7E7E7]⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀[/]
[#D3D3D3]⠀⠀⠀⠀⠀⠀⠘⢿⣿⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀[/]
[#B7B7B7]⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#919191]⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#656565]⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#656565]⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#4A4A4A]⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#4A4A4A]⠀⠀⠀⠀⠀⣀⣴⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀⠀[/]
[#656565]⠀⠀⠀━━━━━━━━━━━━━━━━━━━━━━━⠀⠀⠀[/]
[dim #4A4A4A]⠀⠀⠀⠀⠀⠀⠀⠀⠀the boulder⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]	charizardu)   Volcanic theme — burnt orange and emberz#C75B1Dz#FFD39Az#F29C38z#C58A45z#FFF0D4z#2B160Ez#826144z#6BCB77z#E2832Bz#7B593Az#0B0503z#4A1B07z#120806z#5A260D)   (✦)ro      (◇)rp      (🔥))r   ro   r   rq   r   )zbanking into the draftzmeasuring burnzreading the updraftztracking ember fallzsetting wing anglezholding the flame corezplotting a hot landingzcoiling for liftu   ⟪✦u   ✦⟫u   ⟪◇u   ◇⟫zCharizard AgentzDWelcome to Charizard Agent! Type your message or /help for commands.u   Flame out! ✦u    ✦ Charizard u   ✦u   (✦) Available Commandsu  [bold #FFF0D4] ██████╗██╗  ██╗ █████╗ ██████╗ ██╗███████╗ █████╗ ██████╗ ██████╗        █████╗  ██████╗ ███████╗███╗   ██╗████████╗[/]
[bold #FFD39A]██╔════╝██║  ██║██╔══██╗██╔══██╗██║╚══███╔╝██╔══██╗██╔══██╗██╔══██╗      ██╔══██╗██╔════╝ ██╔════╝████╗  ██║╚══██╔══╝[/]
[#F29C38]██║     ███████║███████║██████╔╝██║  ███╔╝ ███████║██████╔╝██║  ██║█████╗███████║██║  ███╗█████╗  ██╔██╗ ██║   ██║[/]
[#E2832B]██║     ██╔══██║██╔══██║██╔══██╗██║ ███╔╝  ██╔══██║██╔══██╗██║  ██║╚════╝██╔══██║██║   ██║██╔══╝  ██║╚██╗██║   ██║[/]
[#C75B1D]╚██████╗██║  ██║██║  ██║██║  ██║██║███████╗██║  ██║██║  ██║██████╔╝      ██║  ██║╚██████╔╝███████╗██║ ╚████║   ██║[/]
[#7A3511] ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝       ╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═══╝   ╚═╝[/]u  [#FFD39A]⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⠶⠶⠶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#F29C38]⠀⠀⠀⠀⠀⠀⣴⠟⠁⠀⠀⠀⠀⠈⠻⣦⠀⠀⠀⠀⠀⠀[/]
[#F29C38]⠀⠀⠀⠀⠀⣼⠏⠀⠀⠀✦⠀⠀⠀⠀⠹⣧⠀⠀⠀⠀⠀[/]
[#E2832B]⠀⠀⠀⠀⢰⡟⠀⠀⣀⣤⣤⣤⣀⠀⠀⠀⢻⡆⠀⠀⠀⠀[/]
[#E2832B]⠀⠀⣠⡾⠛⠁⣠⣾⠟⠉⠀⠉⠻⣷⣄⠀⠈⠛⢷⣄⠀⠀[/]
[#C75B1D]⠀⣼⠟⠀⢀⣾⠟⠁⠀⠀⠀⠀⠀⠈⠻⣷⡀⠀⠻⣧⠀[/]
[#C75B1D]⢸⡟⠀⠀⣿⡟⠀⠀⠀🔥⠀⠀⠀⠀⢻⣿⠀⠀⢻⡇[/]
[#7A3511]⠀⠻⣦⡀⠘⢿⣧⡀⠀⠀⠀⠀⠀⢀⣼⡿⠃⢀⣴⠟⠀[/]
[#7A3511]⠀⠀⠈⠻⣦⣀⠙⢿⣷⣤⣤⣤⣾⡿⠋⣀⣴⠟⠁⠀⠀[/]
[#C75B1D]⠀⠀⠀⠀⠈⠙⠛⠶⠤⠭⠭⠤⠶⠛⠋⠁⠀⠀⠀⠀[/]
[#F29C38]⠀⠀⠀⠀⠀⠀⠀⠀⣰⡿⢿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀[/]
[#F29C38]⠀⠀⠀⠀⠀⠀⠀⣼⡟⠀⠀⢻⣧⠀⠀⠀⠀⠀⠀⠀⠀[/]
[dim #7A3511]⠀⠀⠀⠀⠀⠀⠀tail flame lit⠀⠀⠀⠀⠀⠀⠀⠀[/])	r>   rl   rw   rx   ry   r|   r}   r   r   _BUILTIN_SKINS_active_skin_active_skin_namer   c                  $    t                      dz  S )zUser skins directory.skinsr   r=   r&   r$   
_skins_dirr     s    w&&r&   pathc                 ,   	 ddl }t          | dd          5 }|                    |          }ddd           n# 1 swxY w Y   t          |t                    rd|v r|S n3# t
          $ r&}t                              d| |           Y d}~nd}~ww xY wdS )z(Load a skin definition from a YAML file.r   Nrzutf-8)encodingr   zFailed to load skin from %s: %s)yamlopen	safe_loadr+   r<   	Exceptionloggerdebug)r   r   fdataes        r$   _load_skin_from_yamlr     s    A$g... 	%!>>!$$D	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%dD!! 	fnnK A A A6a@@@@@@@@A4s4   A! :A! >A! >A! !
B+BBvaluesection	skin_namec                    t          | t                    r| S | i S t                              d||t	          |           j                   i S )zIReturn a mapping value or an empty dict when the section type is invalid.Nz>Skin '%s' has invalid '%s' section type (%s); ignoring section)r+   r<   r   warningtyper7   )r   r   r   s      r$   _mapping_or_emptyr   &  sU    % }	
NNHU	   Ir&   r   c                 j   t           d         }t          |                     dd                    }t          |                     d          d|          }t          |                     d          d|          }t          |                     d          d|          }t          |                     d          d|          }t	          |                    di                     }|                    |           t	          |                    di                     }|                    |           t	          |                    di                     }	|	                    |           t          |                     d	          d	|          }
t          |                     d
          d
|          }t          ||                     dd          ||
|||	|                     d|                    dd                    ||                     dd          |                     dd                    S )zBBuild a SkinConfig from a raw dict (built-in or loaded from YAML).r>   r   unknownr   )r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   )r   r0   r!   r   r<   updater   )r   r>   r   color_overridesspinner_overridesbranding_overridesemoji_overridesr   r   r   r   r   s               r$   _build_skin_configr   5  s    Y'GDHHVY//00I'(:(:HXabbbO)$((9*=*=y\efff*488J+?+?_hiii'(?(?bklllO'++h++,,F
MM/"""7;;y"--..GNN$%%%GKK
B//00HOO&''' %TXXn%=%=~ajkkkL#DHH]$;$;]^ghhhKHH]B//!HH]GKKu,M,MNN#HH]B//HH]B//   r&   c                     g } t                                           D ]2\  }}|                     ||                    dd          dd           3t	                      }|                                rt          |                    d                    D ]w}t          |          }|rd|                    d|j	                  t          fd| D                       rJ|                     |                    dd          dd           x| S )	zList all available skins (built-in + user-installed).

    Returns list of {"name": ..., "description": ..., "source": "builtin"|"user"}.
    r   r   builtin)r   r   sourcez*.yamlr   c              3   0   K   | ]}|d          k    V  dS )r   Nr=   ).0sr   s     r$   	<genexpr>zlist_skins.<locals>.<genexpr>q  s,      >>!qyI->>>>>>r&   user)r   itemsr/   r!   r   is_dirsortedglobr   stemany)r2   r   r   
skins_pathr   r   s        @r$   
list_skinsr   ]  s8   
 F$**,,  
d88M266
 
 	 	 	 	 J 
1122 	 	A'**D 	 HHVQV44	>>>>v>>>>> %#'88M2#>#>$     Mr&   r   c                 F   t                      }||  dz  }|                                r t          |          }|rt          |          S | t          v rt          t          |                    S t
                              d|            t          t          d                   S )z<Load a skin by name. Checks user skins first, then built-in.z.yamlz"Skin '%s' not found, using defaultr>   )r   is_filer   r   r   r   r   )r   r   	user_filer   s       r$   	load_skinr   |  s     J^^^+I ,#I.. 	,%d+++ ~!."6777 NN7>>>nY7888r&   c                  F    t           t          t                    a t           S )z.Get the currently active skin config (cached).)r   r   r   r=   r&   r$   get_active_skinr     s      !233r&   c                 2    | a t          |           at          S )z3Switch the active skin. Returns the new SkinConfig.)r   r   r   )r   s    r$   set_active_skinr     s     T??Lr&   c                      t           S )z*Get the name of the currently active skin.)r   r=   r&   r$   get_active_skin_namer     s    r&   configc                 D   |                      d          pi }t          |t                    si }|                     dd          }t          |t                    r7|                                r#t          |                                           dS t          d           dS )z|Initialize the active skin from CLI config at startup.

    Call this once during CLI init with the loaded config dict.
    displayskinr>   N)r!   r+   r<   r0   stripr   )r   r   r   s      r$   init_skin_from_configr     s    
 jj##)rGgt$$ FI..I)S!! #ioo&7&7 #	))*****	"""""r&   r   c                     	 t                                          d|           }n# t          $ r | }Y nw xY w|p|                                 }|p|                                  dS )a  Return the interactive prompt symbol with a single trailing space.

    Skins store ``prompt_symbol`` as a bare token (no spaces). The trailing
    space is appended here so callers can drop it straight into a rendered
    prompt without hand-rolling whitespace.
    rj    )r   r6   r   r   )r   r1   cleaneds      r$   get_active_prompt_symbolr     s}    ,,_hGG    h%%''G))),,,,s   "% 44c                 l    	 t                                          d|           S # t          $ r | cY S w xY w)z*Get the /help header from the active skin.rk   r   r6   r   r   s    r$   get_active_help_headerr     sG      --mXFFF      !$ 33c                 l    	 t                                          d|           S # t          $ r | cY S w xY w)z*Get the goodbye line from the active skin.rh   r   r   s    r$   get_active_goodbyer     sG      --iBBB   r   c            	         	 t                      } n# t          $ r i cY S w xY w|                     dd          }|                     dd          }|                     dd          }|                     dd          }|                     d	d
          }|                     d|          }|                     dd          }|                     dd          }|                     dd          }	|                     d|          }
|                     d|          }|                     d|          }|                     d|                     dd                    }|                     d|          }|                     d|                     d|                    }|                     d|          }|                     d|	          }|                     dd          }|                     dd          }|                     d |          }|                     d!|          }i d"dd#| d$d|d%| d$d&| d$d'd(|	 d)|
 d*d(|	 d)| d+d,d(|	 d)| d-d(|	 d)| d+d.d(|	 d)| d+d/d(|	 d)| d+d0d(|	 d)| d+d1|d2| d+d3d(| d)| d4d(| d)| d5d(| d)| i d6d(| d)| d7d(| d)| d8|d9| d+d:| d+d;|d<| d+d=| d$d>|d?| d+d@|dA| d+dB|dC|dD| d+dE| d+dF| d$|| d+d(| d)| d(| d)| d+dGS )HzReturn prompt_toolkit style overrides derived from the active skin.

    These are layered on top of the CLI's base TUI style so /skin can refresh
    the live prompt_toolkit UI immediately without rebuilding the app.
    rL   r   rM   r@   rA   rB   rE   rF   rD   z#555555rH   rK   rU   rJ   rV   rO   rP   rQ   rR   rS   rX   rI   rT   rY   rZ   rC   r[   rb   r^   r_   rW   rz   r{   z
input-areaplaceholderz italiczprompt-workinghintz
status-barzbg:r   zstatus-bar-strongz boldzstatus-bar-dimzstatus-bar-goodzstatus-bar-warnzstatus-bar-badzstatus-bar-criticalz
input-rulezimage-badgezcompletion-menuzcompletion-menu.completionz"completion-menu.completion.currentzcompletion-menu.meta.completionz'completion-menu.meta.completion.currentzclarify-borderzclarify-titlezclarify-questionzclarify-choicezclarify-selectedzclarify-active-otherzclarify-countdownzsudo-promptzsudo-borderz
sudo-titlez	sudo-textzapproval-borderzapproval-titlezapproval-desczapproval-cmd)zapproval-choicezapproval-selectedzvoice-statuszvoice-status-recording)r   r   r%   )r   rL   rM   titletextdimlabelwarnerror	status_bgstatus_textstatus_strong
status_dimstatus_goodstatus_warn
status_badstatus_criticalvoice_bgmenu_bgmenu_current_bgmenu_meta_bgmenu_meta_current_bgs                         r$   "get_prompt_toolkit_style_overridesr     s#        			 ^^Hb))Fi88JNN>955E>>-33D
..y
1
1CNN:u--E>>)Y//DNN:y11E	::I..!2D99KNN#6>>M 0#66J..!2DNN7I4V4VWWK..!2D99K 0$..RV2W2WXXJnn%:EBBO~~/;;Hnn19==Gnn%A9MMO>>";WEEL>>*K_]]+
 	b+ 	#+ 	&+ 	S///+ 	3+ 	5I5555+ 	C9CC}CCC+ 	8	88J88+ 	???[???+ 	???[???+ 	=	==J===+  	GYGGGGG!+" 	j#+$ 	%%+& 	111411'+( 	%&<G&<&<d&<&<)+* 	-.MO.M.Me.M.M++ +, 	*+E+E+E+E+E-+. 	23W9M3W3WPU3W3W/+0 	*1+2 	E3+4 	tNNN5+6 	#7+8 	uOOO9+: 	5 1 1 1;+< 	Z=+> 	%?+@ 	zA+B 	oooC+D 	TE+F 	:G+H 	T...I+J 	DK+L 	3M+ +N  %___0h0000"?"?"?5"?"?"?U+ + + +s      )rd   )re   )rc   )'r:   loggingdataclassesr   r   pathlibr   typingr   r   r   r	   r
   hermes_constantsr   	getLoggerr7   r   r   r   r0   r;   r   r   r   r   r   r   r   r   r   r   r   r<   r   r   r   r   r   r=   r&   r$   <module>r      s  M M M^  ( ( ( ( ( ( ( (       3 3 3 3 3 3 3 3 3 3 3 3 3 3 , , , , , ,		8	$	$ #0 #0 #0 #0 #0 #0 #0 #0X ;
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3%%(9
 
 
L
I
Y
 )
 9	

 
 	
 Y
 	
 y
 i
 y
 Y
 y
  
 i
  y!
" y#
$ (#,%"+*3%&(5
 
 
8
 )Z%,"6
 
 eS Sj =
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3%%(9
 
 
> HGGJJJ  
 8$8$8$8$	
 
 'X/*"5
 
 WR}L L\ 7
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3%%(9
 
 
< (Z%,"3
 
 U+ +Z 8
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3%%(9
 
 
< (Z%,"6
 
 U+ +Z ^
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3'0/8%%(=
 
 
@ (Z%,"3
 
 Y- -^ !`
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3'0/8%%(=
 
 
@ (Z(/%6
 
  Y- -^ B
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3%%(9
 
 
> JIIJJJ   8$'"8$8$	
 
  +\'-!4
 
 dNL L\ O
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3%%(9
 
 
> JIIKKK   8$8$8$8$	
 
  +\/."5
 
 XUM M^ B
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'"+*3'0/8%%(=
 
 
B KJJLLL   8$8$8$8$	
 
  ,]'/"5
 
 pOCN Nc@	- @	-S$sCx.() @	 @	 @	N &*hz" ) ) )" 3 " " "'D ' ' ' '

t 
c3h(@ 
 
 
 
S c c d3PS8n    %T#s(^ %
 % % % %PDc3h(    >9C 9J 9 9 9 9&    # *    c    
#$ #4 # # # #(- -s -s - - - -$ S 3      #    PDcN P P P P P Pr&   