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 album_art;
8mod area;
9mod auth;
10mod backoff;
11mod client;
12mod clock;
13pub mod config;
14mod consts;
15pub mod desired;
16mod downloadable;
17mod error;
18mod executor;
19mod extras;
20mod ffmpeg;
21mod fs;
22mod graph;
23mod hash;
24mod http;
25mod identity;
26mod limiter;
27mod lineage;
28mod lyrics;
29mod manifest;
30mod model;
31mod naming;
32mod orphans;
33mod pathkey;
34pub mod reconcile;
35pub mod select;
36mod synced;
37mod tag;
38mod tag_alac;
39
40#[cfg(test)]
41mod testutil;
42
43#[cfg(test)]
44mod sync_chaos;
45
46pub use album_art::{AlbumArt, PlaylistState};
47pub use area::{
48    AreaKind, AreaListing, adoption_enumerated, area_enumerated, area_mode, build_modes_by_id,
49    build_scoped_playlist_desired, library_authoritative, source_statuses, union_clips,
50};
51pub use auth::{ClerkAuth, TOKEN_EXPIRY_WARN_DAYS, TokenExpiry, classify_token_expiry};
52pub use client::{BillingInfo, Playlist, Stem, SunoClient};
53pub use clock::Clock;
54pub use config::{
55    AccountConfig, AreaMode, AreasConfig, AudioFormat, Config, Defaults, EffectiveSettings,
56    FlagOverrides, Settings, SourceConfig, StemFormat, VideoCoverRetention,
57};
58pub use desired::{
59    ArtifactToggles, LIKED_PLAYLIST_ID, PlaylistInput, build_desired, build_playlist_desired,
60    clip_stems,
61};
62pub use downloadable::is_downloadable;
63pub use error::{Error, Result};
64pub use executor::{ExecOptions, ExecOutcome, Failure, Ports, RunStatus, execute};
65pub use extras::{
66    INDEX_SCHEMA_VERSION, M3u8Entry, render_clip_details, render_clip_lrc, render_clip_lyrics,
67    render_library_index, render_m3u8, render_synced_lrc,
68};
69pub use ffmpeg::{Ffmpeg, FfmpegError, FfmpegErrorKind, WebpEncodeSettings};
70pub use fs::{FileStat, Filesystem, FsError, FsErrorKind};
71pub use graph::{CacheEntry, LineageStore, Node, StoredEdge};
72pub use hash::{
73    SYNCED_LRC_VERSION, art_hash, art_url_hash, content_hash, meta_hash, synced_lrc_source_hash,
74};
75pub use http::{Http, HttpRequest, HttpResponse, Method, TransportError};
76pub use identity::{AdoptDecision, Owner, OwnerGate, adopt_decision, owner_gate};
77pub use lineage::{
78    AttributionEdge, Edge, EdgeRole, EdgeType, LineageContext, Resolution, ResolveOpts,
79    ResolveStatus, RootInfo, attribution_edges, edge_type, immediate_parent, lineage_edges,
80    resolve_roots,
81};
82pub use lyrics::{AlignedLine, AlignedLineWord, AlignedLyrics, AlignedWord};
83pub use manifest::{ArtifactState, Manifest, ManifestEntry, SyncedLyricsCheck};
84pub use model::{Clip, ClipRoot, HistoryEntry, MediaUrl};
85pub use naming::{
86    CharacterSet, DEFAULT_TEMPLATE, NamingConfig, NamingRequest, RenderedName, render_clip_name,
87    render_clip_names, sanitise_name, stem_file_path, stems_folder,
88};
89pub use orphans::untracked_audio;
90pub use reconcile::{
91    Action, AlbumDesired, ArtifactKind, Desired, DesiredArtifact, DesiredStem, LocalFile, Plan,
92    PlaylistDesired, SourceMode, SourceStatus, album_desired, area_authoritative,
93    area_fully_enumerated, deletion_allowed, narrows_downloads, plan_album_artifacts,
94    plan_playlist_artifacts, reconcile,
95};
96pub use synced::{
97    PendingCheck, SYNCED_LRC_RECHECK_SECS, apply_synced_lrc, preview_synced_lrc,
98    synced_lyrics_targets,
99};
100pub use tag::{TrackMetadata, tag_flac, tag_mp3};
101pub use tag_alac::tag_alac;