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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//! # Bevy AI Agent - AI-Powered Game Development Assistant
//!
//! Bevy AI Agent is a comprehensive library and CLI tool that leverages cutting-edge AI models
//! (GPT-4, Claude-3, Gemini) to accelerate Bevy game development through natural language
//! code generation, intelligent feature addition, and automated code optimization.
//!
//! ## Features
//!
//! - **Natural Language Game Creation**: Describe your game in plain English and get working Bevy code
//! - **Intelligent Feature Addition**: Add complex systems to existing games with AI assistance
//! - **Code Analysis & Optimization**: AI-powered code review and performance improvements
//! - **Multi-Model Support**: Choose from GPT-4, Claude-3, or Gemini for different tasks
//! - **Context-Aware Generation**: Understands existing codebase and maintains consistency
//! - **Smart Dependency Management**: Automatically detects and manages Cargo dependencies
//! - **Built-in Game Templates**: 5 pre-built game templates for rapid prototyping
//! - **Project Management**: Complete project lifecycle management with git integration
//!
//! ## Installation
//!
//! Add this to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! bevy-agent = "0.1"
//! bevy = "0.14" # Optional, for Bevy integration features
//! tokio = { version = "1.0", features = ["full"] } # For async support
//! ```
//!
//! ## CLI Installation
//!
//! ```bash
//! # Install the CLI tool
//! cargo install bevy-agent
//!
//! # Configure API keys
//! bevy-agent config --openai-key sk-...
//!
//! # Create a new game
//! bevy-agent create "2D platformer with physics and collectibles"
//!
//! # Add features to existing games
//! bevy-agent add "inventory system with drag-and-drop UI"
//! ```
//!
//! ## Library Usage
//!
//! ### Basic AI Agent Usage
//!
//! ```rust,no_run
//! use bevy_agent::{BevyAIAgent, AIConfig};
//! use bevy_agent::config::OpenAIConfig;
//!
//! #[tokio::main]
//! async fn main() -> bevy_agent::Result<()> {
//! // Configure AI provider
//! let config = AIConfig {
//! openai: Some(OpenAIConfig {
//! api_key: "your-openai-key".to_string(),
//! organization: None,
//! base_url: None,
//! }),
//! ..Default::default()
//! };
//!
//! let agent = BevyAIAgent::new(config).await?;
//!
//! // Generate game code
//! let response = agent
//! .request("Create a simple 2D shooter game")
//! .with_system_prompt("You are a Bevy game engine expert")
//! .with_max_tokens(2000)
//! .execute()
//! .await?;
//!
//! println!("Generated code:\n{}", response.content);
//! Ok(())
//! }
//! ```
//!
//! ### Using Game Templates
//!
//! ```rust,no_run
//! use bevy_agent::game_templates::{TemplateManager, TemplateContext};
//!
//! #[tokio::main]
//! async fn main() -> bevy_agent::Result<()> {
//! let manager = TemplateManager::new()?;
//!
//! // List available templates
//! for template in manager.available_templates() {
//! println!("Available template: {}", template);
//! }
//!
//! // Generate from template
//! let context = TemplateContext::new(
//! "MyGame".to_string(),
//! "A 2D platformer game".to_string()
//! );
//!
//! let code = manager.generate("platformer_2d", &context)?;
//! println!("Generated game code:\n{}", code);
//! Ok(())
//! }
//! ```
//!
//! ## Available AI Models
//!
//! - **OpenAI**: GPT-4, GPT-3.5-turbo
//! - **Anthropic**: Claude-3 Opus, Sonnet, Haiku
//! - **Google**: Gemini Pro, Gemini Pro Vision
//!
//! ## Game Templates
//!
//! The library includes 5 built-in game templates:
//!
//! - `basic_game`: Simple 3D scene with camera and lighting
//! - `platformer_2d`: 2D platformer with physics and collectibles
//! - `fps_3d`: 3D first-person shooter with basic enemies
//! - `puzzle_game`: Grid-based puzzle game with level progression
//! - `strategy_game`: Real-time strategy with units and resources
//!
//! ## Configuration
//!
//! The library supports multiple configuration methods:
//!
//! 1. **Environment Variables**: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`
//! 2. **Configuration Files**: TOML, JSON, YAML formats
//! 3. **Programmatic**: Direct configuration in code
//!
//! ## Error Handling
//!
//! All functions return `Result<T, BevyAIError>` for comprehensive error handling:
//!
//! ```rust,no_run
//! use bevy_agent::{BevyAIError, Result};
//!
//! fn handle_errors() -> Result<()> {
//! match some_ai_operation() {
//! Ok(result) => println!("Success: {}", result),
//! Err(BevyAIError::Http(e)) => eprintln!("Network error: {}", e),
//! Err(BevyAIError::Json(e)) => eprintln!("JSON error: {}", e),
//! Err(e) => eprintln!("Other error: {}", e),
//! }
//! Ok(())
//! }
//!
//! # fn some_ai_operation() -> Result<String> { Ok("test".to_string()) }
//! ```
// Re-exports for convenience
pub use ;
pub use ;
pub use ;
pub use ;
/// Current version of the library
pub const VERSION: &str = env!;
/// User-Agent string for HTTP requests
pub const USER_AGENT: &str = concat!;