
    x4j,                    >   U d Z ddlmZ ddlmZmZ dZdZdZ	 ed           G d	 d
                      Z
 ed           G d d                      Z ed           G d d                      Z edd eddedd e
ddd           e
ddd          f           edde	ddd            ed!d"ed#d$d%&           ed'd(ed)d*+           ed,d-ed.d/ e
d0d0           e
d.d.           e
d1d1          f2          f3          Zej        eiZd4ed5<   d<d:Zd;S )=u  Declarative configuration schema for desktop memory providers.

Each memory provider *declares* its configurable surface here — the fields, their
types, which values are secrets, and (for selects) the allowed options. A single
generic renderer in the desktop UI and a single generic ``GET/PUT
/api/memory/providers/{name}/config`` endpoint pair drive the whole experience,
so adding a new provider (mem0, honcho, ...) is pure declaration with zero
bespoke UI components or endpoints.

This module is intentionally pure data: it imports nothing from the config/env
layer. ``web_server`` owns the generic read/write logic that interprets these
declarations against config.yaml, the provider config file, and the env store.
    )annotations)	dataclassfieldtextselectsecretT)frozenc                  6    e Zd ZU dZded<   ded<   dZded<   dS )ProviderFieldOptionz'A single choice for a ``select`` field.strvaluelabel descriptionN)__name__
__module____qualname____doc____annotations__r        A/home/rurouni/.hermes/hermes-agent/hermes_cli/memory_providers.pyr   r      s;         11JJJJJJKr   r   c                      e Zd ZU dZded<   ded<   eZded<   dZded<   dZded<   dZ	ded	<   d
Z
ded<   dZded<   d
Zded<   d
Zded<   edd            ZddZdS )ProviderFieldu*  One configurable field on a memory provider.

    A field is stored in exactly one place, decided by ``kind``:

    * ``text`` / ``select`` — persisted to the provider's JSON config file
      (``<hermes_home>/<provider>/config.json``) under ``key``.
    * ``secret`` — persisted to the env store under ``env_key`` and never read
      back out over the API (only an ``is_set`` flag is surfaced).

    ``aliases`` and ``env_fallbacks`` let a field read legacy values written by
    earlier CLI/env setup without re-introducing per-provider code.
    r   keyr   kindr   defaultr   placeholderr   ztuple[ProviderFieldOption, ...]optionsNz
str | Noneenv_keyztuple[str, ...]aliasesenv_fallbacksreturnboolc                "    | j         t          k    S )N)r   KIND_SECRETselfs    r   	is_secretzProviderField.is_secret<   s    yK''r   set[str]c                $    d | j         D             S )Nc                    h | ]	}|j         
S r   )r   ).0opts     r   	<setcomp>z/ProviderField.allowed_values.<locals>.<setcomp>A   s    222c	222r   )r   r'   s    r   allowed_valueszProviderField.allowed_values@   s    22T\2222r   )r#   r$   )r#   r*   )r   r   r   r   r   	KIND_TEXTr   r   r   r   r   r    r!   r"   propertyr)   r0   r   r   r   r   r   "   s           HHHJJJDGKK/1G1111G!G!!!!%'M''''( ( ( X(3 3 3 3 3 3r   r   c                  J    e Zd ZU dZded<   ded<    ee          Zded<   dS )	MemoryProviderz7A declared memory provider and its configurable fields.r   namer   )default_factoryztuple[ProviderField, ...]fieldsN)r   r   r   r   r   dataclass_fieldtupler7   r   r   r   r4   r4   D   sH         AAIIIJJJ(7(N(N(NFNNNNNNr   r4   	hindsight	HindsightmodeModecloudz!How Hermes connects to Hindsight.Cloudz8Hindsight Cloud API (lightweight, just needs an API key)local_externalzLocal Externalz)Connect to an existing Hindsight instance)r   r   r   r   r   r   api_keyzAPI keyHINDSIGHT_API_KEYz,Used to authenticate with the Hindsight API.zEnter Hindsight API key)r   r   r   r    r   r   api_urlzAPI URLz"https://api.hindsight.vectorize.io)apiUrl)HINDSIGHT_API_URL)r   r   r   r   r!   r"   bank_idzBank IDhermes)bankId)r   r   r   r   r!   recall_budgetzRecall budgetmid)budgetlowhigh)r   r   r   r   r!   r   )r5   r   r7   zdict[str, MemoryProvider]MEMORY_PROVIDERSr5   r   r#   MemoryProvider | Nonec                6    t                               |           S )zEReturn the declared provider for ``name``, or ``None`` if undeclared.)rN   get)r5   s    r   get_memory_providerrR      s     %%%r   N)r5   r   r#   rO   )r   
__future__r   dataclassesr   r   r8   r1   KIND_SELECTr&   r   r   r4   	HINDSIGHTr5   rN   r   rR   r   r   r   <module>rW      s     # " " " " " ; ; ; ; ; ; ; ; 	 $        $3 3 3 3 3 3 3 3B $O O O O O O O O N	
;##N 
 $#$$? 	
 	
 	
& 	'F1	
 	
 	
 	80	
 	
 	
 		
 	
 	
 	!##E511##E511##FF33	
 	
 	
W7; ; ;	B NI/     
& & & & & &r   