refactor: eradicate deprecated tools (sticky_notes, pinned_files, context_workspaces, pr_checklist, preferences) and dead code
This commit is contained in:
1 parent
d80915635f
commit
79209da711
31 files changed
+1230
-3920
No files matched your search
+15
-726
@@ -1,23 +1,6 @@
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Extracts the current contents of the OS clipboard (text, HTML, files, and image).
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ReadClipboardTool {}
|
||||
|
||||
/// Writes contents to the OS clipboard. You can provide any combination of text, HTML, file paths, or an image path.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct WriteClipboardTool {
|
||||
/// Optional plain text to write to the clipboard.
|
||||
pub text: Option<String>,
|
||||
/// Optional HTML to write to the clipboard (useful for rich text pasting).
|
||||
pub html: Option<String>,
|
||||
/// Optional absolute file paths to write to the clipboard as a Windows File Drop.
|
||||
pub files: Option<Vec<String>>,
|
||||
/// Optional absolute path to a local image to write to the clipboard.
|
||||
pub image_path: Option<String>,
|
||||
}
|
||||
|
||||
/// Create new entities in the knowledge graph. Note: entity_type MUST ALWAYS be PascalCase (e.g. DatabaseTable, McpTool, File).
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CreateEntitiesTool {
|
||||
@@ -166,39 +149,6 @@ pub struct VisualizeGraphTool {
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum StickyNoteAction {
|
||||
#[serde(alias = "ADD", alias = "Add", alias = "create", alias = "insert")]
|
||||
Add,
|
||||
#[serde(alias = "READ", alias = "Read", alias = "list", alias = "get")]
|
||||
Read,
|
||||
#[serde(alias = "DELETE", alias = "Delete", alias = "remove", alias = "rm")]
|
||||
Delete,
|
||||
#[serde(alias = "CLEAR", alias = "Clear", alias = "purge")]
|
||||
Clear,
|
||||
}
|
||||
|
||||
/// Ephemeral sticky notes with TTL for scratchpad items, ports, and transient notes.
|
||||
/// Actions:
|
||||
/// - 'add': Add note. Required: content. Optional: ttl_seconds, session_only.
|
||||
/// - 'read': Read all active notes.
|
||||
/// - 'delete': Delete note. Required: index (1-based integer).
|
||||
/// - 'clear': Clear all active notes.
|
||||
/// Next steps on error: Ensure required fields for the specific action are supplied.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct StickyNotesTool {
|
||||
/// Action to perform: 'add', 'read', 'delete', or 'clear'.
|
||||
pub action: StickyNoteAction,
|
||||
/// Content of the sticky note (required for 'add').
|
||||
pub content: Option<String>,
|
||||
/// 1-indexed position of the sticky note to delete (required for 'delete').
|
||||
pub index: Option<usize>,
|
||||
/// Optional time-to-live in seconds (for 'add').
|
||||
pub ttl_seconds: Option<u64>,
|
||||
/// Optional flag to auto-expire the note at the end of the current session (for 'add').
|
||||
pub session_only: Option<bool>,
|
||||
}
|
||||
|
||||
/// Condense or summarize an entity's observations to reduce size.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
@@ -209,124 +159,6 @@ pub struct CondenseEntityTool {
|
||||
pub summarized_observations: Vec<String>,
|
||||
}
|
||||
|
||||
/// Add a new task to the task tracker.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct AddTaskTool {
|
||||
/// The title of the task.
|
||||
pub title: String,
|
||||
/// A detailed description of the task.
|
||||
pub description: String,
|
||||
/// The associated git branch, if any.
|
||||
pub git_branch: Option<String>,
|
||||
/// Optional parent task ID to create a nested sub-task.
|
||||
pub parent_id: Option<String>,
|
||||
/// Optional list of task IDs this task depends on.
|
||||
pub dependencies: Option<Vec<String>>,
|
||||
/// Optional namespace (defaults to 'default').
|
||||
pub namespace: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional task priority: 'low', 'medium', 'high', 'urgent'.
|
||||
pub priority: Option<String>,
|
||||
/// Optional assigned subagent role or identifier.
|
||||
pub assigned_agent: Option<String>,
|
||||
/// Optional verification command to validate criteria completion.
|
||||
pub verification_command: Option<String>,
|
||||
}
|
||||
|
||||
/// Delete a task and all its children.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct DeleteTaskTool {
|
||||
/// The ID of the task to delete.
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
/// Update the status of an existing task.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct UpdateTaskStatusTool {
|
||||
/// The ID of the task to update.
|
||||
pub id: String,
|
||||
/// The new status of the task (e.g., 'pending', 'completed', 'cancelled').
|
||||
#[schemars(description = "Must be 'pending', 'completed', or 'cancelled'")]
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
/// List all currently active tasks.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ListActiveTasksTool {
|
||||
/// Optional git branch to filter tasks by.
|
||||
pub git_branch: Option<String>,
|
||||
/// Optional summary level: 'compact' (IDs and titles), 'detailed', or 'full'. Defaults to 'detailed'.
|
||||
pub summary_level: Option<String>,
|
||||
/// Optional token budget cap. Truncates results to stay within max_tokens.
|
||||
pub max_tokens: Option<usize>,
|
||||
}
|
||||
|
||||
/// Store a reusable code snippet.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct StoreSnippetTool {
|
||||
/// The name of the snippet.
|
||||
pub name: String,
|
||||
/// The programming language of the snippet.
|
||||
pub language: String,
|
||||
/// The code snippet content.
|
||||
pub code: String,
|
||||
/// A description of what the snippet does.
|
||||
pub description: String,
|
||||
/// Optional classification tags (e.g. ['rust', 'async', 'mcp']).
|
||||
pub tags: Option<Vec<String>>,
|
||||
/// Optional project namespace.
|
||||
pub namespace: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional origin file path where the snippet was extracted from.
|
||||
pub origin_file: Option<String>,
|
||||
/// Optional line range in origin file (e.g. 'L10-L45').
|
||||
pub line_range: Option<String>,
|
||||
}
|
||||
|
||||
/// Add classification tags to an existing code snippet.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct TagSnippetTool {
|
||||
/// The name of the snippet to tag.
|
||||
pub name: String,
|
||||
/// Array of tags (e.g. ['rust', 'async', 'mcp']).
|
||||
pub tags: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SnippetSearchMode {
|
||||
#[serde(alias = "HYBRID", alias = "Hybrid")]
|
||||
Hybrid,
|
||||
#[serde(alias = "KEYWORD", alias = "Keyword")]
|
||||
Keyword,
|
||||
#[serde(alias = "SEMANTIC", alias = "Semantic")]
|
||||
Semantic,
|
||||
}
|
||||
|
||||
/// Search stored code snippets using Hybrid BM25 + Vector ranking or keyword search.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct SearchSnippetsTool {
|
||||
/// The search query.
|
||||
pub query: String,
|
||||
/// Search mode: 'hybrid' (BM25 + Semantic Tags), 'keyword', or 'semantic'. Defaults to 'hybrid'.
|
||||
pub mode: Option<SnippetSearchMode>,
|
||||
/// Optional classification tags to filter by.
|
||||
pub tags: Option<Vec<String>>,
|
||||
/// Limit the number of results to avoid context limit overflow. Defaults to 10.
|
||||
pub limit: Option<usize>,
|
||||
/// Include the full code content of the matched items. If false, returns only IDs and descriptions. Defaults to false.
|
||||
pub include_body: Option<bool>,
|
||||
}
|
||||
|
||||
/// Delete a stored code snippet.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct DeleteSnippetTool {
|
||||
/// The name of the snippet to delete.
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SubgraphFormat {
|
||||
@@ -351,15 +183,6 @@ pub struct GetSubgraphTool {
|
||||
pub max_tokens: Option<usize>,
|
||||
}
|
||||
|
||||
/// Search historical error fixes using keyword search or semantic vector similarity and return matching solutions.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct SuggestErrorFixTool {
|
||||
/// The exact stack trace or error signature.
|
||||
pub stack_trace: String,
|
||||
/// Maximum number of suggested fixes to return. Defaults to 3.
|
||||
pub limit: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CheckpointAction {
|
||||
@@ -382,66 +205,6 @@ pub struct ManageCheckpointTool {
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Save a named memory snapshot checkpoint before risky operations or subagent invocations.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CheckpointStateTool {
|
||||
/// The unique name for this state snapshot checkpoint.
|
||||
pub name: String,
|
||||
/// Optional description of why this checkpoint was created.
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
||||
/// Restore a previously saved memory snapshot checkpoint.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct RestoreStateTool {
|
||||
/// The name of the checkpoint to restore.
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
/// Log an architectural decision record (ADR).
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LogDecisionTool {
|
||||
/// The title of the decision.
|
||||
pub title: String,
|
||||
/// The context or problem requiring a decision.
|
||||
pub context: String,
|
||||
/// The decision made.
|
||||
pub decision: String,
|
||||
/// The consequence of the decision.
|
||||
#[serde(alias = "consequences")]
|
||||
pub consequence: String,
|
||||
/// The ID of an older ADR this decision supersedes, if any.
|
||||
pub supersedes: Option<String>,
|
||||
/// Optional project namespace.
|
||||
pub namespace: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional author or architect behind the decision.
|
||||
pub author: Option<String>,
|
||||
/// Optional affected system components or crates.
|
||||
pub affected_components: Option<Vec<String>>,
|
||||
/// Optional alternative designs or libraries considered.
|
||||
pub alternatives_considered: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
/// Query architectural decision records.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct QueryDecisionsTool {
|
||||
/// Optional search query.
|
||||
pub query: Option<String>,
|
||||
/// Limit the number of results to avoid context limit overflow. Defaults to 5.
|
||||
pub limit: Option<usize>,
|
||||
/// Include the full body/content of the matched ADRs. If false, returns only titles and IDs (recommended for LLMs to prevent context bloat). Defaults to false.
|
||||
pub include_body: Option<bool>,
|
||||
}
|
||||
|
||||
/// Delete an architectural decision record (ADR).
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct DeleteDecisionTool {
|
||||
/// The ID of the decision to delete.
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
/// Merge two entities in the knowledge graph into one.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct MergeEntitiesTool {
|
||||
@@ -455,19 +218,6 @@ pub struct MergeEntitiesTool {
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct FindOrphansTool {}
|
||||
|
||||
/// Record a user preference or behavior to adapt future interactions.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LearnPreferenceTool {
|
||||
/// The key for the preference.
|
||||
pub key: String,
|
||||
/// The value of the preference.
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
/// Read all learned user preferences.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ReadPreferencesTool {}
|
||||
|
||||
/// Log a complex error and its fix for future reference.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LogErrorFixTool {
|
||||
@@ -497,44 +247,6 @@ pub struct SearchErrorFixesTool {
|
||||
/// Include the full solution details. If false, returns only error signatures. Defaults to false.
|
||||
pub include_body: Option<bool>,
|
||||
}
|
||||
|
||||
/// Pin a file to keep it explicitly in the context workspace.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct PinFileTool {
|
||||
/// The namespace to pin the file in.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The absolute path of the file to pin.
|
||||
pub file_path: String,
|
||||
/// The associated git branch, if any.
|
||||
pub git_branch: Option<String>,
|
||||
/// Optional reason for pinning this file.
|
||||
pub pin_reason: Option<String>,
|
||||
/// Optional symbol focus or line range.
|
||||
pub symbol_or_line: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
}
|
||||
|
||||
/// Unpin a file from the context workspace.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct UnpinFileTool {
|
||||
/// The namespace the file is pinned in.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The absolute path of the file to unpin.
|
||||
pub file_path: String,
|
||||
}
|
||||
|
||||
/// List all currently pinned files.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ListPinnedFilesTool {
|
||||
/// Optional namespace to filter by.
|
||||
pub namespace: Option<String>,
|
||||
/// Optional git branch to filter by.
|
||||
pub git_branch: Option<String>,
|
||||
}
|
||||
|
||||
/// Add a summary of the current session.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct AddSessionSummaryTool {
|
||||
@@ -544,105 +256,6 @@ pub struct AddSessionSummaryTool {
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Get a timeline of major project events.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
#[allow(dead_code)]
|
||||
pub struct GetProjectTimelineTool {
|
||||
/// Optional namespace to restrict the timeline to.
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Leave a memo for the next session or agent.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LeaveHandoffMemoTool {
|
||||
/// The content of the memo.
|
||||
pub content: String,
|
||||
/// The namespace to leave the memo in.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Read pending handoff memos.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ReadHandoffMemosTool {
|
||||
/// Optional namespace to restrict the read to.
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Clear handoff memos after reading.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ClearHandoffMemosTool {
|
||||
/// Array of memo IDs to clear.
|
||||
pub ids: Vec<String>,
|
||||
}
|
||||
|
||||
/// Update the environment fingerprint (e.g., OS, tool versions).
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct UpdateEnvFingerprintTool {
|
||||
/// The namespace to update the fingerprint for.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// A map of tool names to their versions.
|
||||
pub tool_versions: std::collections::HashMap<String, String>,
|
||||
}
|
||||
|
||||
/// Read the environment fingerprint.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ReadEnvFingerprintTool {
|
||||
/// The namespace to read the fingerprint for.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Log a required environment variable or configuration.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LogEnvRequirementTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The environment variable key (e.g., DATABASE_URL).
|
||||
pub key: String,
|
||||
/// A description of what the variable is used for.
|
||||
pub description: String,
|
||||
/// Whether the variable contains a secret.
|
||||
pub is_secret: bool,
|
||||
}
|
||||
|
||||
/// Add a new milestone.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct AddMilestoneTool {
|
||||
/// The title of the milestone.
|
||||
pub title: String,
|
||||
/// The namespace for the milestone.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// Optional target completion date.
|
||||
pub target_date: Option<String>,
|
||||
/// Optional description of milestone scope.
|
||||
pub description: Option<String>,
|
||||
/// Optional deliverables or task checklist.
|
||||
pub deliverables: Option<Vec<String>>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
}
|
||||
|
||||
/// Update the status of a milestone.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct UpdateMilestoneTool {
|
||||
/// The ID of the milestone to update.
|
||||
pub id: String,
|
||||
/// The new status (e.g., 'active', 'completed').
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
/// List all milestones.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ListMilestonesTool {
|
||||
/// Optional namespace to restrict the list to.
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Generate a standup report for a specific time window.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct GenerateStandupReportTool {
|
||||
@@ -652,165 +265,6 @@ pub struct GenerateStandupReportTool {
|
||||
/// The number of hours to look back for activity.
|
||||
pub hours_lookback: u64,
|
||||
}
|
||||
|
||||
/// Register a new infrastructure environment.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct RegisterEnvironmentTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The name of the environment (e.g., 'staging', 'prod').
|
||||
pub name: String,
|
||||
/// The URL or connection string for the environment.
|
||||
pub url: String,
|
||||
/// A description of the environment.
|
||||
pub description: String,
|
||||
/// Whether a VPN is required to access the environment.
|
||||
pub requires_vpn: bool,
|
||||
}
|
||||
|
||||
/// Get details about a registered environment.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct GetEnvironmentDetailsTool {
|
||||
/// The namespace to retrieve details for.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Add an item to the PR checklist.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct AddPrChecklistItemTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The description of the checklist item.
|
||||
pub description: String,
|
||||
/// Optional checklist category (e.g. 'Security', 'Testing', 'Formatting').
|
||||
pub category: Option<String>,
|
||||
/// Optional automated verification command or script.
|
||||
pub automated_check: Option<String>,
|
||||
/// Optional checked state.
|
||||
pub is_checked: Option<bool>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
}
|
||||
|
||||
/// Get the PR checklist.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct GetPrChecklistTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Clear the PR checklist.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ClearPrChecklistTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Log a technical debt record.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LogTechDebtTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// A description of the technical debt.
|
||||
pub description: String,
|
||||
/// The ideal solution to resolve the debt.
|
||||
pub ideal_solution: String,
|
||||
/// The associated git commit hash, if any.
|
||||
pub git_commit: Option<String>,
|
||||
/// The associated git branch, if any.
|
||||
pub git_branch: Option<String>,
|
||||
/// Optional symbol references (e.g. ['MemoryIndex', 'switchTab']) associated with the tech debt.
|
||||
pub symbol_references: Option<Vec<String>>,
|
||||
/// Optional line range (e.g. 'L123-L145') associated with the tech debt.
|
||||
pub line_range: Option<String>,
|
||||
/// Optional debt severity: 'low', 'medium', 'high', 'critical'.
|
||||
pub severity: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional file path where debt exists.
|
||||
pub file_path: Option<String>,
|
||||
/// Optional workaround currently in place.
|
||||
pub workaround: Option<String>,
|
||||
/// Optional effort estimate to fix (e.g. '1 hour', '2 days').
|
||||
pub effort_estimate: Option<String>,
|
||||
}
|
||||
|
||||
/// Resolve a technical debt record.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ResolveTechDebtTool {
|
||||
/// The ID of the technical debt record to resolve.
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
/// List technical debt records.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ListTechDebtTool {
|
||||
/// The namespace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// Whether to include resolved technical debt in the results.
|
||||
pub include_resolved: bool,
|
||||
/// Optional summary level: 'compact' (IDs and descriptions), 'detailed', or 'full'. Defaults to 'detailed'.
|
||||
pub summary_level: Option<String>,
|
||||
/// Optional token budget cap. Truncates results to stay within max_tokens.
|
||||
pub max_tokens: Option<usize>,
|
||||
}
|
||||
|
||||
/// Save the current context workspace.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct SaveContextWorkspaceTool {
|
||||
/// The namespace for the workspace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The name to save the workspace as.
|
||||
pub name: String,
|
||||
/// Array of pinned file paths.
|
||||
pub pinned_files: Vec<String>,
|
||||
/// Array of active task IDs.
|
||||
pub active_task_ids: Vec<String>,
|
||||
/// Optional description of the context workspace purpose.
|
||||
pub description: Option<String>,
|
||||
/// Optional git branch associated with this workspace.
|
||||
pub git_branch: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional VCS revision or commit hash.
|
||||
pub vcs_revision: Option<String>,
|
||||
}
|
||||
|
||||
/// Load a saved context workspace.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct LoadContextWorkspaceTool {
|
||||
/// The namespace of the workspace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The name of the workspace to load.
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
/// List all saved context workspaces.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ListContextWorkspacesTool {
|
||||
/// The namespace to list workspaces for.
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Delete a saved context workspace.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct DeleteContextWorkspaceTool {
|
||||
/// The namespace of the workspace.
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
/// The name of the workspace to delete.
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
/// Search across all memory stores (Graph, Tasks, Snippets, ADRs, Error Fixes, Tech Debt) using Hybrid Reciprocal Rank Fusion (BM25 + Dense Vectors).
|
||||
/// Highly recommended for discovery. Supports Lucene query syntax.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
@@ -905,16 +359,6 @@ pub struct QueryHypothesesTool {
|
||||
/// Optional search query text.
|
||||
pub query: Option<String>,
|
||||
}
|
||||
|
||||
/// Compare two saved context workspaces and return a structured diff of pinned files, active tasks, and metadata.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct DiffContextWorkspacesTool {
|
||||
/// The name of the first context workspace.
|
||||
pub workspace_a: String,
|
||||
/// The name of the second context workspace.
|
||||
pub workspace_b: String,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -990,20 +434,6 @@ pub struct SemanticCodeSearchTool {
|
||||
pub struct ReadDirectoryArchitectureTool {
|
||||
pub directory: String,
|
||||
}
|
||||
|
||||
/// Create a point-in-time state snapshot of memory stores for safety.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CreateSnapshotTool {
|
||||
pub description: String,
|
||||
pub namespace: Option<String>,
|
||||
}
|
||||
|
||||
/// Restore a point-in-time state snapshot of memory stores.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct RestoreSnapshotTool {
|
||||
pub snapshot_id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SubagentNamespaceAction {
|
||||
@@ -1022,19 +452,6 @@ pub struct ManageSubagentNamespaceTool {
|
||||
/// For 'condense': whether to auto-purge the subagent namespace after promotion. Defaults to true.
|
||||
pub purge_after_promotion: Option<bool>,
|
||||
}
|
||||
|
||||
/// Create an isolated memory namespace for a subagent session.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CreateSubagentNamespaceTool {
|
||||
pub subagent_id: String,
|
||||
}
|
||||
|
||||
/// Purge an isolated subagent memory namespace after session completion.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct PurgeSubagentNamespaceTool {
|
||||
pub subagent_id: String,
|
||||
}
|
||||
|
||||
/// Find all source locations and AST chunks where a specific symbol (function, struct, method, type) is referenced or called.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct FindSymbolReferencesTool {
|
||||
@@ -1068,7 +485,7 @@ pub struct QueryGitDiffsTool {
|
||||
pub limit: Option<usize>,
|
||||
}
|
||||
|
||||
/// Promote a transient sticky note or active task observation into a permanent Knowledge Graph entity.
|
||||
/// Promote a task observation or finding into a permanent Knowledge Graph entity.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct PromoteToEntityTool {
|
||||
/// Note text or content to promote.
|
||||
@@ -1090,17 +507,7 @@ pub struct AnalyzeImpactTool {
|
||||
/// Optional file path.
|
||||
pub file_path: Option<String>,
|
||||
}
|
||||
|
||||
/// Auto-condense a subagent's memory namespace and promote its high-value entities/relations to the global Knowledge Graph.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct CondenseSubagentNamespaceTool {
|
||||
/// The subagent namespace ID to consolidate.
|
||||
pub subagent_id: String,
|
||||
/// Whether to auto-purge the subagent namespace after promotion. Defaults to true.
|
||||
pub purge_after_promotion: Option<bool>,
|
||||
}
|
||||
|
||||
/// Get a consolidated 1-page executive summary of current active branch, active task, pinned files, open tech debt, and diagnostic hypotheses in 1 turn.
|
||||
/// Get a consolidated 1-page executive summary of current active branch, active task, open tech debt, and diagnostic hypotheses in 1 turn.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct GetPreflightContextTool {
|
||||
/// Optional namespace. Defaults to 'default'.
|
||||
@@ -1163,18 +570,6 @@ pub struct AutoSessionCheckpointTool {
|
||||
#[serde(default = "crate::models::default_namespace")]
|
||||
pub namespace: String,
|
||||
}
|
||||
|
||||
/// Hybrid BM25 & semantic tag search across stored code snippets, returning ranked code patterns with relevance scores.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct SearchSnippetsHybridTool {
|
||||
/// Query string (e.g. 'rate limiter', 'websocket client', 'shutdown poll').
|
||||
pub query: String,
|
||||
/// Optional tags to filter by.
|
||||
pub tags: Option<Vec<String>>,
|
||||
/// Maximum number of snippets to return. Defaults to 10.
|
||||
pub limit: Option<usize>,
|
||||
}
|
||||
|
||||
// Consolidated Smart Management Tools
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
@@ -1322,124 +717,6 @@ pub struct MilestonesTool {
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PinnedFileAction {
|
||||
#[serde(alias = "pin", alias = "PIN", alias = "Pin")]
|
||||
Pin,
|
||||
#[serde(alias = "unpin", alias = "UNPIN", alias = "Unpin")]
|
||||
Unpin,
|
||||
#[serde(alias = "list", alias = "LIST", alias = "List")]
|
||||
List,
|
||||
}
|
||||
|
||||
/// Pinned working set files management (pin, unpin, list).
|
||||
/// Actions:
|
||||
/// - 'pin': Pin file to active focus set. Required: path. Optional: namespace.
|
||||
/// - 'unpin': Unpin file from focus set. Required: path. Optional: namespace.
|
||||
/// - 'list': List pinned files. Optional: namespace.
|
||||
/// Next steps on error: Provide exact file path for pin/unpin operations.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct PinnedFilesTool {
|
||||
/// Action to perform: 'pin', 'unpin', or 'list'.
|
||||
pub action: PinnedFileAction,
|
||||
/// Absolute or workspace relative file path (required for 'pin' and 'unpin').
|
||||
pub path: Option<String>,
|
||||
/// Optional namespace.
|
||||
pub namespace: Option<String>,
|
||||
/// Optional reason for pinning this file.
|
||||
pub pin_reason: Option<String>,
|
||||
/// Optional symbol focus or line range.
|
||||
pub symbol_or_line: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional git branch.
|
||||
pub git_branch: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ContextWorkspaceAction {
|
||||
#[serde(alias = "save", alias = "SAVE", alias = "Save")]
|
||||
Save,
|
||||
#[serde(alias = "load", alias = "LOAD", alias = "Load")]
|
||||
Load,
|
||||
#[serde(alias = "list", alias = "LIST", alias = "List")]
|
||||
List,
|
||||
#[serde(alias = "delete", alias = "DELETE", alias = "Delete")]
|
||||
Delete,
|
||||
#[serde(alias = "diff", alias = "DIFF", alias = "Diff")]
|
||||
Diff,
|
||||
}
|
||||
|
||||
/// Context workspace snapshots management (save, load, list, delete, diff).
|
||||
/// Actions:
|
||||
/// - 'save': Save current pinned files & task IDs. Required: name. Optional: pinned_files, active_task_ids, namespace.
|
||||
/// - 'load': Restore saved workspace state. Required: name. Optional: namespace.
|
||||
/// - 'list': List saved context workspaces. Optional: namespace.
|
||||
/// - 'delete': Delete saved workspace. Required: name. Optional: namespace.
|
||||
/// - 'diff': Compare two context workspaces. Required: name, other_name. Optional: namespace.
|
||||
/// Next steps on error: Check workspace name or list existing workspaces first.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct ContextWorkspacesTool {
|
||||
/// Action to perform: 'save', 'load', 'list', 'delete', or 'diff'.
|
||||
pub action: ContextWorkspaceAction,
|
||||
/// Workspace name (required for 'save', 'load', 'delete', 'diff').
|
||||
pub name: Option<String>,
|
||||
/// Second workspace name (required for 'diff').
|
||||
pub other_name: Option<String>,
|
||||
/// Pinned file paths (for 'save').
|
||||
pub pinned_files: Option<Vec<String>>,
|
||||
/// Active task IDs (for 'save').
|
||||
pub active_task_ids: Option<Vec<String>>,
|
||||
/// Optional namespace.
|
||||
pub namespace: Option<String>,
|
||||
/// Optional description of the context workspace purpose.
|
||||
pub description: Option<String>,
|
||||
/// Optional git branch associated with this workspace.
|
||||
pub git_branch: Option<String>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
/// Optional VCS revision or commit hash.
|
||||
pub vcs_revision: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PrChecklistAction {
|
||||
#[serde(alias = "add", alias = "ADD", alias = "Add")]
|
||||
Add,
|
||||
#[serde(alias = "get", alias = "GET", alias = "Get")]
|
||||
Get,
|
||||
#[serde(alias = "clear", alias = "CLEAR", alias = "Clear")]
|
||||
Clear,
|
||||
}
|
||||
|
||||
/// Pre-commit and Pull Request checklist management (add, get, clear).
|
||||
/// Actions:
|
||||
/// - 'add': Add PR checklist item. Required: description. Optional: namespace.
|
||||
/// - 'get': Get PR checklist items. Optional: namespace.
|
||||
/// - 'clear': Clear PR checklist. Optional: namespace.
|
||||
/// Next steps on error: Provide description for 'add' action.
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
|
||||
pub struct PrChecklistTool {
|
||||
/// Action to perform: 'add', 'get', or 'clear'.
|
||||
pub action: PrChecklistAction,
|
||||
/// Checklist item description (required for 'add').
|
||||
pub description: Option<String>,
|
||||
/// Optional namespace.
|
||||
pub namespace: Option<String>,
|
||||
/// Optional checklist category (e.g. 'Security', 'Testing', 'Formatting').
|
||||
pub category: Option<String>,
|
||||
/// Optional automated verification command or script.
|
||||
pub automated_check: Option<String>,
|
||||
/// Optional checked state.
|
||||
pub is_checked: Option<bool>,
|
||||
/// Optional repository name.
|
||||
pub repo_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SnippetAction {
|
||||
@@ -1535,6 +812,12 @@ pub struct DecisionsTool {
|
||||
pub affected_components: Option<Vec<String>>,
|
||||
/// Optional alternative designs or libraries considered.
|
||||
pub alternatives_considered: Option<Vec<String>>,
|
||||
/// Optional superseded ADR ID.
|
||||
pub supersedes: Option<String>,
|
||||
/// Limit the number of query results. Defaults to 20.
|
||||
pub limit: Option<usize>,
|
||||
/// Include the full body of the matched decisions. Defaults to true.
|
||||
pub include_body: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
@@ -1562,8 +845,10 @@ pub struct TechDebtTool {
|
||||
#[serde(alias = "tech_debt_id", alias = "debt_id")]
|
||||
pub id: Option<String>,
|
||||
/// Tech debt description (required for 'log').
|
||||
#[serde(alias = "desc", alias = "title")]
|
||||
#[serde(alias = "desc")]
|
||||
pub description: Option<String>,
|
||||
/// Optional title or summary of tech debt.
|
||||
pub title: Option<String>,
|
||||
/// Ideal solution (optional for 'log').
|
||||
#[serde(alias = "solution", alias = "fix")]
|
||||
pub ideal_solution: Option<String>,
|
||||
@@ -1591,6 +876,10 @@ pub struct TechDebtTool {
|
||||
pub workaround: Option<String>,
|
||||
/// Optional effort estimate to fix.
|
||||
pub effort_estimate: Option<String>,
|
||||
/// Summary level for list action: 'compact', 'detailed', or 'full'.
|
||||
pub summary_level: Option<String>,
|
||||
/// Optional token budget cap for list output.
|
||||
pub max_tokens: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
|
||||
|
||||
Reference in new issue
Block a user