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
//! # jules-rs
//!
//! A production-grade Rust client for the [Jules API](https://jules.google.com).
//!
//! Jules is Google's AI coding agent that can understand, plan, and execute
//! coding tasks on your GitHub repositories.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use jules_rs::{JulesClient, Session, SourceContext, GitHubRepoContext};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a client with your API key from jules.google.com/settings
//! let client = JulesClient::new("YOUR_API_KEY")?;
//!
//! // List all sessions
//! let response = client.list_sessions(Some(10), None).await?;
//! for session in response.sessions {
//! println!("Session: {:?} - {:?}", session.id, session.title);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Features
//!
//! - **Sessions**: Create, list, get, and delete coding sessions
//! - **Activities**: Track session activities and progress updates
//! - **Sources**: List and query connected GitHub repositories
//! - **Streaming**: Paginate through results with async streams
//! - **Type-safe**: Full Rust types for all API models
//!
//! ## Authentication
//!
//! Obtain an API key from [jules.google.com/settings](https://jules.google.com/settings).
//!
//! ## Example: Create a Session
//!
//! ```rust,no_run
//! use jules_rs::{JulesClient, Session, SourceContext, GitHubRepoContext};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let client = JulesClient::new("YOUR_OAUTH_TOKEN")?;
//!
//! let session = Session {
//! name: None,
//! id: None,
//! prompt: "Fix the bug in the login handler".to_string(),
//! source_context: SourceContext {
//! source: "sources/my-repo-id".to_string(),
//! github_repo_context: Some(GitHubRepoContext {
//! starting_branch: "main".to_string(),
//! }),
//! },
//! title: Some("Fix login bug".to_string()),
//! require_plan_approval: Some(true),
//! automation_mode: None,
//! create_time: None,
//! update_time: None,
//! state: None,
//! url: None,
//! outputs: None,
//! };
//!
//! let created = client.create_session(&session).await?;
//! println!("Created session: {}", created.name.unwrap());
//! # Ok(())
//! # }
//! ```
//!
//! ## Example: Stream All Sessions
//!
//! ```rust,no_run
//! use jules_rs::JulesClient;
//! use futures_util::StreamExt;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let client = JulesClient::new("YOUR_API_KEY")?;
//!
//! let mut stream = client.stream_sessions();
//! while let Some(result) = stream.next().await {
//! let session = result?;
//! println!("Session: {:?}", session.title);
//! }
//! # Ok(())
//! # }
//! ```
pub use JulesClient;
pub use ;
pub use *;