1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! polychrome operator cockpit — library entrypoint.
//!
//! The cockpit ships two ways: as the standalone `pc-tui` binary (see
//! `main.rs`) and embedded in the `polychrome` operator CLI, which calls
//! [`run`] when invoked with no subcommand (or `polychrome tui`). Both paths
//! go through [`run`]; the binary only adds the `color-eyre` install.
/// Connection overrides for launching the cockpit, layered over the `PC_TUI_*`
/// environment defaults. A `None` field keeps the environment value (or its
/// built-in default).
/// Run the cockpit to completion on the current tokio runtime.
///
/// Resolves the data configuration from the environment, applies any
/// [`Launch`] overrides, enters the terminal, and drives the event loop until
/// the operator quits.
///
/// # Errors
/// Returns an error if the terminal cannot be entered or a draw fails. The
/// terminal is always restored on the way out (RAII + panic hook).
pub async