Ë
    áß²jE
  ã                  óð   — U d Z ddlmZ ddlZddlmZ ddlmZmZm	Z	 ddl
mZ  ej                  e«      Z edee¬«      Zd	ed
<   ej#                   e«       «       dd„ZddlmZ ddlmZ ddlZddiZd„ Zy)a  Video Generation Provider Registry.

Populated by plugins via ``PluginContext.register_video_gen_provider()``;
consumed by the ``video_generate`` tool. The active provider is
``video_gen.provider`` from ``config.yaml``; a configured-but-unregistered name
fails closed. If unset, the single *available* registered provider is used
(mirrors ``agent/image_gen_registry.py`` minus its legacy ``fal`` preference)
so a box with credentials for only one backend auto-selects it; otherwise None
and the tool points the user at ``hermes tools``.
é    )ÚannotationsN)ÚOptional)ÚProviderRegistryÚconfigured_provider_nameÚis_available_safe)ÚVideoGenProviderz	Video gen)ÚlabelÚprovider_clsÚloggerz"ProviderRegistry[VideoGenProvider]Ú	_registryc                 ó4  — t        dt        «      } t        j                  «       }| r+|j	                  | «      }|€t        j                  d| «       |S |j                  «       D �cg c]  }t        |t        d«      r|‘Œ }}t        |«      dk(  r|d   S dS c c}w )z=Resolve the currently-active provider (see module docstring).Ú	video_genNzEvideo_gen.provider='%s' configured but not registered; failing closedz.video_gen provider %s.is_available() raised %sé   r   )	r   r   r   ÚmergedÚgetÚdebugÚvaluesr   Úlen)Ú
configuredÚsnapshotÚproviderÚpÚ	availables        ú=/home/ubuntu/.hermes/hermes-agent/agent/video_gen_registry.pyÚget_active_providerr      s    € ä)¨+´vÓ>€JÜ×ÑÓ!€HáØ—<‘< 
Ó+ˆØÐÜ�L‰LØWÐYcôð ˆð —?‘?Ó$öØÜ˜Q¤Ð(XÔYò 	
ð€Ið ô ˜y›>¨QÒ.ˆ9�Q‰<Ð8°DÐ8ùò	s   Á$B)ÚDict)ÚListÚhermes_home_key)Úhermes_constantsr   c                óÌ   — t         j                  | «      }|€t        dt        ›d| ›�«      ‚dd l}ddlm}  |t        | g|¢­Ž  t        |j                  |d   «      |d   «      S )Nzmodule z has no attribute r   )Ú	warn_oncer   )	Ú_PLUGIN_COMPAT_LAZYr   ÚAttributeErrorÚ__name__Ú	importlibÚhermes_cli.plugin_compatr!   ÚgetattrÚimport_module)ÚnameÚtargetr%   r!   s       r   Ú__getattr__r+   ?   se   € Ü ×$Ñ$ TÓ*€FØ€~Ü˜w¤x lÐ2DÀTÀHÐMÓNÐNÛÝ2ÙŒh˜Ð&˜vÓ&Ü�9×*Ñ*¨6°!©9Ó5°v¸a±yÓAÐAó    )ÚreturnzOptional[VideoGenProvider])Ú__doc__Ú
__future__r   ÚloggingÚtypingr   Úagent.provider_registryr   r   r   Úagent.video_gen_providerr   Ú	getLoggerr$   r   r   Ú__annotations__ÚexportÚglobalsr   r   r   Ú	threadingr"   r+   © r,   r   ú<module>r:      s…   ðò	õ #ã Ý ç aÑ aÝ 5à	ˆ×	Ñ	˜8Ó	$€ñ 1AØ
Ð$4¸Vô1€	Ð-ó ð 
× Ñ ‘“Ô ó9õ0 Ý Û ð Ð>ðÐ ó
Br,   