molten-herald 0.1.0

Automated viral tweet generation and scheduling for developer releases 📢
Documentation
//! # Herald 📢
//!
//! Automated viral tweet generation and scheduling for developer releases.
//!
//! Herald helps developers and teams automatically announce their work on Twitter/X
//! by detecting events (releases, commits, PRs) and generating engaging tweets
//! using LLMs.
//!
//! ## Features
//!
//! - **Event Detection**: Automatically detect releases from GitHub, crates.io, npm
//! - **LLM-Powered Generation**: Generate viral tweets using Claude, GPT, or local models
//! - **Twitter Integration**: Post directly to Twitter/X using the v2 API
//! - **Scheduling**: Queue tweets for optimal posting times
//! - **Templates**: Pre-built templates for common announcement types
//!
//! ## Quick Start
//!
//! ```bash
//! # Install
//! cargo install herald
//!
//! # Configure (creates ~/.config/herald/config.toml)
//! herald init
//!
//! # Generate a tweet for a release
//! herald generate --project myproject --event release
//!
//! # Post immediately
//! herald post "just shipped something cool 🚀"
//!
//! # Schedule for later
//! herald schedule "coming soon..." --time "2024-01-15 09:00"
//! ```
//!
//! ## Configuration
//!
//! Herald uses a TOML configuration file:
//!
//! ```toml
//! [twitter]
//! api_key = "your-api-key"
//! api_secret = "your-api-secret"
//! access_token = "your-access-token"
//! access_token_secret = "your-access-token-secret"
//!
//! [llm]
//! provider = "anthropic"  # or "openai", "ollama"
//! api_key = "your-api-key"
//! model = "claude-sonnet-4-20250514"
//!
//! [defaults]
//! emojis = true
//! hashtags = false
//! tone = "casual"  # casual, professional, hype, technical
//! max_length = 280
//!
//! [[projects]]
//! name = "myproject"
//! github = "user/myproject"
//! crates_io = "myproject"
//! events = ["release", "major_feature"]
//! ```
//!
//! ## Environment Variables
//!
//! Credentials can also be set via environment variables:
//!
//! - `TWITTER_API_KEY`
//! - `TWITTER_API_SECRET`
//! - `TWITTER_ACCESS_TOKEN`
//! - `TWITTER_ACCESS_TOKEN_SECRET`
//! - `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`
//! - `GITHUB_TOKEN` (for private repos)

pub mod config;
pub mod error;
pub mod events;
pub mod generator;
pub mod interactive;
pub mod scheduler;
pub mod twitter;
pub mod ui;

pub use config::{Config, EventType, LlmConfig, ProjectConfig, ScheduleConfig, TweetDefaults, TwitterConfig};
pub use error::{HeraldError, Result};
pub use events::{Event, EventContext, EventDetector};
pub use generator::{GeneratedTweet, TweetGenerator, TweetTemplates};
pub use scheduler::{ScheduledTweet, ScheduleStatus, Scheduler};
pub use twitter::{PostedTweet, TwitterClient};

/// Herald version
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Default user agent for API requests
pub const USER_AGENT: &str = concat!("herald/", env!("CARGO_PKG_VERSION"));

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_version() {
        assert!(!VERSION.is_empty());
    }

    #[test]
    fn test_user_agent() {
        assert!(USER_AGENT.starts_with("herald/"));
    }
}