
    i9                        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%i d&d'd(d)d*d+d,d-d.d/d0i dd1dd2dd3dd4dd5dd3dd2dddddddd5dd1d d2d!d6d7d5d8d2d9d:d;d2d3d<d2d:d=g d>g d?g d@dAdBgdCdDgdEdFgdGdHggdIdJdKdLdMdNdOd,dPdQdRdSdTdUi ddVddWddXddYddZddXdd[dd[dd\dd]ddZddYd dXd!d^d7d_d8d`d9dadbdcddded[dVd=i d&d'd(d)d*dfd,d-d.dgdhi ddiddjddkddlddZddjddkddmddnddoddZddid djd!dpd7d_d8dqd9drdmdsdndtdjdld=i d&d'd(d)d*d+d,d-d.dudvi ddwddxddyddzdd{ddwdd|dd}dd~dddd{ddd dwd#dyd$dd!ddddddddi d&d'd(d)d*dfd,dd.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dddddddi d&d'd(d)d*d+d,d-d.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d7dd8dd9dddddddd=g dg dg dddgddgddgddggdIddddddd,ddddS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d7dd8dd9dddddddd=g d¢g dâg dĢddgddgddgddggdIddddddd,ddddS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ړd7dٓd8d֓d9dۓdddd<ddd=g dޢg dߢg dddgdCdDgddgddggdIddddddd,ddddSd	Ze	ee	eef         f         ed<   daee         ed<   d	aeed<   defdZdedee	eef                  fdZde	eef         defdZde
e	eef                  fdZdedefdZdefdZdedefdZdefdZde ddfdZ!ddedefd Z"ddedefdZ#ddedefdZ$de	eef         fdZ%dS (  u[  Hermes CLI skin/theme engine.

A data-driven skin system that lets users customize the CLI's visual appearance.
Skins are defined as YAML files in ~/.hermes/skins/ or as built-in presets.
No code changes are needed to add a new skin.

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:
      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
      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
      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

    # 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                   r   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<   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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      ;/home/ubuntu/.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__r.   __annotations__r   r   dictr   r   r   r   r   r   r   r   r   r#   r   r
   r2   r4    r$   r"   r   r      s}        &&
IIIK"U4888FDcN888#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session_labelsession_borderz#8B8682z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   aresu$   War-god theme — crimson and bronzez#9F1C1Cz#C7A96Bz#DD4A3Az#6B1717z#F1E6CFz#2A1212status_bar_textstatus_bar_strongstatus_bar_dimz#6E584Bz#7BC96Fz#EF5350)status_bar_goodstatus_bar_warnstatus_bar_badstatus_bar_criticalrO   rP   )   (⚔)   (⛨)   (▲)(<>)z(/))rb   rc   rd      (⌁)re   )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 grayscale#555555z#e6edf3z#aaaaaaz#444444z#c9d1d9z#888888z#ccccccz#999999z#1F1F1Fz#C9D1D9z#E6EDF3z#777777z#B5B5B5z#AAAAAAz#D0D0D0z#F0F0F0z[?] Available Commandsslateu   Cool blue — developer-focusedz#4169e1z#7eb8f6z#8EA8FFz#4b5563z#63D0A6z#F7A072z#e6a855z#151C2Fz#7EB8F6z#4B5563z#E6A855z#FF7A7AdaylightzELight theme for bright terminals with dark text and cool blue accentsz#2563EBz#0F172Az#1D4ED8z#475569z#111827z#0F766Ez#15803Dz#B91C1Cz#B45309z#93C5FDz#64748Bz#E5EDF8voice_status_bgz#F8FAFCz#DBEAFEz#EEF2FFz#BFDBFE)completion_menu_bgcompletion_menu_current_bgcompletion_menu_meta_bgcompletion_menu_meta_current_bgu   │warm-lightmodeuG   Warm light mode — dark brown/gold text for light terminal backgroundsz#8B6914z#5C3D11z#8B4513z#8B7355z#2C1810z#2E7D32z#C62828z#E65100z#A0845Cz#F5F0E8z#F5EFE0z#E8DCC8z#F0E8D8z#DFCFB0poseidonu)   Ocean-god theme — deep blue and seafoamz#2A6FB9z#A9DFFFz#5DB8F5z#153C73z#EAF7FFz#0F2440z#496884z#6ED7B0z#D94F4F)   (≈)   (Ψ)   (∿)   (◌)u   (◠))rx   ry   rw   rf   rz   )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#F5F5F5z#E7E7E7z#4A4A4Az#D3D3D3z#919191z#656565z#202020)   (◉)rz      (◬)u   (⬤)z(::))r|   r}   rz   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#7A3511z#FFF0D4z#2B160Ez#6C4724z#6BCB77z#E2832B)   (✦)rd      (◇)re      (🔥))r   rd   r   rf   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<   rZ   rl   rn   ro   ru   rv   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r   c                 ,   t           d         }t          |                    di                     }|                    |                     di                      t          |                    di                     }|                    |                     di                      t          |                    di                     }|                    |                     di                      t	          |                     dd          |                     dd          ||||                     d	|                    d	d
                    |                     di           |                     dd          |                     dd          	  	        S )zBBuild a SkinConfig from a raw dict (built-in or loaded from YAML).r<   r   r   r   r   unknownr   r   r   r   r   r   r   )	r   r   r   r   r   r   r   r   r   )r   r:   r   updater   )r   r<   r   r   r   s        r"   _build_skin_configr     sS    Y'G'++h++,,F
MM$((8R(()))7;;y"--..GNN488Ir**+++GKK
B//00HOODHHZ,,---XXfi((HH]B//HH]GKKu,M,MNNHH]B//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s	skin_names     r"   	<genexpr>zlist_skins.<locals>.<genexpr>  s,      >>!qyI->>>>>>r$   user)r   itemsr-   r   r   is_dirsortedglobr   stemany)r0   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   warning)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:   r.   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.
    rX    )r   r4   r   r   )r   r/   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.rY   r   r4   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.rV   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 |          }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*d0|d1| d*d2d'| d(| d3d'| d(| d4d'| d(| i d5d'| d(| d6d'| d(| d7|d8| d*d9| d*d:|d;| d*d<| d#d=|d>| d*d?|d@| d*dA|dB|dC| d*dD| d*dE| d#|| d*d'| d(| d'| d(| d*dFS )GzReturn 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.
    rJ   rD   rK   r>   r?   r@   rC   rB   rm   rF   rI   z#FF8C00rH   z#FF6B6BrM   rN   r[   r\   r]   r^   rG   z#8FBC8Fr_   r`   rA   ra   rp   rq   rr   z#333355rs   rt   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   rJ   rK   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   3  s        			 ^^Hi00Fi88JNN>955E>>-00D
..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_]]'f'#' 	&' 	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''( 	*)'* 	E+', 	tNNN-'. 	#/'0 	uOOO1'2 	5 1 1 13'4 	Z5'6 	%7'8 	z9': 	ooo;'< 	T='> 	:?'@ 	T...A'B 	DC'D 	3E' 'F  %___0h0000"?"?"?5"?"?"?M' ' ' 's      )rR   )rS   )rQ   )&r8   loggingdataclassesr   r   pathlibr   typingr   r   r   r	   r
   hermes_constantsr   	getLoggerr5   r   r   r   r.   r9   r   r   r   r   r   r   r   r   r   r   r:   r   r   r   r   r   r;   r$   r"   <module>r      s  o o ob  ( ( ( ( ( ( ( (       3 3 3 3 3 3 3 3 3 3 3 3 3 3 , , , , , ,		8	$	$ 0 0 0 0 0 0 0 0H ;
Y
I
 Y
 )	

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 Y
  i!
$
 )Z%,"6
 
 A! !F =
Y
I
 Y
 )	

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

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

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

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

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

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

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

 9
 
 	
 Y
 	
 y
 i
 )
 y
 Y
 y
   !
" i#
$  )('#,&'/
 
 
4 KJJLLL   8$8$8$8$	
 
  ,]'/"5
 
 pOuG Gi\- \-S$sCx.() \ \ \F &*hz" ) ) )" 3 " " "'D ' ' ' '

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