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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
//! # Briefcase AI Core Library
//!
//! High-performance AI observability, replay, and decision tracking for Rust applications.
//!
//! ## Features
//!
//! - **AI Decision Tracking**: Capture inputs, outputs, and context for every AI decision
//! - **Deterministic Replay**: Reproduce AI decisions exactly with full context preservation
//! - **Comprehensive Observability**: Monitor model performance, drift, and behavior
//! - **Enterprise Security**: Built-in data sanitization and privacy controls
//! - **Flexible Storage**: SQLite, cloud storage, and custom backends
//! - **Cost Management**: Track and optimize AI model usage costs
//! - **Cross-Platform**: Works on Linux, macOS, Windows, and WebAssembly
//!
//! ## Quick Start
//!
//! ```rust
//! use briefcase_core::*;
//! use briefcase_core::storage::StorageBackend;
//! use serde_json::json;
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a decision snapshot
//! let decision = DecisionSnapshot::new("ai_function")
//! .add_input(Input::new("user_query", json!("Hello world"), "string"))
//! .add_output(Output::new("response", json!("Hello back!"), "string").with_confidence(0.95))
//! .with_execution_time(120.5);
//!
//! // Save to storage (requires storage feature)
//! #[cfg(feature = "sqlite-storage")]
//! {
//! let storage = storage::SqliteBackend::in_memory()?;
//! let decision_id = storage.save_decision(&decision).await?;
//! println!("Saved decision: {}", decision_id);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Feature Flags
//!
//! - `recording` - Baseline decision capture pipeline (enabled by default)
//! - `async` - Enable async/await runtime support (enabled by default)
//! - `storage` - Enable persistent storage APIs (enabled by default)
//! - `sqlite-storage` - SQLite storage backend (implied by `storage`)
//! - `vcs-storage` - Version-control storage abstractions
//! - `replay` - Deterministic replay engine
//! - `drift` - Drift monitoring utilities
//! - `sanitize` - Built-in PII sanitization
//! - `otel` - OpenTelemetry instrumentation helpers
//! - `tokens` - Token counting utilities
//! - `networking` - HTTP client support for remote services
//! - `compression` - Compression helpers for storage backends
/// Cost calculation and management functionality
/// Drift detection and model performance monitoring
/// Core data models and structures
/// Token counting and estimation
/// Telemetry helpers for reporting usage
/// The default base URL for the Briefcase AI API.
pub const DEFAULT_API_URL: &str = "http://localhost:8080";
/// Decision replay and validation
/// Data sanitization and privacy controls
// Storage module only available with storage features
/// Storage backends for persisting decisions and snapshots
// Control plane abstraction for auth/authz backends (remote, local, etc.)
/// Control plane trait and implementations for client lookup
// Client authentication module (requires networking for server validation)
/// Unified client for authenticated access to the Briefcase AI platform
// Re-export all public types for convenience
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
use Error;