miyabi_claudable/lib.rs
1//! Miyabi Claudable - AI-driven Next.js frontend generation client
2//!
3//! This crate provides a Rust client for the Claudable API, enabling automated
4//! Next.js application generation through natural language descriptions.
5//!
6//! # Features
7//!
8//! - HTTP API client for Claudable
9//! - Type-safe request/response handling
10//! - Worktree integration for generated files
11//! - npm install and build automation
12//! - Comprehensive error handling
13//!
14//! # Example
15//!
16//! ```no_run
17//! use miyabi_claudable::client::ClaudableClient;
18//! use miyabi_claudable::types::GenerateRequest;
19//! use miyabi_claudable::worktree;
20//! use std::path::Path;
21//!
22//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
23//! // Create client
24//! let client = ClaudableClient::new("http://localhost:8080")?;
25//!
26//! // Generate Next.js app
27//! let request = GenerateRequest::new("Create a dashboard with charts");
28//! let response = client.generate(request).await?;
29//!
30//! // Write to worktree
31//! let worktree_path = Path::new("/path/to/worktree");
32//! worktree::write_files_to_worktree(worktree_path, &response).await?;
33//!
34//! // Install dependencies and build
35//! worktree::install_dependencies(worktree_path).await?;
36//! worktree::build_nextjs_app(worktree_path).await?;
37//! # Ok(())
38//! # }
39//! ```
40
41pub mod client;
42pub mod error;
43pub mod types;
44pub mod worktree;
45
46// Re-export commonly used types
47pub use client::ClaudableClient;
48pub use error::{ClaudableError, Result};
49pub use types::{GenerateOptions, GenerateRequest, GenerateResponse};
50pub use worktree::{build_nextjs_app, install_dependencies, write_files_to_worktree, WriteSummary};