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;
28pub mod reconcile;
29pub mod select;
30mod synced;
31mod tag;
32
33#[cfg(test)]
34mod testutil;
35
36#[cfg(test)]
37mod sync_chaos;
38
39pub use auth::{ClerkAuth, TOKEN_EXPIRY_WARN_DAYS, TokenExpiry, classify_token_expiry};
40pub use client::{BillingInfo, Playlist, Stem, SunoClient};
41pub use clock::Clock;
42pub use config::{
43    AccountConfig, AreaMode, AreasConfig, AudioFormat, Config, Defaults, EffectiveSettings,
44    FlagOverrides, SourceConfig, StemFormat,
45};
46pub use downloadable::is_downloadable;
47pub use error::{Error, Result};
48pub use executor::{ExecOptions, ExecOutcome, Failure, Ports, RunStatus, execute};
49pub use extras::{
50    INDEX_SCHEMA_VERSION, M3u8Entry, render_clip_details, render_clip_lrc, render_clip_lyrics,
51    render_library_index, render_m3u8, render_synced_lrc,
52};
53pub use ffmpeg::{Ffmpeg, FfmpegError, FfmpegErrorKind, WebpEncodeSettings};
54pub use fs::{FileStat, Filesystem, FsError, FsErrorKind};
55pub use graph::{
56    AdoptDecision, AlbumArt, CacheEntry, LineageStore, Node, Owner, OwnerCheck, OwnerGate,
57    PlaylistState, StoredEdge, adopt_decision, owner_gate,
58};
59pub use hash::{
60    SYNCED_LRC_VERSION, art_hash, art_url_hash, content_hash, meta_hash, synced_lrc_source_hash,
61};
62pub use http::{Http, HttpRequest, HttpResponse, Method, TransportError};
63pub use lineage::{
64    Edge, EdgeRole, EdgeType, LineageContext, Resolution, ResolveOpts, ResolveStatus, RootInfo,
65    edge_type, immediate_parent, lineage_edges, resolve_roots,
66};
67pub use lyrics::{AlignedLine, AlignedLineWord, AlignedLyrics, AlignedWord};
68pub use manifest::{ArtifactState, Manifest, ManifestEntry, SyncedLyricsCheck};
69pub use model::{Clip, HistoryEntry};
70pub use naming::{
71    CharacterSet, DEFAULT_TEMPLATE, NamingConfig, NamingRequest, RenderedName, render_clip_name,
72    render_clip_names, sanitise_name, stem_file_path, stems_folder,
73};
74pub use reconcile::{
75    Action, AlbumDesired, ArtifactKind, Desired, DesiredArtifact, DesiredStem, LocalFile, Plan,
76    PlaylistDesired, SourceMode, SourceStatus, album_desired, deletion_allowed,
77    plan_album_artifacts, plan_playlist_artifacts, reconcile,
78};
79pub use synced::{
80    PendingCheck, SYNCED_LRC_RECHECK_SECS, apply_synced_lrc, preview_synced_lrc,
81    synced_lyrics_targets,
82};
83pub use tag::{TrackMetadata, tag_flac, tag_mp3};