refactor: add missing schemars descriptions and correct mismatched docstrings

This commit is contained in:
Riz Ashraf committed 2026-10-10 04:33:18 +01:00
1 parent 48f49d5d02
commit a9ed5ae9c8
1 file changed
+22 -5
+22 -5
View File
@@ -18,7 +18,9 @@ pub struct CreateRelationsTool {
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ObservationInput { pub struct ObservationInput {
/// The name of the entity.
pub entity_name: String, pub entity_name: String,
/// The observation contents.
pub contents: Vec<String>, pub contents: Vec<String>,
} }
@@ -38,7 +40,9 @@ pub struct DeleteEntitiesTool {
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct DeleteObservationInput { pub struct DeleteObservationInput {
/// The name of the entity.
pub entity_name: String, pub entity_name: String,
/// The observations to delete.
pub observations: Vec<String>, pub observations: Vec<String>,
} }
@@ -313,14 +317,19 @@ pub struct QueryGraphPathTool {
/// Define a strict checklist of acceptance criteria for a given task or feature before starting work. /// Define a strict checklist of acceptance criteria for a given task or feature before starting work.
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SetAcceptanceCriteriaTool { pub struct SetAcceptanceCriteriaTool {
/// The title of the task.
pub task_title: String, pub task_title: String,
/// A list of acceptance criteria requirements.
pub criteria: Vec<String>, pub criteria: Vec<String>,
} }
/// Mark a previously defined acceptance criteria as met by providing cryptographic-like proof. /// Mark a previously defined acceptance criteria as met by providing cryptographic-like proof.
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct VerifyAcceptanceCriteriaTool { pub struct VerifyAcceptanceCriteriaTool {
/// The ID of the task.
pub task_id: String, pub task_id: String,
/// The specific criterion being verified.
pub criteria: String, pub criteria: String,
/// The proof or evidence that the criterion is met.
pub proof: String, pub proof: String,
} }
@@ -434,27 +443,35 @@ pub struct ProcessLogsTool {
/// Read a file and return only its AST skeleton (Imports, Structs, Enums, Traits, Functions) /// Read a file and return only its AST skeleton (Imports, Structs, Enums, Traits, Functions)
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadFileSkeletonTool { pub struct ReadFileSkeletonTool {
/// The path to the file to read.
pub file_path: String, pub file_path: String,
} }
/// Replace a specific AST node in a file (robust structural editing). Use this instead of regex or line-based string replacement to prevent indentation bugs and matching failures. /// Replace a specific AST node in a file (robust structural editing). Use this instead of regex or line-based string replacement to prevent indentation bugs and matching failures.
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReplaceAstNodeTool { pub struct ReplaceAstNodeTool {
/// The path of the file to modify.
pub file_path: String, pub file_path: String,
pub node_type: String, // e.g., "function_item", "impl_item" /// The AST node type to replace (e.g., 'function_item', 'impl_item').
pub node_name: String, // e.g., "execute" pub node_type: String,
/// The name of the specific AST node to replace (e.g., 'execute').
pub node_name: String,
/// The completely new structural content for this AST node.
pub new_content: String, pub new_content: String,
} }
/// Semantic code search using local vector embeddings. Use this conceptual search instead of raw regex (grep) when trying to locate abstract logic or exploring new patterns. /// Semantic code search using local vector embeddings. Use this conceptual search instead of raw regex (grep) when trying to locate abstract logic or exploring new patterns.
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct SemanticCodeSearchTool { pub struct SemanticCodeSearchTool {
/// The conceptual or semantic search query.
pub query: String, pub query: String,
/// Optional directory to restrict the search to.
pub directory: Option<String>, pub directory: Option<String>,
} }
/// Get a bird's-eye view of directory architecture. Use this when first exploring a new repository to get a summary of what each file is responsible for, instead of blindly reading files. /// Get a bird's-eye view of directory architecture. Use this when first exploring a new repository to get a summary of what each file is responsible for, instead of blindly reading files.
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ReadDirectoryArchitectureTool { pub struct ReadDirectoryArchitectureTool {
/// The directory path to analyze.
pub directory: String, pub directory: String,
} }
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)] #[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
@@ -677,9 +694,9 @@ pub struct TasksTool {
/// Optional assigned subagent role or identifier. /// Optional assigned subagent role or identifier.
pub assigned_agent: Option<String>, pub assigned_agent: Option<String>,
/// Optional verification command to validate criteria completion. /// Optional verification command to validate criteria completion.
pub verification_command: Option<String>,
/// Optional pagination offset for 'list'. /// Optional pagination offset for 'list'.
pub offset: Option<usize>, pub offset: Option<usize>,
pub verification_command: Option<String>,
} }
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)] #[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
@@ -787,7 +804,7 @@ pub enum DecisionAction {
/// Next steps on error: Provide title for 'log' or id for 'update'/'delete'. /// Next steps on error: Provide title for 'log' or id for 'update'/'delete'.
#[derive(Deserialize, Serialize, JsonSchema, Debug, Clone)] #[derive(Deserialize, Serialize, JsonSchema, Debug, Clone)]
pub struct DecisionsTool { pub struct DecisionsTool {
/// Action to perform: 'log', 'query', or 'delete'. /// Action to perform: 'log', 'query', 'update', or 'delete'.
pub action: DecisionAction, pub action: DecisionAction,
/// ADR ID (required for 'delete'). /// ADR ID (required for 'delete').
pub id: Option<String>, pub id: Option<String>,
@@ -949,7 +966,7 @@ pub enum ClipboardAction {
/// "look at clipboard", "what I copied", or shares terminal error captures. /// "look at clipboard", "what I copied", or shares terminal error captures.
#[derive(Debug, Deserialize, Serialize, JsonSchema)] #[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct ClipboardTool { pub struct ClipboardTool {
/// Action to perform: 'image', 'text', 'history', 'clear', 'read', or 'write'. /// Action to perform: 'image', 'text', 'history', 'clear', or 'write'.
pub action: ClipboardAction, pub action: ClipboardAction,
/// Plain text content (for 'write'). /// Plain text content (for 'write').
pub text: Option<String>, pub text: Option<String>,