use crate::reducer::state::PromptMode;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DevelopmentPromptExecutionPath {
Normal,
Continuation,
XsdRetry,
SameAgentRetry,
}
pub fn derive_development_prompt_execution_path(
prompt_mode: PromptMode,
) -> DevelopmentPromptExecutionPath {
match prompt_mode {
PromptMode::Normal => DevelopmentPromptExecutionPath::Normal,
PromptMode::Continuation => DevelopmentPromptExecutionPath::Continuation,
PromptMode::XsdRetry => DevelopmentPromptExecutionPath::XsdRetry,
PromptMode::SameAgentRetry => DevelopmentPromptExecutionPath::SameAgentRetry,
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_normal_mode_maps_to_normal_path() {
let path = derive_development_prompt_execution_path(PromptMode::Normal);
assert_eq!(path, DevelopmentPromptExecutionPath::Normal);
}
#[test]
fn test_continuation_mode_maps_to_continuation_path() {
let path = derive_development_prompt_execution_path(PromptMode::Continuation);
assert_eq!(path, DevelopmentPromptExecutionPath::Continuation);
}
#[test]
fn test_xsd_retry_mode_maps_to_xsd_retry_path() {
let path = derive_development_prompt_execution_path(PromptMode::XsdRetry);
assert_eq!(path, DevelopmentPromptExecutionPath::XsdRetry);
}
#[test]
fn test_same_agent_retry_mode_maps_to_same_agent_retry_path() {
let path = derive_development_prompt_execution_path(PromptMode::SameAgentRetry);
assert_eq!(path, DevelopmentPromptExecutionPath::SameAgentRetry);
}
}