Skip to main content

dk_agent_sdk/
lib.rs

1//! # dk-agent-sdk
2//!
3//! Typed Rust client for the dkod Agent Protocol.
4//!
5//! This crate wraps the tonic-generated gRPC client from `dk-protocol` and
6//! provides a clean, session-oriented API for AI agents to interact with a
7//! dkod server.
8//!
9//! ## Quick start
10//!
11//! ```rust,no_run
12//! use dk_agent_sdk::{AgentClient, Change, Depth};
13//!
14//! # async fn example() -> dk_agent_sdk::Result<()> {
15//! let mut client = AgentClient::connect("http://localhost:50051", "my-token").await?;
16//! let mut session = client.init("my-repo", "fix auth bug").await?;
17//!
18//! let ctx = session.context("auth middleware", Depth::Full, 4000).await?;
19//! session.submit(vec![Change::modify("src/auth.rs", "// fixed")]).await?;
20//! let steps = session.verify().await?;
21//! let result = session.merge("fix: auth bypass").await?;
22//! # Ok(())
23//! # }
24//! ```
25
26pub mod client;
27pub mod error;
28pub mod session;
29pub mod tools;
30pub mod types;
31
32pub use client::AgentClient;
33pub use error::{Result, SdkError};
34pub use session::Session;
35pub use types::*;