
    4Ajc
                    6   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	Z	ddl
mZmZ  G d d	ee          Z G d
 dee          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )zwRuntime configuration model for OpenMontage.

Loads config.yaml, merges with env overrides, and provides typed access.
    )annotations)Enum)Path)OptionalN)	BaseModelFieldc                      e Zd ZdZdZdZdS )
BudgetModeobservewarncapN)__name__
__module____qualname__OBSERVEWARNCAP     ?/app/working/workspaces/default/OpenMontage/lib/config_model.pyr
   r
      s        GD
CCCr   r
   c                      e Zd ZdZdZdZdS )CheckpointPolicyguided
manual_allauto_noncreativeN)r   r   r   GUIDED
MANUAL_ALLAUTO_NONCREATIVEr   r   r   r   r      s         FJ)r   r   c                  H    e Zd ZU dZded<   dZded<   dZded	<   d
Zded<   dS )	LLMConfig	anthropicstrproviderNzOptional[str]modelgffffff?floattemperaturei   int
max_tokens)r   r   r   r#   __annotations__r$   r&   r(   r   r   r   r    r       sV         HEKJr   r    c                  `    e Zd ZU ej        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S )BudgetConfigr
   modeg      $@r%   	total_usdg?reserve_pctg      ?single_action_approval_usdTbool"require_approval_for_new_paid_toolN)r   r   r   r
   r   r,   r)   r-   r.   r/   r1   r   r   r   r+   r+   #   sk         !D&&&&IK(,,,,,/3&333333r   r+   c                  6    e Zd ZU ej        Zded<   dZded<   dS )CheckpointConfigr   policypipeliner"   storage_dirN)r   r   r   r   r   r4   r)   r6   r   r   r   r3   r3   +   s7         /6F6666!K!!!!!!r   r3   c                  d    e Zd ZU 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S )OutputConfigmp4r"   default_formatlibx264default_codecaacdefault_audio_codec	1920x1080default_resolution   r'   default_fps   default_crfN)
r   r   r   r:   r)   r<   r>   r@   rB   rD   r   r   r   r8   r8   0   sz         N"M""""$$$$$)))))KKr   r8   c                  V    e Zd ZU 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S )PathsConfigr5   r"   pipeline_dirlibrarylibrary_dirstyles
styles_dirskills
skills_diroutput
output_dirN)	r   r   r   rG   r)   rI   rK   rM   rO   r   r   r   rF   rF   9   sg         "L"""" K    JJJr   rF   c                      e Zd ZU dZ ee          Zded<    ee          Z	ded<    ee
          Zded<    ee          Zd	ed
<    ee          Zded<   eddd            ZdddZdS )OpenMontageConfigz Top-level runtime configuration.)default_factoryr    llmr+   budgetr3   
checkpointr8   rN   rF   pathsNconfig_pathOptional[Path]return'OpenMontageConfig'c                L   |3t          t                                                    j        j        dz  }|                                rRt          |          5 }t          j        |          pi }ddd           n# 1 swxY w Y   |                     |          S  |             S )zCLoad config from YAML file. Falls back to defaults if file missing.Nzconfig.yaml)	r   __file__resolveparentexistsopenyaml	safe_loadmodel_validate)clsrW   fraws       r   loadzOpenMontageConfig.loadJ   s     x..00229@=PK 	+k"" .anQ''-2. . . . . . . . . . . . . . .%%c***suus   A<<B B keyr"   project_rootr   c                    |0t          t                                                    j        j        }t	          | j        |          }||z                                  S )z>Resolve a relative path from PathsConfig against project root.)r   r\   r]   r^   getattrrV   )selfrh   ri   values       r   resolve_pathzOpenMontageConfig.resolve_pathW   sM    >>1133:AL
C((u$--///r   )N)rW   rX   rY   rZ   )rh   r"   ri   rX   rY   r   )r   r   r   __doc__r   r    rS   r)   r+   rT   r3   rU   r8   rN   rF   rV   classmethodrg   rn   r   r   r   rQ   rQ   A   s         **U9555C5555 5>>>F>>>>#(59I#J#J#JJJJJJ 5>>>F>>>>{;;;E;;;;
 
 
 
 [
0 0 0 0 0 0 0r   rQ   )ro   
__future__r   enumr   pathlibr   typingr   ra   pydanticr   r   r"   r
   r   r    r+   r3   r8   rF   rQ   r   r   r   <module>rv      s   
 # " " " " "                    % % % % % % % %    d   * * * * *sD * * *    	   4 4 4 4 49 4 4 4" " " " "y " " "
    9       )   0 0 0 0 0	 0 0 0 0 0r   