actflow_agent_sdk/
lib.rs

1//! # Actflow Agent SDK
2//!
3//! A Rust SDK for building agents for Actflow workflow engine.
4//!
5//! ## Quick Start
6//!
7//! ```rust,ignore
8//! use actflow_agent_sdk::{Agent, AgentServer, Context, Inputs, LogSender};
9//! use actflow_agent_sdk::{AgentOutput, NodeExecutionStatus};
10//!
11//! struct MyAgent;
12//!
13//! impl Agent for MyAgent {
14//!     async fn run(
15//!         &self,
16//!         nid: String,
17//!         ctx: Context,
18//!         inputs: Inputs,
19//!         log: LogSender,
20//!     ) -> AgentOutput {
21//!         log.send("Starting agent...").await;
22//!         // Your agent logic here
23//!         AgentOutput::success(serde_json::json!({"result": "done"}))
24//!     }
25//! }
26//!
27//! #[tokio::main]
28//! async fn main() {
29//!     AgentServer::new(MyAgent)
30//!         .serve("0.0.0.0:50051")
31//!         .await
32//!         .unwrap();
33//! }
34//! ```
35
36mod proto {
37    tonic::include_proto!("agent");
38}
39
40mod agent;
41mod server;
42mod types;
43
44pub use agent::{Agent, LogSender};
45pub use server::AgentServer;
46pub use types::*;
47
48// Re-export proto types for advanced usage
49pub mod pb {
50    pub use crate::proto::*;
51}