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
//! Run Publishing — pushes completed [`RunReport`]s to the Lumen platform.
//!
//! This module is the transport layer for feature 3a (Run Publishing). It
//! wraps a run report in a [`PublishEnvelope`] and POSTs the JSON to the
//! configured endpoint.
//!
//! # Architecture
//!
//! - [`config`] — [`PublishConfig`] and the [`PublishConfigBuilder`] that
//! resolves CLI flag / env var / YAML / default precedence.
//! - [`envelope`] — [`PublishEnvelope`] wrapping the [`RunReport`] with
//! transport metadata (run id, CLI version, published_at, source).
//! - [`sink`] — [`ResultSink`] trait allowing alternative sinks (webhooks,
//! S3) to slot in without engine changes.
//! - [`http_sink`] — the default [`HttpSink`] implementation: reqwest +
//! rustls, bounded retries, no redirect following.
//! - [`error`] — [`PublishError`] enum with user-facing messages.
//!
//! # Usage
//!
//! ```ignore
//! use lmn_core::publish::{
//! HttpSink, PublishConfigBuilder, PublishEnvelope, ResultSink,
//! };
//!
//! let config = PublishConfigBuilder {
//! env_api_key: std::env::var("LUMEN_API_KEY").ok(),
//! ..Default::default()
//! }
//! .build()?;
//!
//! let sink = HttpSink::new(config, env!("CARGO_PKG_VERSION"))?;
//! let envelope = PublishEnvelope::new(env!("CARGO_PKG_VERSION"), &report);
//! let outcome = sink.publish(&envelope).await?;
//! println!("published run {} in {} attempts", outcome.run_id, outcome.attempts);
//! # Ok::<_, lmn_core::publish::PublishError>(())
//! ```
//!
//! [`RunReport`]: crate::output::RunReport
pub use ;
pub use ;
pub use PublishError;
pub use HttpSink;
pub use ;