Skip to main content

suno_core/
lib.rs

1//! Core engine for rs-suno: library selection, sync reconciliation, and tagging.
2//!
3//! Runtime-agnostic and free of direct IO. Network access happens through the
4//! [`Http`] port, which a CLI adapter implements, so the engine stays testable
5//! in isolation.
6
7mod auth;
8mod backoff;
9mod client;
10mod clock;
11pub mod config;
12mod consts;
13mod downloadable;
14mod error;
15mod executor;
16mod extras;
17mod ffmpeg;
18mod fs;
19mod graph;
20mod hash;
21mod http;
22mod limiter;
23mod lineage;
24mod lyrics;
25mod manifest;
26mod model;
27mod naming;
28mod orphans;
29pub mod reconcile;
30pub mod select;
31mod synced;
32mod tag;
33
34#[cfg(test)]
35mod testutil;
36
37#[cfg(test)]
38mod sync_chaos;
39
40pub use auth::{ClerkAuth, TOKEN_EXPIRY_WARN_DAYS, TokenExpiry, classify_token_expiry};
41pub use client::{BillingInfo, Playlist, Stem, SunoClient};
42pub use clock::Clock;
43pub use config::{
44    AccountConfig, AreaMode, AreasConfig, AudioFormat, Config, Defaults, EffectiveSettings,
45    FlagOverrides, SourceConfig, StemFormat, VideoCoverRetention,
46};
47pub use downloadable::is_downloadable;
48pub use error::{Error, Result};
49pub use executor::{ExecOptions, ExecOutcome, Failure, Ports, RunStatus, execute};
50pub use extras::{
51    INDEX_SCHEMA_VERSION, M3u8Entry, render_clip_details, render_clip_lrc, render_clip_lyrics,
52    render_library_index, render_m3u8, render_synced_lrc,
53};
54pub use ffmpeg::{Ffmpeg, FfmpegError, FfmpegErrorKind, WebpEncodeSettings};
55pub use fs::{FileStat, Filesystem, FsError, FsErrorKind};
56pub use graph::{
57    AdoptDecision, AlbumArt, CacheEntry, LineageStore, Node, Owner, OwnerCheck, OwnerGate,
58    PlaylistState, StoredEdge, adopt_decision, owner_gate,
59};
60pub use hash::{
61    SYNCED_LRC_VERSION, art_hash, art_url_hash, content_hash, meta_hash, synced_lrc_source_hash,
62};
63pub use http::{Http, HttpRequest, HttpResponse, Method, TransportError};
64pub use lineage::{
65    Edge, EdgeRole, EdgeType, LineageContext, Resolution, ResolveOpts, ResolveStatus, RootInfo,
66    edge_type, immediate_parent, lineage_edges, resolve_roots,
67};
68pub use lyrics::{AlignedLine, AlignedLineWord, AlignedLyrics, AlignedWord};
69pub use manifest::{ArtifactState, Manifest, ManifestEntry, SyncedLyricsCheck};
70pub use model::{Clip, HistoryEntry};
71pub use naming::{
72    CharacterSet, DEFAULT_TEMPLATE, NamingConfig, NamingRequest, RenderedName, render_clip_name,
73    render_clip_names, sanitise_name, stem_file_path, stems_folder,
74};
75pub use orphans::untracked_audio;
76pub use reconcile::{
77    Action, AlbumDesired, ArtifactKind, Desired, DesiredArtifact, DesiredStem, LocalFile, Plan,
78    PlaylistDesired, SourceMode, SourceStatus, album_desired, deletion_allowed,
79    plan_album_artifacts, plan_playlist_artifacts, reconcile,
80};
81pub use synced::{
82    PendingCheck, SYNCED_LRC_RECHECK_SECS, apply_synced_lrc, preview_synced_lrc,
83    synced_lyrics_targets,
84};
85pub use tag::{TrackMetadata, tag_flac, tag_mp3};