+
    ],i                    N    R t ^ RIHt ^ RIHtHtHtHt R R lt ! R R4      t	R# )u   
Timeline Planner Agent – calculates exact timestamps and cut points.

This agent is DETERMINISTIC: it does not call the LLM. Timing is derived
from word count in the narration text, which gives reproducible results
and avoids unnecessary API costs.
)annotations)AllSceneTTSPipelineConfigSceneTimelineTimelinec                    V ^8  d   QhRRRR/# )   secondsfloatreturnstr )formats   "T/home/gabslocked/Desktop/Projetos/Images/video_automation/agents/timeline_planner.py__annotate__r      s     ) )% )C )    c                V    \        V 4      ^<,          pW^<,          ,
          pVR RVR 2# )zFormat seconds as MM:SS.02d:z05.2f)int)r	   minutessecss   &  r   _format_timer      s1    'lb Gr\!Dc]!D<((r   c                  2    ] tR t^tRtR R ltR R ltRtR# )TimelinePlannerAgentz4Calculates the production timeline from TTS scripts.c                   V ^8  d   QhRR/# )r   configr   r   )r   s   "r   r   !TimelinePlannerAgent.__annotate__   s     5 5~ 5r   c                	l    VP                   V n        VP                  V n        VP                  V n        R # )N)speaking_rate_wpswpsmin_scene_durationmin_durationtransition_duration
transition)selfr   s   &&r   __init__TimelinePlannerAgent.__init__   s*    ++"55 44r   c                    V ^8  d   QhRRRR/# )r   ttsr   r   r   r   )r   s   "r   r   r   "   s     #
 #
 #
 #
r   c                	   R p. pVP                    F  p\        VP                  P                  4       4      pWPP                  ,          p\        W`P                  4      R,           pTpW',           p	T	p
TP                  \        VP                  \        V4      \        V	4      \        V^4      \        V
4      VP                  \        VP                   4      8  d   RMRR7      4       T	pK  	  Tp\        \        V^4      \        V4      VR7      # )g        g      ?zcrossfade 0.3szfade to black 0.5s)scene_number
time_starttime_endduration_seconds	cut_pointr$   )total_duration_secondstotal_duration_formattedscenes)r2   lentts_textsplitr    maxr"   appendr   r+   r   roundr   )r%   r)   current_timescene_timelines	scene_tts
word_countnarration_durationscene_durationr,   r-   r/   totals   &&          r   planTimelinePlannerAgent.plan"   s    /1IY//5578J!+hh!6 !35F5FG#MN%J#4H I""!*!7!7+J7)(3%*>1%=*95 %11C

OC )1 $L1 $4 #(?%1%%8"
 	
r   )r"   r$   r    N)__name__
__module____qualname____firstlineno____doc__r&   r@   __static_attributes__r   r   r   r   r      s    >5
#
 #
r   r   N)
rF   
__future__r   modelsr   r   r   r   r   r   r   r   r   <module>rJ      s(    # )+
 +
r   