From ecdee52d04f1cd3fa46546b75719f6d333f4f3fc Mon Sep 17 00:00:00 2001 From: Matt Van Horn Date: Tue, 3 Feb 2026 11:04:56 -0800 Subject: [PATCH] feat(main): integrate Bird setup into main flow - Move progress display initialization early to support Bird prompts - Check Bird availability and offer install if no X source available - Override available sources when Bird is ready - Pass x_source parameter to run_research function Co-Authored-By: Claude Opus 4.5 --- scripts/last30days.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/scripts/last30days.py b/scripts/last30days.py index 417df21..3882789 100644 --- a/scripts/last30days.py +++ b/scripts/last30days.py @@ -413,9 +413,31 @@ def main(): # Load config config = env.get_config() - # Check available sources + # Initialize progress display early for Bird prompts + progress = ui.ProgressDisplay(args.topic, show_banner=True) + + # Check Bird availability and offer install if needed + x_source_status = env.get_x_source_status(config) + x_source = x_source_status["source"] + + # If no X source and Bird can be installed, offer it + if x_source is None and x_source_status["can_install_bird"]: + bird_result = setup_bird_if_needed(progress) + if bird_result == 'bird': + x_source = 'bird' + # Refresh status + x_source_status = env.get_x_source_status(config) + + # Check available sources (now accounting for Bird) available = env.get_available_sources(config) + # Override available if Bird is ready + if x_source == 'bird': + if available == 'reddit': + available = 'both' # Now have both Reddit + X (via Bird) + elif available == 'web': + available = 'x' # Now have X via Bird + # Mock mode can work without keys if args.mock: if args.sources == "auto": @@ -439,9 +461,6 @@ def main(): # Check what keys are missing for promo messaging missing_keys = env.get_missing_keys(config) - # Initialize progress display - progress = ui.ProgressDisplay(args.topic, show_banner=True) - # Show promo for missing keys BEFORE research if missing_keys != 'none': progress.show_promo(missing_keys) @@ -492,6 +511,7 @@ def main(): depth, args.mock, progress, + x_source=x_source or "xai", ) # Processing phase