Skip to main content

Module ai_studio

Module ai_studio 

Source
Expand description

Pillars: [AI]

MockForge AI Studio - Unified AI Copilot

This module provides a unified interface for all AI-powered features in MockForge, including natural language mock generation, AI-guided debugging, persona generation, and artifact freezing for deterministic testing.

§Features

  • Natural Language Mock Generation: Generate mocks from conversational descriptions
  • AI-Guided Debugging: Analyze test failures and suggest fixes
  • Persona Generation: Create and tweak personas using AI
  • Artifact Freezing: Convert AI outputs to deterministic YAML/JSON
  • Cost & Budget Management: Track tokens and enforce budgets

§Example Usage

use mockforge_core::ai_studio::{ChatOrchestrator, ChatRequest};
use mockforge_core::intelligent_behavior::IntelligentBehaviorConfig;

async fn example() -> mockforge_core::Result<()> {
    let config = IntelligentBehaviorConfig::default();
    let orchestrator = ChatOrchestrator::new(config);

    // Process a natural language command
    let request = ChatRequest {
        message: "Create a user API with CRUD operations".to_string(),
        context: None,
    };
    let response = orchestrator.process(&request).await?;
    Ok(())
}

Re-exports§

pub use api_critique::ApiCritiqueEngine;
pub use artifact_freezer::ArtifactFreezer;
pub use behavioral_simulator::BehavioralSimulator;
pub use budget_manager::AiFeature;
pub use budget_manager::BudgetConfig;
pub use budget_manager::BudgetManager;
pub use budget_manager::FeatureUsage;
pub use budget_manager::UsageStats;
pub use chat_orchestrator::ChatContext;
pub use chat_orchestrator::ChatIntent;
pub use chat_orchestrator::ChatMessage;
pub use chat_orchestrator::ChatOrchestrator;
pub use chat_orchestrator::ChatRequest;
pub use chat_orchestrator::ChatResponse;
pub use config::AiStudioConfig;
pub use config::FreezeMode;
pub use contract_diff_handler::BreakingChange;
pub use contract_diff_handler::ContractDiffFilters;
pub use contract_diff_handler::ContractDiffHandler;
pub use contract_diff_handler::ContractDiffIntent;
pub use contract_diff_handler::ContractDiffQueryResult;
pub use conversation_store::get_conversation_store;
pub use conversation_store::initialize_conversation_store;
pub use conversation_store::ConversationStore;
pub use debug_analyzer::DebugAnalyzer;
pub use debug_analyzer::DebugRequest;
pub use debug_analyzer::DebugResponse;
pub use debug_analyzer::DebugSuggestion;
pub use debug_analyzer::LinkedArtifact;
pub use debug_context::ChaosContext;
pub use debug_context::ContractContext;
pub use debug_context::DebugContext;
pub use debug_context::PersonaContext;
pub use debug_context::RealityContext;
pub use debug_context::ScenarioContext;
pub use debug_context_integrator::ChaosAccessor;
pub use debug_context_integrator::ContractAccessor;
pub use debug_context_integrator::DebugContextIntegrator;
pub use debug_context_integrator::PersonaAccessor;
pub use debug_context_integrator::RealityAccessor;
pub use debug_context_integrator::ScenarioAccessor;
pub use nl_mock_generator::MockGenerationResult;
pub use nl_mock_generator::MockGenerator;
pub use org_controls::OrgAiControlsConfig;
pub use org_controls::OrgBudgetConfig;
pub use org_controls::OrgControls;
pub use org_controls::OrgControlsAccessor;
pub use org_controls::OrgRateLimitConfig;
pub use persona_generator::PersonaGenerationRequest;
pub use persona_generator::PersonaGenerationResponse;
pub use persona_generator::PersonaGenerator;
pub use system_generator::SystemGenerator;

Modules§

api_critique
API Architecture Critique Engine
artifact_freezer
Artifact freezer for converting AI outputs to deterministic formats
behavioral_simulator
AI Behavioral Simulation Engine
budget_manager
Budget manager for AI usage tracking and controls
chat_orchestrator
Chat orchestrator for routing natural language commands
config
Configuration for AI Studio
contract_diff_handler
Contract Diff Handler for processing natural language queries
conversation_store
Conversation storage for AI Studio chat sessions
debug_analyzer
AI-guided debugging analyzer
debug_context
Debug context types for AI-guided debugging
debug_context_integrator
Debug context integrator for collecting context from multiple subsystems
nl_mock_generator
Natural language mock generator
org_controls
Organization-level AI controls service
persona_generator
AI-powered persona generator
system_generator
System Generator - Natural Language to Entire System Generation

Structs§

AntiPattern
Detected anti-pattern in API design
ApiCritique
API critique result
AppState
App state awareness
AppliedSystem
Result of applying a system design
BehaviorPolicy
Behavior policy attached to persona
BehavioralTraits
Behavioral traits for the agent
CartState
Cart state
ConsolidationOpportunity
Consolidation opportunity
CreateAgentRequest
Request to create a narrative agent
CritiqueRequest
Request for API critique analysis
FreezeMetadata
Metadata for frozen artifacts
FreezeRequest
Request to freeze an artifact
FrozenArtifact
Frozen artifact result
GeneratedSystem
Generated system with all artifacts
HierarchyImprovement
Hierarchy improvement suggestion
NamingIssue
Naming quality issue
NarrativeAgent
Narrative agent that models user behavior
NextAction
Next action to take
PolicyRule
Policy rule for behavior
Redundancy
Detected redundancy in API
ResourceModelingSuggestion
Resource modeling suggestion
RestructuringRecommendations
Restructuring recommendations
SimulateBehaviorRequest
Request to simulate behavior
SimulateBehaviorResponse
Response from behavior simulation
SystemArtifact
System artifact (OpenAPI spec, persona, lifecycle, etc.)
SystemGenerationRequest
Request for system generation
SystemMetadata
System generation metadata
ToneAnalysis
Emotional tone analysis
ToneIssue
Tone issue in API text

Enums§

Intention
User intention types