This commit is contained in:
taggart_comet 2026-01-11 12:12:03 +02:00
commit edf99cb06a
15 changed files with 130 additions and 0 deletions

View file

View file

View file

View file

View file

@ -0,0 +1,17 @@
pub mod change;
mod find_files;
mod read_file;
mod find_objects;
mod structure;
pub use find_files::FindFiles;
pub use find_objects::FindObjects;
pub use read_file::ReadFile;
pub use structure::Structure;
pub trait Tool {
fn name(&self) -> &'static str;
fn work(&self, input: &str) -> &'static str;
fn desc(&self) -> &'static str;
fn format(&self) -> &'static str;
}

View file

@ -0,0 +1,28 @@
use tools::Tool;
pub struct Insert;
impl Tool for Insert {
fn name(&self) -> &'static str {
"change"
}
fn work(&self, _input: &str) -> &'static str {
""
}
fn desc(&self) -> &'static str {
"Apply an edit to an existing file"
}
fn format(&self) -> &'static str {
"
input:
target_line: string # line in the file where to insert the change
insert_content: string # content to insert
output:
ok: boolean
error: string # optional
"
}
}

View file

@ -0,0 +1,29 @@
use crate::domain::tools::Tool;
pub struct Insert;
impl Tool for Insert {
fn name(&self) -> &'static str {
"change_insert"
}
fn work(&self, _input: &str) -> String {
String::new()
}
fn desc(&self) -> &'static str {
"Apply an edit to an existing file"
}
fn format(&self) -> &'static str {
"
input:
file_name: string # full path to the file
target_line: string # line in the file where to insert the change
insert_content: string # content to insert
output:
ok: boolean
error: string # optional
"
}
}

View file

View file

@ -0,0 +1,27 @@
use crate::domain::tools::Tool;
pub struct FindObjects;
impl Tool for FindObjects {
fn name(&self) -> &'static str {
"find_objects"
}
fn work(&self, _input: &str) -> &'static str {
""
}
fn desc(&self) -> &'static str {
"Lists objects by query (stub)"
}
fn format(&self) -> &'static str {
"
input:
file_name: string # full path to the file
query: string # what to search for
output:
results: array[string]
"
}
}

View file

@ -0,0 +1,29 @@
use crate::domain::tools::Tool;
pub struct ListObjects;
impl Tool for ListObjects {
fn name(&self) -> &'static str {
"list_objects"
}
fn work(&self, _input: &str) -> &'static str {
""
}
fn desc(&self) -> &'static str {
"Lists language-aware-objects in a file (like functions, classes, etc.)"
}
fn format(&self) -> &'static str {
"
input:
file_name: string # full path to the file
output:
results:
classes: [string]
functions: [string]
constants: [string]
"
}
}

View file

View file

View file

View file

View file