mockforge_core/ai_studio/
mod.rs

1//! Pillars: [AI]
2//!
3//! MockForge AI Studio - Unified AI Copilot
4//!
5//! This module provides a unified interface for all AI-powered features in MockForge,
6//! including natural language mock generation, AI-guided debugging, persona generation,
7//! and artifact freezing for deterministic testing.
8//!
9//! # Features
10//!
11//! - **Natural Language Mock Generation**: Generate mocks from conversational descriptions
12//! - **AI-Guided Debugging**: Analyze test failures and suggest fixes
13//! - **Persona Generation**: Create and tweak personas using AI
14//! - **Artifact Freezing**: Convert AI outputs to deterministic YAML/JSON
15//! - **Cost & Budget Management**: Track tokens and enforce budgets
16//!
17//! # Example Usage
18//!
19//! ```rust,no_run
20//! use mockforge_core::ai_studio::{ChatOrchestrator, ChatRequest};
21//! use mockforge_core::intelligent_behavior::IntelligentBehaviorConfig;
22//!
23//! # async fn example() -> mockforge_core::Result<()> {
24//! let config = IntelligentBehaviorConfig::default();
25//! let orchestrator = ChatOrchestrator::new(config);
26//!
27//! // Process a natural language command
28//! let request = ChatRequest {
29//!     message: "Create a user API with CRUD operations".to_string(),
30//!     context: None,
31//! };
32//! let response = orchestrator.process(&request).await?;
33//! # Ok(())
34//! # }
35//! ```
36
37pub mod api_critique;
38pub mod artifact_freezer;
39pub mod behavioral_simulator;
40pub mod budget_manager;
41pub mod chat_orchestrator;
42pub mod config;
43pub mod contract_diff_handler;
44pub mod conversation_store;
45pub mod debug_analyzer;
46pub mod debug_context;
47pub mod debug_context_integrator;
48pub mod nl_mock_generator;
49pub mod org_controls;
50#[cfg(feature = "database")]
51pub mod org_controls_db;
52pub mod persona_generator;
53pub mod system_generator;
54
55pub use api_critique::{
56    AntiPattern, ApiCritique, ApiCritiqueEngine, ConsolidationOpportunity, CritiqueRequest,
57    HierarchyImprovement, NamingIssue, Redundancy, ResourceModelingSuggestion,
58    RestructuringRecommendations, ToneAnalysis, ToneIssue,
59};
60pub use artifact_freezer::{ArtifactFreezer, FreezeMetadata, FreezeRequest, FrozenArtifact};
61pub use behavioral_simulator::{
62    AppState, BehaviorPolicy, BehavioralSimulator, BehavioralTraits, CartState, CreateAgentRequest,
63    Intention, NarrativeAgent, NextAction, PolicyRule, SimulateBehaviorRequest,
64    SimulateBehaviorResponse,
65};
66pub use budget_manager::{AiFeature, BudgetConfig, BudgetManager, FeatureUsage, UsageStats};
67pub use chat_orchestrator::{
68    ChatContext, ChatIntent, ChatMessage, ChatOrchestrator, ChatRequest, ChatResponse,
69};
70pub use config::{AiStudioConfig, FreezeMode};
71pub use contract_diff_handler::{
72    BreakingChange, ContractDiffFilters, ContractDiffHandler, ContractDiffIntent,
73    ContractDiffQueryResult,
74};
75pub use conversation_store::{
76    get_conversation_store, initialize_conversation_store, ConversationStore,
77};
78pub use debug_analyzer::{
79    DebugAnalyzer, DebugRequest, DebugResponse, DebugSuggestion, LinkedArtifact,
80};
81pub use debug_context::{
82    ChaosContext, ContractContext, DebugContext, PersonaContext, RealityContext, ScenarioContext,
83};
84pub use debug_context_integrator::{
85    ChaosAccessor, ContractAccessor, DebugContextIntegrator, PersonaAccessor, RealityAccessor,
86    ScenarioAccessor,
87};
88pub use nl_mock_generator::{MockGenerationResult, MockGenerator};
89pub use org_controls::{
90    OrgAiControlsConfig, OrgBudgetConfig, OrgControls, OrgControlsAccessor, OrgRateLimitConfig,
91};
92#[cfg(feature = "database")]
93pub use org_controls_db::DbOrgControls;
94pub use persona_generator::{
95    PersonaGenerationRequest, PersonaGenerationResponse, PersonaGenerator,
96};
97pub use system_generator::{
98    AppliedSystem, GeneratedSystem, SystemArtifact, SystemGenerationRequest, SystemGenerator,
99    SystemMetadata,
100};