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 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-02-03 11:04:56 -08:00
parent e57b82f1ad
commit ecdee52d04
+24 -4
View File
@@ -413,9 +413,31 @@ def main():
# Load config # Load config
config = env.get_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) 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 # Mock mode can work without keys
if args.mock: if args.mock:
if args.sources == "auto": if args.sources == "auto":
@@ -439,9 +461,6 @@ def main():
# Check what keys are missing for promo messaging # Check what keys are missing for promo messaging
missing_keys = env.get_missing_keys(config) 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 # Show promo for missing keys BEFORE research
if missing_keys != 'none': if missing_keys != 'none':
progress.show_promo(missing_keys) progress.show_promo(missing_keys)
@@ -492,6 +511,7 @@ def main():
depth, depth,
args.mock, args.mock,
progress, progress,
x_source=x_source or "xai",
) )
# Processing phase # Processing phase