aptu_core/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2
3#![warn(missing_docs)]
4#![doc = include_str!("../README.md")]
5
6// ============================================================================
7// Authentication
8// ============================================================================
9
10pub use auth::TokenProvider;
11
12// ============================================================================
13// Error Handling
14// ============================================================================
15
16pub use error::AptuError;
17
18/// Convenience Result type for Aptu operations.
19///
20/// This is equivalent to `std::result::Result<T, AptuError>`.
21pub type Result<T> = std::result::Result<T, AptuError>;
22
23// ============================================================================
24// Configuration
25// ============================================================================
26
27pub use config::{
28 AiConfig, AppConfig, CacheConfig, GitHubConfig, UiConfig, UserConfig, config_dir,
29 config_file_path, data_dir, load_config,
30};
31
32// ============================================================================
33// Caching
34// ============================================================================
35
36pub use cache::CacheEntry;
37
38// ============================================================================
39// AI Triage
40// ============================================================================
41
42pub use ai::types::{
43 IssueComment, IssueDetails, PrDetails, PrFile, PrReviewResponse, PrSummary,
44 ReleaseNotesResponse, ReviewEvent, TriageResponse,
45};
46pub use ai::{
47 AiClient, AiModel, ModelInfo, ModelProvider, ProviderConfig, all_providers, get_provider,
48};
49
50// ============================================================================
51// GitHub Integration
52// ============================================================================
53
54pub use github::auth::TokenSource;
55pub use github::graphql::IssueNode;
56pub use github::ratelimit::{RateLimitStatus, check_rate_limit};
57pub use octocrab::params::State;
58
59// ============================================================================
60// AI Integration
61// ============================================================================
62
63pub use ai::types::CreditsStatus;
64
65// ============================================================================
66// History Tracking
67// ============================================================================
68
69pub use history::{Contribution, ContributionStatus, HistoryData};
70
71// ============================================================================
72// Repository Discovery
73// ============================================================================
74
75pub use repos::discovery::{DiscoveredRepo, DiscoveryFilter, search_repositories};
76pub use repos::{CuratedRepo, RepoFilter};
77
78// ============================================================================
79// Triage Detection
80// ============================================================================
81
82pub use triage::{APTU_SIGNATURE, TriageStatus, check_already_triaged};
83
84// ============================================================================
85// Retry Logic
86// ============================================================================
87
88pub use retry::{is_retryable_anyhow, is_retryable_http, retry_backoff};
89
90// ============================================================================
91// Utilities
92// ============================================================================
93
94pub use utils::{
95 format_relative_time, infer_repo_from_git, is_priority_label, parse_and_format_relative_time,
96 truncate, truncate_with_suffix,
97};
98
99// ============================================================================
100// Platform-Agnostic Facade
101// ============================================================================
102
103pub use facade::{
104 add_custom_repo, analyze_issue, apply_triage_labels, discover_repos, fetch_issue_for_triage,
105 fetch_issues, generate_release_notes, label_pr, list_curated_repos, list_repos, post_pr_review,
106 post_release_notes, post_triage_comment, remove_custom_repo, review_pr,
107};
108pub use github::issues::ApplyResult;
109
110// ============================================================================
111// Modules
112// ============================================================================
113
114pub mod ai;
115pub mod auth;
116pub mod cache;
117pub mod config;
118pub mod error;
119pub mod facade;
120pub mod github;
121pub mod history;
122pub mod repos;
123pub mod retry;
124pub mod triage;
125pub mod utils;