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
//! Type definitions for prompts.
//!
//! This module contains the enums and types used to configure prompts
//! for different roles, actions, and context levels.
/// Context level for agents.
///
/// Controls how much context information is included in prompts.
/// Lower context helps maintain "fresh eyes" perspective for reviewers.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ContextLevel {
/// Minimal context (fresh eyes) - only essential info
Minimal = 0,
/// Normal context - includes status information
Normal = 1,
}
impl From<u8> for ContextLevel {
fn from(v: u8) -> Self {
if v == 0 {
Self::Minimal
} else {
Self::Normal
}
}
}
/// Role types for agents.
///
/// Determines which type of agent is being configured.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Role {
/// Developer agent - implements features
Developer,
/// Reviewer agent - reviews and fixes issues
Reviewer,
}
/// Action types for prompts.
///
/// Specifies what action the agent should perform.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Action {
/// Create an implementation plan
Plan,
/// Execute an iteration of development
Iterate,
/// Fix issues found during review
Fix,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_context_level_from_u8() {
assert_eq!(ContextLevel::from(0), ContextLevel::Minimal);
assert_eq!(ContextLevel::from(1), ContextLevel::Normal);
assert_eq!(ContextLevel::from(2), ContextLevel::Normal);
assert_eq!(ContextLevel::from(255), ContextLevel::Normal);
}
}