use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ReasoningResult {
pub problem: String,
pub solution: String,
pub thought_tree: String,
pub depth: usize,
pub branches: usize,
pub raw_content: String,
}
#[derive(Debug, Clone, Default)]
pub struct ReasoningOptions {
pub depth: Option<usize>,
pub branches: Option<usize>,
}
impl ReasoningOptions {
pub fn new() -> Self {
Self::default()
}
pub fn depth(mut self, depth: usize) -> Self {
self.depth = Some(depth);
self
}
pub fn branches(mut self, branches: usize) -> Self {
self.branches = Some(branches);
self
}
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum SourceType {
Text,
Code,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Concept {
pub name: String,
pub concept_type: String,
pub weight: f64,
pub description: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConceptResult {
pub concepts: Vec<Concept>,
pub source_type: SourceType,
pub raw_content: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Chunk {
pub id: String,
pub content: String,
pub position: usize,
pub priority: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChunkResult {
pub chunks: Vec<Chunk>,
pub total_chunks: usize,
pub raw_content: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RetrievalResult {
pub query: String,
pub results: Vec<Chunk>,
pub raw_content: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GraphNode {
pub id: String,
pub name: String,
pub node_type: String,
pub weight: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct KnowledgeGraphResult {
pub operation: String,
pub nodes: Vec<GraphNode>,
pub stats: Option<serde_json::Value>,
pub raw_content: String,
}
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum DetailLevel {
Brief,
#[default]
Normal,
Detailed,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlanStep {
pub number: usize,
pub title: String,
pub description: String,
pub priority: String,
pub effort: String,
pub dependencies: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PlanResult {
pub task: String,
pub category: String,
pub steps: Vec<PlanStep>,
pub total_effort: String,
pub raw_content: String,
}
#[derive(Debug, Clone, Default)]
pub struct PlanOptions {
pub context: Option<String>,
pub max_steps: Option<usize>,
pub detail_level: Option<DetailLevel>,
}
impl PlanOptions {
pub fn new() -> Self {
Self::default()
}
pub fn context(mut self, context: impl Into<String>) -> Self {
self.context = Some(context.into());
self
}
pub fn max_steps(mut self, max_steps: usize) -> Self {
self.max_steps = Some(max_steps);
self
}
pub fn detail_level(mut self, level: DetailLevel) -> Self {
self.detail_level = Some(level);
self
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolDefinition {
pub name: String,
pub description: String,
pub input_schema: serde_json::Value,
}
#[derive(Debug, Clone)]
pub struct ClientOptions {
pub server_path: Option<String>,
pub timeout_ms: u64,
pub auto_connect: bool,
}
impl Default for ClientOptions {
fn default() -> Self {
Self {
server_path: None,
timeout_ms: 30000,
auto_connect: true,
}
}
}
impl ClientOptions {
pub fn new() -> Self {
Self::default()
}
pub fn server_path(mut self, path: impl Into<String>) -> Self {
self.server_path = Some(path.into());
self
}
pub fn timeout_ms(mut self, timeout: u64) -> Self {
self.timeout_ms = timeout;
self
}
pub fn auto_connect(mut self, auto: bool) -> Self {
self.auto_connect = auto;
self
}
}