Skip to main content

steer_workspace/
result.rs

1use serde::{Deserialize, Serialize};
2
3/// Result for grep-like search tools
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct SearchResult {
6    pub matches: Vec<SearchMatch>,
7    pub total_files_searched: usize,
8    pub search_completed: bool,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct SearchMatch {
13    pub file_path: String,
14    pub line_number: usize,
15    pub line_content: String,
16    pub column_range: Option<(usize, usize)>,
17}
18
19/// Result for file listing operations
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct FileListResult {
22    pub entries: Vec<FileEntry>,
23    pub base_path: String,
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct FileEntry {
28    pub path: String,
29    pub is_directory: bool,
30    pub size: Option<u64>,
31    pub permissions: Option<String>,
32}
33
34/// Result for file content viewing
35#[derive(Debug, Clone, Serialize, Deserialize)]
36pub struct FileContentResult {
37    pub content: String,
38    pub file_path: String,
39    pub line_count: usize,
40    pub truncated: bool,
41}
42
43/// Result for edit operations
44#[derive(Debug, Clone, Serialize, Deserialize)]
45pub struct EditResult {
46    pub file_path: String,
47    pub changes_made: usize,
48    pub file_created: bool,
49    pub old_content: Option<String>,
50    pub new_content: Option<String>,
51}
52
53/// Result for glob pattern matching
54#[derive(Debug, Clone, Serialize, Deserialize)]
55pub struct GlobResult {
56    pub matches: Vec<String>,
57    pub pattern: String,
58}