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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! # termpulse-core
//!
//! Core OSC 9;4 terminal progress protocol implementation.
//!
//! This crate provides the lowest-level building blocks for working with
//! OSC 9;4 terminal progress sequences:
//!
//! - **Build** escape sequences from structured data
//! - **Parse** raw bytes back into structured progress state
//! - **Sanitize** labels to prevent escape sequence injection
//! - **Strip** progress sequences from text for clean logging
//!
//! ## Design Principles
//!
//! - `no_std` compatible — works in embedded, WASM, and FFI contexts
//! - Zero dependencies — nothing to audit, nothing to break
//! - Zero allocations in core paths — all operations work on slices
//!
//! ## OSC 9;4 Protocol
//!
//! ```text
//! ESC ] 9;4;<state>;<percent>;<label> <terminator>
//!
//! State: 0=clear 1=normal 2=error 3=indeterminate 4=paused
//! Percent: 0-100 (omitted for indeterminate)
//! Label: Optional descriptive text
//! Terminator: ST(\x1b\\) or BEL(\x07) or C1_ST(\x9c)
//! ```
//!
//! ## Example
//!
//! ```
//! use termpulse_core::OscSequence;
//!
//! let seq = OscSequence::normal_with_label(42, "Building");
//!
//! let mut buf = [0u8; 128];
//! let n = seq.write_to(&mut buf).unwrap();
//! assert_eq!(&buf[..n], b"\x1b]9;4;1;42;Building\x1b\\");
//! ```
extern crate std;
pub use ;
pub use ;
pub use ;
pub use ;
pub use strip_sequences;