Skip to main content

cleanlib_client/
lib.rs

1// CleanLibrary shared client library — HTTP / auth / telemetry surface
2// shared between Rust CLI (cleanlib-cli) and any other Rust consumers.
3// Telemetry transport impl lands in subsequent CLEANLIB-N PRs per Client
4// spec rev1 §7.
5
6pub mod config;
7pub mod customer_state;
8pub mod derive_status;
9pub mod ecosystem_detect;
10pub mod envelope;
11pub mod errors;
12pub mod gate;
13pub mod proxy;
14pub mod risk_acceptance;
15pub mod transport;
16pub mod types;
17pub mod verdict_to_envelope;
18
19// Re-exports — load-bearing surface for sibling-crate consumers (cleanlib-cli,
20// cleanlib-app integration tests) so they import via `cleanlib_client::*`
21// without reaching into module paths.
22pub use customer_state::{CustomerState, Tier};
23// CLEANLIB-657 (CX-8 P1-b): the verdict()/enforce() dual consumption API — a
24// blocked verdict is a returned value, a couldn't-assess is the exception.
25pub use gate::{enforce, verdict, Assessment, GateError};
26pub use ecosystem_detect::ecosystem_from_path;
27pub use derive_status::{derive_status, DerivedStatus};
28pub use envelope::{ReasonCode, Status, VerdictEnvelopeV1, ALL_REASON_CODES, ALL_VERDICT_SOURCES};
29pub use verdict_to_envelope::verdict_to_envelope_v1;
30
31// CLEANLIB-126 M1″ — extern-consumer surface re-exports (cycle-13).
32// Per cycle-13 R5-Lane-2 F2: third-party consumers importing
33// `cleanlib_client::{Client, Verdict, PolicyDecision}` previously hit
34// `error[E0432]: unresolved imports` because the types lived behind
35// module paths. Re-export at crate-root so the public API matches the
36// documented surface (cf. docs-site SDK-Rust.md customer page).
37pub use transport::{Client, RemediationOutcome};
38pub use types::{PolicyDecision, PreviousVerdict, Verdict};
39// CLEANLIB-536: RFC 9457 problem+json surface — consumers match on
40// `CleanLibraryError::Problem { problem }` and branch on `problem.reason_class`.
41pub use errors::{CleanLibraryError, ProblemDetails};