mockforge_core/voice/
mod.rs

1//! Pillars: [AI][DevX]
2//!
3//! Voice + LLM Interface for MockForge
4//!
5//! This module provides voice input capability that allows users to build mocks
6//! conversationally using natural language commands. It leverages MockForge's
7//! existing LLM infrastructure to interpret voice commands and generate mock APIs.
8//!
9//! # Features
10//!
11//! - **Natural Language Command Parsing**: Interpret voice commands using LLM
12//! - **OpenAPI Spec Generation**: Generate OpenAPI 3.0 specs from voice commands
13//! - **Conversational Mode**: Support multi-turn conversations for iterative refinement
14//! - **Single-Shot Mode**: Process complete commands in one go
15//!
16//! # Example Usage
17//!
18//! ```rust,no_run
19//! use mockforge_core::voice::{VoiceCommandParser, VoiceCommand};
20//! use mockforge_core::intelligent_behavior::IntelligentBehaviorConfig;
21//!
22//! # async fn example() -> mockforge_core::Result<()> {
23//! let config = IntelligentBehaviorConfig::default();
24//! let parser = VoiceCommandParser::new(config);
25//!
26//! // Parse a voice command
27//! let command = "Create a fake e-commerce API with 20 products and a checkout flow";
28//! let parsed = parser.parse_command(command).await?;
29//!
30//! // Generate OpenAPI spec
31//! let spec_generator = VoiceSpecGenerator::new();
32//! let spec = spec_generator.generate_spec(&parsed).await?;
33//! # Ok(())
34//! # }
35//! ```
36
37pub mod command_parser;
38pub mod conversation;
39pub mod hook_transpiler;
40pub mod spec_generator;
41pub mod workspace_builder;
42pub mod workspace_scenario_generator;
43
44pub use command_parser::{
45    ApiRequirement, EntityRequirement, ParsedCommand, ParsedContinuumRule, ParsedDriftBudget,
46    ParsedRealityContinuum, ParsedServiceBudget, ParsedWorkspaceCreation, ParsedWorkspaceScenario,
47    PersonaRequirement, ScenarioRequirement, VoiceCommandParser,
48};
49pub use conversation::{ConversationContext, ConversationManager, ConversationState};
50pub use hook_transpiler::HookTranspiler;
51pub use spec_generator::VoiceSpecGenerator;
52pub use workspace_builder::{BuiltWorkspace, WorkspaceBuilder};
53pub use workspace_scenario_generator::{
54    GeneratedWorkspaceScenario, WorkspaceConfigSummary, WorkspaceScenarioGenerator,
55};