wavecraft_dev_server/lib.rs
1//! Wavecraft unified development server
2//!
3//! This crate provides the complete development server infrastructure for
4//! `wavecraft start`, including:
5//!
6//! - **WebSocket server** (`ws`) — IPC bridge between browser UI and Rust engine
7//! - **Audio processing** (`audio`) — Optional real-time audio via OS devices
8//! - **Hot-reload** (`reload`) — File watching, rebuild pipeline, and parameter reload
9//! - **Parameter hosting** (`host`) — In-memory parameter storage with atomic audio bridge
10//!
11//! # Architecture
12//!
13//! ```text
14//! ┌────────────────────────┐
15//! │ CLI (wavecraft start) │
16//! │ thin wrapper │
17//! └───────────┬────────────┘
18//! │
19//! ▼
20//! ┌────────────────────────────────────────────┐
21//! │ dev-server crate │
22//! │ │
23//! │ ┌──────────┐ ┌──────────┐ ┌───────────┐ │
24//! │ │ WsServer │ │ Audio │ │ Reload │ │
25//! │ │ (ws/) │ │ (audio/) │ │ (reload/) │ │
26//! │ └────┬─────┘ └────┬─────┘ └─────┬─────┘ │
27//! │ │ │ │ │
28//! │ └──────┬───────┴──────────────┘ │
29//! │ ▼ │
30//! │ ┌─────────────────┐ │
31//! │ │ DevServerHost │ │
32//! │ │ (host.rs) │ │
33//! │ └─────────────────┘ │
34//! └────────────────────────────────────────────┘
35//! ```
36
37pub mod host;
38pub mod reload;
39pub mod session;
40pub mod ws;
41
42#[cfg(feature = "audio")]
43pub mod audio;
44
45pub use host::DevServerHost;
46pub use reload::guard::BuildGuard;
47pub use reload::rebuild::{RebuildCallbacks, RebuildPipeline};
48pub use reload::watcher::{FileWatcher, WatchEvent};
49pub use session::DevSession;
50pub use ws::{WsHandle, WsServer};
51
52#[cfg(feature = "audio")]
53pub use audio::atomic_params::AtomicParameterBridge;
54#[cfg(feature = "audio")]
55pub use audio::ffi_processor::{DevAudioProcessor, FfiProcessor};
56#[cfg(feature = "audio")]
57pub use audio::server::{AudioConfig, AudioHandle, AudioServer};
58#[cfg(feature = "audio")]
59pub use audio::status::{
60 status as audio_status, status_with_diagnostic as audio_status_with_diagnostic,
61};