Skip to main content

soma_provider_adapters/
lib.rs

1// Render per-item feature-requirement badges when rustdoc runs on nightly with
2// `--cfg docsrs` (docs.rs posture; locally via `cargo xtask doc --docsrs-cfg`).
3// Inert under the stable CI doc gate: stable rustdoc never sets `docsrs`.
4#![cfg_attr(docsrs, feature(doc_auto_cfg))]
5//! Reusable, product-neutral implementations of `soma-provider-core`
6//! contracts, plus feature-gated bridges onto other shared engines
7//! (`soma-openapi`, `soma-codemode`, `soma-gateway`). See plan section 3.9
8//! and PR10's deviation notes (in this crate's individual module docs) for
9//! the reasoning behind what did and did not move here from soma-service.
10//!
11//! No module here may depend on a `crates/soma/*` or `apps/*` crate under
12//! any feature — `cargo tree -p soma-provider-adapters --all-features` must
13//! stay shared-only.
14
15#![forbid(unsafe_code)]
16
17pub mod error;
18pub mod manifest_file;
19
20#[cfg(any(feature = "python", feature = "wasm"))]
21mod broker_state;
22#[cfg(any(feature = "python", feature = "wasm"))]
23mod secret_name;
24
25#[cfg(feature = "sidecar")]
26pub mod sidecar;
27
28#[cfg(feature = "static-echo")]
29pub mod static_rust;
30
31#[cfg(feature = "ai-sdk")]
32pub mod ai_sdk;
33
34#[cfg(feature = "python")]
35pub mod python;
36#[cfg(feature = "python")]
37mod python_bridge;
38#[cfg(feature = "python")]
39pub mod python_protocol;
40
41#[cfg(feature = "wasm")]
42pub mod wasm;
43
44/// Configure the process-shared durable provider state file before any
45/// Python or component provider is constructed.
46#[cfg(any(feature = "python", feature = "wasm"))]
47pub fn configure_provider_state_path(path: std::path::PathBuf) -> Result<(), String> {
48    broker_state::configure(path)
49}
50#[cfg(feature = "wasm")]
51mod wasm_limits;
52#[cfg(feature = "wasm")]
53mod wasm_memory;
54
55#[cfg(feature = "openapi")]
56pub mod openapi;
57
58#[cfg(feature = "codemode")]
59pub mod codemode;
60
61#[cfg(feature = "gateway")]
62pub mod gateway;
63
64/// Crate version from Cargo metadata.
65pub const VERSION: &str = env!("CARGO_PKG_VERSION");