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
45// Core server orchestration exports.
46pub use host::DevServerHost;
47pub use reload::guard::BuildGuard;
48pub use reload::rebuild::{RebuildCallbacks, RebuildPipeline};
49pub use reload::watcher::{FileWatcher, WatchEvent};
50pub use session::DevSession;
51pub use ws::{WsHandle, WsServer};
52
53// Optional audio-runtime exports (enabled by `audio` feature).
54#[cfg(feature = "audio")]
55pub use audio::{
56 atomic_params::AtomicParameterBridge,
57 ffi_processor::{DevAudioProcessor, FfiProcessor},
58 server::{AudioConfig, AudioHandle, AudioServer},
59 status::{status as audio_status, status_with_diagnostic as audio_status_with_diagnostic},
60};