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, TaskType, 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::{AiClient, AiModel, ModelProvider, ProviderConfig, all_providers, get_provider};
47
48// ============================================================================
49// GitHub Integration
50// ============================================================================
51
52pub use github::auth::TokenSource;
53pub use github::graphql::IssueNode;
54pub use github::ratelimit::{RateLimitStatus, check_rate_limit};
55pub use octocrab::params::State;
56
57// ============================================================================
58// AI Integration
59// ============================================================================
60
61pub use ai::types::CreditsStatus;
62
63// ============================================================================
64// History Tracking
65// ============================================================================
66
67pub use history::{Contribution, ContributionStatus, HistoryData};
68
69// ============================================================================
70// Repository Discovery
71// ============================================================================
72
73pub use repos::discovery::{DiscoveredRepo, DiscoveryFilter, search_repositories};
74pub use repos::{CuratedRepo, RepoFilter};
75
76// ============================================================================
77// Triage Detection
78// ============================================================================
79
80pub use triage::{
81 APTU_SIGNATURE, TriageStatus, check_already_triaged, render_release_notes_markdown,
82};
83
84// ============================================================================
85// Retry Logic
86// ============================================================================
87
88pub use retry::{is_retryable_anyhow, is_retryable_http, retry_backoff};
89
90// ============================================================================
91// Bulk Processing
92// ============================================================================
93
94pub use bulk::{BulkOutcome, BulkResult, process_bulk};
95
96// ============================================================================
97// Utilities
98// ============================================================================
99
100pub use utils::{
101 format_relative_time, infer_repo_from_git, is_priority_label, parse_and_format_relative_time,
102 truncate, truncate_with_suffix,
103};
104
105// ============================================================================
106// Platform-Agnostic Facade
107// ============================================================================
108
109pub use facade::{
110 add_custom_repo, analyze_issue, analyze_pr, apply_triage_labels, discover_repos,
111 fetch_issue_for_triage, fetch_issues, fetch_pr_for_review, format_issue,
112 generate_release_notes, label_pr, list_curated_repos, list_models, list_repos, post_issue,
113 post_pr_review, post_release_notes, post_triage_comment, remove_custom_repo, validate_model,
114};
115pub use github::issues::ApplyResult;
116
117// ============================================================================
118// Modules
119// ============================================================================
120
121pub mod ai;
122pub mod auth;
123pub mod bulk;
124pub mod cache;
125pub mod config;
126pub mod error;
127pub mod facade;
128pub mod github;
129pub mod history;
130pub mod repos;
131pub mod retry;
132pub mod triage;
133pub mod utils;