+
    iZ                     |   R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ]P                  P                  4       t	 ! R R4      t
]
P                   ]
P                   R]
P                   ]
P                   R]
P                   R2t]
P                   ]
P                   R]
P                   R	]
P                   R
]
P                   2t. ROt. ROt. ROt. ROt. R Ot. R!Ot. R"Ot. R#Ot. R$Ot. R%OtR&R R lltRRRR/tR]
P:                   R]
P                   R2tRt. R'Ot . R(Ot! ! R R4      t" ! R R4      t#R R lt$R R lt%R# ))z+Terminal UI utilities for last30days skill.N)Optionalc                   :    ] tR t^tRtRtRtRtRtRt	Rt
RtR	tR
tR# )Colorsz[95mz[94mz[96mz[92mz[93mz[91mz[1mz[2mz[0m N)__name__
__module____qualname____firstlineno__PURPLEBLUECYANGREENYELLOWREDBOLDDIMRESET__static_attributes__r       N/Users/bowang/.openclaw/workspace/skills/last30days-official/scripts/lib/ui.pyr   r      s/    FDDEF
CD
CEr   r   u1  
  ██╗      █████╗ ███████╗████████╗██████╗  ██████╗ ██████╗  █████╗ ██╗   ██╗███████╗
  ██║     ██╔══██╗██╔════╝╚══██╔══╝╚════██╗██╔═████╗██╔══██╗██╔══██╗╚██╗ ██╔╝██╔════╝
  ██║     ███████║███████╗   ██║    █████╔╝██║██╔██║██║  ██║███████║ ╚████╔╝ ███████╗
  ██║     ██╔══██║╚════██║   ██║    ╚═══██╗████╔╝██║██║  ██║██╔══██║  ╚██╔╝  ╚════██║
  ███████╗██║  ██║███████║   ██║   ██████╔╝╚██████╔╝██████╔╝██║  ██║   ██║   ███████║
  ╚══════╝╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═════╝  ╚═════╝ ╚═════╝ ╚═╝  ╚═╝   ╚═╝   ╚══════╝
z*  30 days of research. 30 seconds of work.
z/last30days u   · researching...c                0    V ^8  d   QhR\         R\        /# )   diagreturn)dictstr)formats   "r   __annotate__r   s   s      T S r   c                   V '       d|   V P                  R4      '       d   RMRpV P                  R4      '       d   RMRpV P                  R4      '       d   RMRpV P                  R4      '       d   RMRpRV RV R	V R
V 2pMRpRV R2# )z<Build conversational NUX message with dynamic source status.openaiu   ✓u   ✗x_sourceyoutubeweb_search_backendzReddit z, X z
, YouTube z, Web u'   YouTube ✓, Web ✓, Reddit ✗, X ✗zB
I just researched that for you. Here's what I've got right now:

u  

You can unlock more sources with API keys or by signing in to Codex — just ask me how and I'll walk you through it. More sources means better research, but it works fine as-is.

Some examples of what you can do:
- "last30 what are people saying about Figma"
- "last30 watch my biggest competitor every week"
- "last30 watch Peter Steinberger every 30 days"
- "last30 watch AI video tools monthly"
- "last30 what have you found about AI video?"

Just start with "last30" and talk to me like normal.
)get)r   redditxr#   webstatus_lines   &     r   _build_nux_messager*   s   s    ((8,,%XXj))Eu88I..%Exx 455e5xtA3j	uM?   r   r&   ud   
💡 You can unlock Reddit with an OpenAI API key or by running `codex login` — just ask me how.
r'   u@   
💡 You can unlock X with an xAI API key — just ask me how.
zBird authentication failed.u   

To fix this:
1. Log into X (twitter.com) in Safari, Chrome, or Firefox
2. Try again — Bird reads your browser cookies automatically.
u   
Bird authentication failed.

To fix this:
1. Log into X (twitter.com) in Safari, Chrome, or Firefox
2. Try again — Bird reads your browser cookies automatically.
c                      a  ] tR t^t o RtR]P                  R3V 3R lR lltR tR t	V 3R lR	 lt
RV 3R
 lR lltRtV tR# )Spinnerz-Animated spinner for long-running operations.WorkingFc                ,   < V ^8  d   QhRS[ RS[ RS[/# )r   messagecolorquietr   bool)r   __classdict__s   "r   r   Spinner.__annotate__   s#        RV r   c                b    Wn         W n        R V n        RV n        ^ V n        R V n        W0n        R# )FN)r/   r0   runningthread	frame_idxshown_staticr1   )selfr/   r0   r1   s   &&&&r   __init__Spinner.__init__   s.    
26!
r   c           	        V P                   '       d   \        V P                  \        \        4      ,          ,          p\        P
                  P                  R V P                   V \        P                   RV P                   R24       \        P
                  P                  4        V ;P                  ^,          un        \        P                  ! R4       K  R# )r     g{Gz?N)r7   SPINNER_FRAMESr9   lensysstderrwriter0   r   r   r/   flushtimesleep)r;   frames   & r   _spinSpinner._spin   s    lll"4>>C4G#GHEJJr$**eWV\\N!DLL>QSTUJJNNaNJJt r   c                   R V n         \        '       dD   \        P                  ! V P                  R R7      V n        V P
                  P                  4        R# V P                  '       gi   V P                  '       gU   \        P                  P                  RV P                   R24       \        P                  P                  4        R V n        R# R# R# )T)targetdaemon   ⏳ r   N)r7   IS_TTY	threadingThreadrJ   r8   startr:   r1   rC   rD   rE   r/   rF   r;   s   &r   rS   Spinner.start   s    6#**$**TJDKKK $$$TZZZ

  4~R!89

  "$(! .8$r   c                    < V ^8  d   QhRS[ /# r   r/   r   )r   r4   s   "r   r   r5      s      c r   c                    Wn         \        '       gX   V P                  '       gD   \        P                  P                  R V R24       \        P                  P                  4        R# R# R# )rO   r   N)r/   rP   r:   rC   rD   rE   rF   r;   r/   s   &&r   updateSpinner.update   sI    vd///JJtG9B/0JJ 0vr   c                    < V ^8  d   QhRS[ /# )r   final_messagerX   )r   r4   s   "r   r   r5      s     	 	# 	r   c                X   R V n         V P                  '       d   V P                  P                  RR7       \        '       d    \        P
                  P                  R4       V'       d$   \        P
                  P                  RV R24       \        P
                  P                  4        R# )Fg?)timeoutu   ✓ r   NzR                                                                                )r7   r8   joinrP   rC   rD   rE   rF   )r;   r^   s   &&r   stopSpinner.stop   sm    ;;;KKS)6JJ34JJtM?"56

r   )r0   r9   r/   r1   r7   r:   r8   N) )r   r   r   r	   __doc__r   r   r<   rJ   rS   r[   rb   r   __classdictcell__r4   s   @r   r,   r,      sA     7&/fkkY^  ) 	 	 	r   r,   c                     a  ] tR t^t o RtR/V 3R lR lltR tR tV 3R lR ltV 3R lR	 lt	V 3R
 lR lt
R tR tV 3R lR ltR tV 3R lR ltR tV 3R lR ltR tV 3R lR ltR tV 3R lR ltR tV 3R lR ltR tR  tR0V 3R! lR" lltR1V 3R$ lR% lltV 3R& lR' ltR( tR) tR* tR2V 3R+ lR, llt R- t!R.t"V t#R## )3ProgressDisplayz%Progress display for research phases.c                &   < V ^8  d   QhRS[ RS[/# )r   topicshow_bannerr2   )r   r4   s   "r   r   ProgressDisplay.__annotate__   s        c    r   c                    Wn         R V n        \        P                  ! 4       V n        V'       d   V P	                  4        R # R # N)rk   spinnerrG   
start_time_show_banner)r;   rk   rl   s   &&&r   r<   ProgressDisplay.__init__   s/    
*.))+ r   c           	        \         '       d   \        P                  P                  \        R ,           4       \        P                  P                  \
        P                   R\
        P                   \
        P                   V P                   \
        P                   R24       M-\        P                  P                  RV P                   R 24       \        P                  P                  4        R# )r   zTopic: 

u   /last30days · researching: N)rP   rC   rD   rE   MINI_BANNERr   r   r   r   rk   rF   rT   s   &r   rr   ProgressDisplay._show_banner   s    6JJ[4/0JJ

|76<<.djj\Z`ZfZfYggklm JJ;DJJ<rJK

r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )Redditr   N)	randomchoiceREDDIT_MESSAGESr,   r   r   r   rp   rS   r;   msgs   & r   start_redditProgressDisplay.start_reddit   K    mmO,&--v||nAcUKV]][r   c                    < V ^8  d   QhRS[ /# r   countint)r   r4   s   "r   r   rm      s     \ \ \r   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )ry    Found  threadsNrp   rb   r   r   r   r;   r   s   &&r   
end_redditProgressDisplay.end_reddit   s>    <<<LLvfll^75'QYZ[ r   c                &   < V ^8  d   QhRS[ RS[ /# r   currenttotalr   )r   r4   s   "r   r   rm      s      3 s r   c                X   V P                   '       d   V P                   P                  4        \        P                  ! \        4      p\        \        P                   R \        P                   RV RV RV 2	\        P                  4      V n         V P                   P                  4        R# ry   z [/z] N)
rp   rb   rz   r{   ENRICHING_MESSAGESr,   r   r   r   rS   r;   r   r   r~   s   &&& r   start_reddit_enrich#ProgressDisplay.start_reddit_enrich   sy    <<<LLmm./&--v||nBwiqQVPWWYZ]Y^_agananor   c                &   < V ^8  d   QhRS[ RS[ /# r   r   )r   r4   s   "r   r   rm     s     b bC b br   c                    V P                   '       db   \        P                  ! \        4      pV P                   P	                  \
        P                   R \
        P                   RV RV RV 2	4       R# R# r   )rp   rz   r{   r   r[   r   r   r   r   s   &&& r   update_reddit_enrich$ProgressDisplay.update_reddit_enrich  s\    <<<-- 23CLL6==/~RyPQRWQXXZ[^Z_ `a r   c                    V P                   '       d@   V P                   P                  \        P                   R \        P                   R24       R# R# )ry   z Enriched with engagement dataNr   rT   s   &r   end_reddit_enrich!ProgressDisplay.end_reddit_enrich  s8    <<<LLvfll^Cabc r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )Xr   N)	rz   r{   
X_MESSAGESr,   r   r   r   rp   rS   r}   s   & r   start_xProgressDisplay.start_x  sK    mmJ'&++a~QseDfkkRr   c                    < V ^8  d   QhRS[ /# r   r   )r   r4   s   "r   r   rm     s     S S3 Sr   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )r   r    postsN)rp   rb   r   r   r   r   s   &&r   end_xProgressDisplay.end_x  s=    <<<LLQv||nGE7&QR r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )YouTuber   N)	rz   r{   YOUTUBE_MESSAGESr,   r   r   r   rp   rS   r}   s   & r   start_youtubeProgressDisplay.start_youtube  sL    mm,-&**WV\\N!C5I6::Vr   c                    < V ^8  d   QhRS[ /# r   r   )r   r4   s   "r   r   rm     s     Y Y Yr   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )r   r    videosN)rp   rb   r   r   r   r   s   &&r   end_youtubeProgressDisplay.end_youtube  s=    <<<LLGFLL>wWX r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )TikTokr   N)	rz   r{   TIKTOK_MESSAGESr,   r   r
   r   rp   rS   r}   s   & r   start_tiktokProgressDisplay.start_tiktok  r   r   c                    < V ^8  d   QhRS[ /# r   r   )r   r4   s   "r   r   rm   #  s     [ [ [r   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )r   r   r   Nrp   rb   r   r
   r   r   s   &&r   
end_tiktokProgressDisplay.end_tiktok#  s>    <<<LLvfll^75'QXYZ r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )	Instagramr   N)	rz   r{   INSTAGRAM_MESSAGESr,   r   r
   r   rp   rS   r}   s   & r   start_instagramProgressDisplay.start_instagram'  sO    mm./&--	&,,qNPVP]P]^r   c                    < V ^8  d   QhRS[ /# r   r   )r   r4   s   "r   r   rm   ,  s     ] ]3 ]r   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )r   r    reelsNr   r   s   &&r   end_instagramProgressDisplay.end_instagram,  s>    <<<LLygeWTZ[\ r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  RR7      V n        V P                  P                  4        R# )HNr   Tr1   N)	rz   r{   HN_MESSAGESr,   r   r   r   rp   rS   r}   s   & r   start_hackernews ProgressDisplay.start_hackernews0  sN    mmK(&--6<<.#G^bcr   c                    < V ^8  d   QhRS[ /# r   r   )r   r4   s   "r   r   rm   5  s     X XC Xr   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )r   r    storiesNr   r   s   &&r   end_hackernewsProgressDisplay.end_hackernews5  s=    <<<LLr&,,wugXVW r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  RR7      V n        V P                  P                  4        R# )
Polymarketr   Tr   N)	rz   r{   POLYMARKET_MESSAGESr,   r   r   r   rp   rS   r}   s   & r   start_polymarket ProgressDisplay.start_polymarket9  sR    mm/0&,,z&,,qNPVP\P\dhir   c                    < V ^8  d   QhRS[ /# r   r   )r   r4   s   "r   r   rm   >  s     _ _C _r   c                    V P                   '       dC   V P                   P                  \        P                   R \        P                   RV R24       R# R# )r   r    marketsNrp   rb   r   r   r   r   s   &&r   end_polymarketProgressDisplay.end_polymarket>  s>    <<<LLjgeWT\]^ r   c                    \         P                  ! \        4      p\        \        P
                   R \        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )
Processingr   N)	rz   r{   PROCESSING_MESSAGESr,   r   r
   r   rp   rS   r}   s   & r   start_processing ProgressDisplay.start_processingB  sO    mm/0&--
6<<.#OQWQ^Q^_r   c                b    V P                   '       d   V P                   P                  4        R # R # ro   )rp   rb   rT   s   &r   end_processingProgressDisplay.end_processingG  s     <<<LL r   c                D   < V ^8  d   QhRS[ RS[ RS[ RS[ RS[ RS[ RS[ /# )r   reddit_countx_countyoutube_counthn_countpm_counttiktok_countig_countr   )r   r4   s   "r   r   rm   K  sJ      #  C _b ru   JM   ]` r   c           	        \         P                   ! 4       V P                  ,
          p\        '       Ed   \        P                  P                  R \        P                   \        P                   R\        P                   R24       \        P                  P                  \        P                   RVR R\        P                   R 24       \        P                  P                  R\        P                   R\        P                   RV R24       \        P                  P                  \        P                   R	\        P                   RV R
24       V'       dF   \        P                  P                  R\        P                   R\        P                   RV R24       V'       dF   \        P                  P                  R\        P                   R\        P                   RV R24       V'       dF   \        P                  P                  R\        P                   R\        P                   RV R24       V'       dF   \        P                  P                  R\        P                   R\        P                   RV R24       V'       dF   \        P                  P                  R\        P                   R\        P                   RV R24       \        P                  P                  R4       MRV R2RV R
2.p	V'       d   V	P                  RV R24       V'       d   V	P                  RV R24       V'       d   V	P                  RV R24       V'       d   V	P                  RV R24       V'       d   V	P                  RV R24       \        P                  P                  RVR RRP!                  V	4       R 24       \        P                  P#                  4        R # )!r   u   ✓ Research completer   (.1fs)r@   zReddit:z
 threads  zX:r   zYouTube:r   zTikTok:z
Instagram:r   zHN:r   zPolymarket:r   ru   zReddit: r   zX: z	YouTube: zTikTok: zInstagram: zHN: zPolymarket: u   ✓ Research complete (zs) - z, N)rG   rq   rP   rC   rD   rE   r   r   r   r   r   r   r   r   r
   appendra   rF   )
r;   r   r   r   r   r   r   r   elapsedpartss
   &&&&&&&&  r   show_completeProgressDisplay.show_completeK  s   ))+/6JJr&,,}<QRXR^R^Q__`abJJ

|1WSMFLL>LMJJr&--~Q|nT^_`JJ}Bv||nAgYfMN

  2fjj\&,,qW^!_`

  2fmm_GFLL><.X_!`a

  2fmm_Jv||nAhZW]!^_

  2fmm_C~QxjPX!YZ

  2fll^;v||nAhZW_!`aJJV$~X6#gYf8MNEyw?@x~W=>{8*F;<tH:X67|H:X>?JJ6wsm5SXIYHZZ\]^

r   Nc                    < V ^8  d   QhRS[ /# )r   	age_hours)float)r   r4   s   "r   r   rm   l  s      U r   c                *   Ve	   RVR R2pMRp\         P                  P                  \        P                   R\        P
                   R\        P                   RV R\        P
                   R	2
4       \         P                  P                  4        R # )
Nz (r   zh old)rd   u   ⚡r   zUsing cached resultsz - use --refresh for fresh dataru   )rC   rD   rE   r   r   r   r   rF   )r;   r   age_strs   && r   show_cachedProgressDisplay.show_cachedl  s     9S/0GG

FLL>V\\N!FJJ<G[\c[d  eD  EK  EQ  EQ  DR  RV  W  	X

r   c                    < V ^8  d   QhRS[ /# rW   rX   )r   r4   s   "r   r   rm   t  s      # r   c                    \         P                  P                  \        P                   R \        P
                   RV R24       \         P                  P                  4        R# )u
   ✗ Error:r   r   N)rC   rD   rE   r   r   r   rF   rZ   s   &&r   
show_errorProgressDisplay.show_errort  s?    

FJJ<z&,,q	LM

r   c                    \         P                  ! \        4      p\        \        P
                   R\        P                   RV 2\        P
                  4      V n        V P                  P                  4        R# )zShow web-only mode indicator.Webr   N)	rz   r{   WEB_ONLY_MESSAGESr,   r   r   r   rp   rS   r}   s   & r   start_web_onlyProgressDisplay.start_web_onlyx  sL    mm-.&,,s6<<.#GVr   c                    V P                   '       d@   V P                   P                  \        P                   R\        P                   R24       R# R# )zEnd web-only spinner.r  z assistant will search the webNr   rT   s   &r   end_web_onlyProgressDisplay.end_web_only~  s8    <<<LLc&,,?]^_ r   c                   \         P                   ! 4       V P                  ,
          p\        '       d   \        P                  P                  R\        P                   \        P                   R\        P                   R24       \        P                  P                  \        P                   RVR R\        P                   R24       \        P                  P                  R\        P                   R\        P                   R	24       M$\        P                  P                  R
VR R24       \        P                  P                  4        R# )z"Show completion for web-only mode.r   u   ✓ Ready for web searchr   r   r   r   r@   zWeb:z+ assistant will search blogs, docs & news

u   ✓ Ready for web search (zs)
N)rG   rq   rP   rC   rD   rE   r   r   r   r   r   rF   )r;   r   s   & r   show_web_only_complete&ProgressDisplay.show_web_only_complete  s    ))+/6JJr&,,}<TU[UaUaTbbcdeJJ

|1WSMFLL>LMJJr&,,tFLL>AnopJJ9'#dKL

r   c                &   < V ^8  d   QhRS[ RS[/# )r   missingr   )r   r   )r   r4   s   "r   r   rm     s      # d r   c                   VR9   d*   \         P                  P                  \        V4      4       M5V\        9   d+   \         P                  P                  \        V,          4       \         P                  P                  4        R# )zShow NUX / promotional message for missing API keys.

Args:
    missing: 'both', 'all', 'reddit', or 'x' - which keys are missing
    diag: Optional diagnostics dict for dynamic source status
N)bothall)rC   rD   rE   r*   PROMO_SINGLE_KEYrF   )r;   r  r   s   &&&r   
show_promoProgressDisplay.show_promo  sU     o%JJ/56((JJ-g67

r   c                    \         '       d%   \        P                  P                  \        4       M#\        P                  P                  \
        4       \        P                  P                  4        R# )zShow Bird authentication help.N)rP   rC   rD   rE   BIRD_AUTH_HELPBIRD_AUTH_HELP_PLAINrF   rT   s   &r   show_bird_auth_help#ProgressDisplay.show_bird_auth_help  s<    6JJ^,JJ12

r   )rp   rq   rk   )T)    r  r  r  r  ro   )r  N)$r   r   r   r	   re   r<   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r   rf   rg   s   @r   ri   ri      s     /   
\ \ b b
d
S S
Y Y
[ [
] ]
X X
_ _
  B  `
	  r   ri   c                $    V ^8  d   QhR\         /# )r   r   )r   )r   s   "r   r   r     s     c c cr   c                V   V P                  RR4      pV P                  R4      RJpV P                  RR4      pV P                  R4      RJpV'       d   V'       d   V'       d   V'       d   R# . p\        '       Ed   VP                  \        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R	\        P                   R
\        P
                   R\        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R\        P                   R\        P
                   24       V'       dx   VP                  \        P                   R\        P
                   R\        P                   R\        P
                   R\        P                   R\        P
                   24       MVP                  \        P                   R\        P
                   R\        P                   R\        P
                   R\        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R\        P                   R\        P
                   24       V'       d   V P                  RR4      pV P                  RR4      pVR8X  d   V'       d   RV R2MVP                  4       pVP                  \        P                   R\        P
                   R\        P                   R\        P
                   RV R\        P                   R\        P
                   24       EMVP                  \        P                   R\        P
                   R\        P                   R\        P
                   R\        P                   R\        P
                   24       V P                  R4      '       d   VP                  \        P                   R\        P
                   R\        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R\        P                   R\        P
                   24       MTVP                  \        P                   R\        P
                   R \        P                   R\        P
                   24       V'       dx   VP                  \        P                   R\        P
                   R\        P                   R!\        P
                   R"\        P                   R\        P
                   24       MVP                  \        P                   R\        P
                   R\        P                   R#\        P
                   R$\        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R%\        P                   R\        P
                   24       V'       d   V P                  RR4      p	VP                  \        P                   R\        P
                   R\        P                   R&\        P
                   R'V	 R(\        P                   R\        P
                   24       MvVP                  \        P                   R\        P
                   R\        P                   R)\        P
                   R*\        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R\        P                   R\        P
                   24       VP                  \        P                   R\        P
                   R+\        P                   R,\        P
                   R-\        P                   R\        P
                   24       VP                  \        P                   R.\        P
                   24       EMnVP                  R4       VP                  R/4       VP                  R04       V'       d   VP                  R14       M"VP                  R24       VP                  R34       V'       d   VP                  R44       MKVP                  R54       V P                  R4      '       d   VP                  R64       MVP                  R74       V'       d   VP                  R84       M"VP                  R94       VP                  R:4       V'       d   VP                  R;4       MVP                  R<4       VP                  R04       VP                  R=4       VP                  R.4       \        P                  P                  R>P                  V4      R?,           4       \        P                  P                  4        R# )@zShow pre-flight source status banner when sources are missing.

Args:
    diag: Dict from env diagnostics with keys:
        openai, xai, x_source, bird_installed, bird_authenticated,
        bird_username, youtube, web_search_backend
r!   Fr"   Nr#   r$   u   ┌─────────────────────────────────────────────────────┐u   │r   u"   /last30days v2.1 — Source Statusz                    z5                                                     r@   u
   ✅ Redditu,       — OPENAI_API_KEY found                u
   ❌ Redditu-       — No OPENAI_API_KEY                    u8        └─ Add to ~/.config/last30days/.env            rd   bird_usernamebirdzBird ()u   ✅ X/Twitteru    — z                          u   ❌ X/Twitteru)    — No Bird CLI or XAI_API_KEY          bird_installedu9        └─ Bird installed but not authenticated         u9        └─ Log into x.com in your browser, then retry   u:        └─ Needs Node.js 22+ (Bird is bundled)           u   ✅ YouTubeu)      — yt-dlp found                      u   ❌ YouTubeu+      — yt-dlp not installed                u;        └─ Fix: brew install yt-dlp (free)                u   ✅ Webu          — z API                       u   ⚡ Webu/          — Using assistant's search tool       z
  Config: z~/.config/last30days/.envz                  u   └─────────────────────────────────────────────────────┘u=   │ /last30days v2.1 — Source Status                    │u;   │                                                     │u>   │  ✅ Reddit    — OPENAI_API_KEY found                │u?   │  ❌ Reddit    — No OPENAI_API_KEY                    │u>   │     └─ Add to ~/.config/last30days/.env            │u?   │  ✅ X/Twitter — available                            │u>   │  ❌ X/Twitter — No Bird CLI or XAI_API_KEY          │u?   │     └─ Log into x.com in your browser, then retry   │u@   │     └─ Needs Node.js 22+ (Bird is bundled)           │u>   │  ✅ YouTube   — yt-dlp found                        │u>   │  ❌ YouTube   — yt-dlp not installed                │uA   │     └─ Fix: brew install yt-dlp (free)                │u>   │  ✅ Web       — API search available                │u>   │  ⚡ Web       — Using assistant's search tool       │u;   │  Config: ~/.config/last30days/.env                  │r   ru   )r%   rP   r   r   r   r   r   r   r   upperr   rC   rD   rE   ra   rF   )
r   
has_openaihas_xhas_youtubehas_weblinessourceusernamelabelbackends
   &         r   show_diagnostic_bannerr+    s7
    (E*JHHZ ,E((9e,Khh+,D8G eEv

|  $I  JP  JV  JV  IW  X  	Y

|3v||nAfkk]Bdekeqeqdr  sG  HN  HR  HR  GS  SV  W]  Wc  Wc  Vd  e  	f

|3v||n4ijpjtjtiuuxy  zF  zF  yG  H  	I LLFJJ<s6<<.6<<.
SYS_S_R`  aM  NT  NX  NX  MY  Y\  ]c  ]i  ]i  \j  k  lLLFJJ<s6<<.6::,jQWQ]Q]P^  _L  MS  MW  MW  LX  X[  \b  \h  \h  [i  j  kLLFJJ<s6<<.8pqwq{q{p||  AG  AM  AM  @N  O  P XXj"-Fxx4H,2f,<fXJa(v||~ELLFJJ<s6<<.6<<.V\VbVbUcchinho  pJ  KQ  KU  KU  JV  VY  Z`  Zf  Zf  Yg  h  iLLFJJ<s6<<.6::,mTZT`T`Sa  bK  LR  LV  LV  KW  WZ  [a  [g  [g  Zh  i  jxx())

|3v||n<uv|  wA  wA  vB  BE  FL  FR  FR  ES  T  U

|3v||n<uv|  wA  wA  vB  BE  FL  FR  FR  ES  T  U

|3v||n<vw}  xB  xB  wC  CF  GM  GS  GS  FT  U  V LLFJJ<s6<<.6<<.TZT`T`Sa  bK  LR  LV  LV  KW  WZ  [a  [g  [g  Zh  i  jLLFJJ<s6<<.6::,kRXR^R^Q_  `K  LR  LV  LV  KW  WZ  [a  [g  [g  Zh  i  jLLFJJ<s6<<.8stzt~t~s  @C  DJ  DP  DP  CQ  R  S hh3R8GLLFJJ<s6<<.6<<.PVP\P\~]hiphq  rM  NT  NX  NX  MY  Y\  ]c  ]i  ]i  \j  k  lLLFJJ<s6<<.6==/QWQ]Q]P^  _N  OU  OY  OY  NZ  Z]  ^d  ^j  ^j  ]k  l  m

|3v||n4ijpjtjtiuuxy  zF  zF  yG  H  	I

|3v||nJv{{mKdekeqeqdr  sE  FL  FP  FP  EQ  QT  U[  Ua  Ua  Tb  c  	d

|  $I  JP  JV  JV  IW  X  	Y 	  }  	~TURSLLYZLLZ[LLYZLLZ[LLYZxx())^__`LLYZLLYZLL\]LLYZLLYZRSRS  }  	~JJTYYu%./JJr   c                0    V ^8  d   QhR\         R\         /# )r   phaser/   rX   )r   s   "r   r   r   
  s      s S r   c           
        R\         P                  R\         P                  R\         P                  R\         P                  R\         P
                  /pVP                  V \         P                  4      p\        P                  P                  V R\         P                   RV R24       \        P                  P                  4        R	# )
zPrint a phase message.r&   r'   processdoneerroru   ▸r   r   N)r   r   r   r
   r   r   r%   r   rC   rD   rE   rF   )r-  r/   colorsr0   s   &&  r   print_phaser3  
  s     	&--V[[6==F JJufll+EJJwc&,,q	<=JJr   )zDiving into Reddit threads...zScanning subreddits for gold...z$Reading what Redditors are saying...z+Exploring the front page of the internet...zFinding the good discussions...zUpvoting mentally...zScrolling through comments...)z#Checking what X is buzzing about...zReading the timeline...zFinding the hot takes...zScanning tweets and threads...z Discovering trending insights...zFollowing the conversation...zReading between the posts...)zGetting the juicy details...zFetching engagement metrics...zReading top comments...zExtracting insights...zAnalyzing discussions...)zSearching YouTube for videos...z!Finding relevant video content...zScanning YouTube channels...z Discovering video discussions...zFetching transcripts...)z'Searching TikTok for trending videos...z!Finding what's viral on TikTok...z'Scanning TikTok for relevant content...)zSearching Instagram Reels...z'Finding what's trending on Instagram...z(Scanning Instagram for relevant reels...)zSearching Hacker News...z!Scanning HN front page stories...z Finding technical discussions...z&Discovering developer conversations...)zChecking prediction markets...z%Finding what people are betting on...zScanning Polymarket for odds...z!Discovering prediction markets...)zCrunching the data...zScoring and ranking...zFinding patterns...zRemoving duplicates...zOrganizing findings...)zSearching the web...zFinding blogs and docs...zCrawling news sites...zDiscovering tutorials...ro   )
u   ⠋u   ⠙u   ⠹u   ⠸u   ⠼u   ⠴u   ⠦u   ⠧u   ⠇u   ⠏)z   z.  z.. z...)&re   rC   rG   rQ   rz   typingr   rD   isattyrP   r   r
   r   r   r   BANNERrv   r|   r   r   r   r   r   r   r   r   r  r*   r  r   r  r  rA   DOTS_FRAMESr,   ri   r+  r3  r   r   r   <module>r8     sx   1 
     
				 	 mm_V[[M * vzzlDV\\N S
 ==/&++k&,,qTeflfrfresv
      < v	M *6<<. 9  X*1 1hB BJcLr   