# Stubbed Functions Reference Quick reference for all stubbed functions with task IDs and signatures. --- ## File Operations ### TOOLS-FS-01: Read Text File **File**: `src/fs/read.rs` ```rust pub async fn read_text_file( request: ReadTextFileRequest, config: &SandboxConfig, ) -> ToolResult ``` **Types**: - `ReadTextFileRequest { path: String, line: Option, limit: Option }` - `ReadTextFileResponse { content: String }` --- ### TOOLS-FS-02: Write Text File **File**: `src/fs/write.rs` ```rust pub async fn write_text_file( request: WriteTextFileRequest, config: &SandboxConfig, ) -> ToolResult pub fn normalize_eol(content: &str, policy: EolPolicy) -> String ``` **Types**: - `WriteTextFileRequest { path: String, content: String }` - `WriteTextFileResponse {}` --- ### TOOLS-FS-03: Generate Diff **File**: `src/fs/diff.rs` ```rust pub fn generate_diff(old_content: &str, new_content: &str, path: &Path) -> String ``` --- ### TOOLS-FS-04: Edit File **File**: `src/fs/edit.rs` ```rust pub async fn edit_file( request: EditFileRequest, config: &SandboxConfig, ) -> ToolResult ``` **Types**: - `EditFileRequest { path: String, edits: Vec }` - `EditFileResponse { diff: String }` - `EditOperation::Replace { old_text: String, new_text: String, replace_all: bool }` - `EditOperation::Patch { diff: String }` --- ## Search Operations ### TOOLS-SEARCH-01: Directory Listing **File**: `src/search/ls.rs` ```rust pub async fn ls(request: LsRequest, config: &SearchConfig) -> ToolResult ``` **Types**: - `LsRequest { path: String }` - `LsResponse { entries: Vec }` - `LsEntry { path: PathBuf, kind: FileKind, size: Option }` - `FileKind: File | Dir | Symlink` --- ### TOOLS-SEARCH-02: Glob Search **File**: `src/search/glob.rs` ```rust pub async fn glob_search( request: GlobRequest, config: &SearchConfig, ) -> ToolResult ``` **Types**: - `GlobRequest { path: String, pattern: String, exclude: Option>, max_results: Option }` - `GlobResponse { matches: Vec, truncated: bool }` --- ### TOOLS-SEARCH-03: Content Search (Grep) **File**: `src/search/grep.rs` ```rust pub async fn grep_search( request: GrepRequest, config: &SearchConfig, ) -> ToolResult ``` **Types**: - `GrepRequest { path: String, pattern: String, file_pattern: Option, ignore_case: bool, context_before: u32, context_after: u32, max_results: Option }` - `GrepResponse { matches: Vec, truncated: bool }` - `GrepMatch { path: PathBuf, line_number: usize, line: String, context_before: Vec, context_after: Vec }` --- ## Terminal Operations ### TOOLS-TERM-01: Create Terminal **File**: `src/terminal/create.rs` ```rust pub async fn create_terminal( request: CreateTerminalRequest, config: &TerminalConfig, ) -> ToolResult ``` **Types**: - `CreateTerminalRequest { command: String, args: Vec, cwd: Option, env: Option>, output_byte_limit: Option }` - `CreateTerminalResponse { terminal_id: String }` - `EnvVar { name: String, value: String }` --- ### TOOLS-TERM-02: Get Terminal Output **File**: `src/terminal/output.rs` ```rust pub async fn get_terminal_output( request: TerminalOutputRequest, config: &TerminalConfig, ) -> ToolResult ``` **Types**: - `TerminalOutputRequest { terminal_id: String }` - `TerminalOutputResponse { output: String, truncated: bool, exit_status: Option }` --- ### TOOLS-TERM-03: Wait for Exit **File**: `src/terminal/wait.rs` ```rust pub async fn wait_for_terminal_exit( request: WaitForTerminalExitRequest, config: &TerminalConfig, ) -> ToolResult ``` **Types**: - `WaitForTerminalExitRequest { terminal_id: String }` - `WaitForTerminalExitResponse { exit_status: i32 }` --- ### TOOLS-TERM-04: Kill Terminal **File**: `src/terminal/kill.rs` ```rust pub async fn kill_terminal( request: KillTerminalCommandRequest, config: &TerminalConfig, ) -> ToolResult ``` **Types**: - `KillTerminalCommandRequest { terminal_id: String }` - `KillTerminalCommandResponse {}` --- ### TOOLS-TERM-05: Release Terminal **File**: `src/terminal/release.rs` ```rust pub async fn release_terminal( request: ReleaseTerminalRequest, config: &TerminalConfig, ) -> ToolResult ``` **Types**: - `ReleaseTerminalRequest { terminal_id: String }` - `ReleaseTerminalResponse {}` --- ### Ring Buffer **File**: `src/terminal/ring_buffer.rs` ```rust impl RingBuffer { pub fn new(capacity: usize) -> Self } ``` **Note**: Full interface to be defined during implementation. --- ## Summary **Total Stubbed Functions**: 15 main functions + 1 helper **File Operations**: 4 functions - read_text_file, write_text_file, normalize_eol, generate_diff, edit_file **Search Operations**: 3 functions - ls, glob_search, grep_search **Terminal Operations**: 6 functions + ring buffer - create_terminal, get_terminal_output, wait_for_terminal_exit, kill_terminal, release_terminal, RingBuffer::new All functions return `unimplemented!()` with clear task IDs in the panic message. --- ## Implementation Order Recommended implementation order based on dependencies: 1. **File Operations** (UI features need these first) - TOOLS-FS-01: read_text_file - TOOLS-FS-02: write_text_file + normalize_eol - TOOLS-FS-03: generate_diff 2. **Search Operations** (useful for development) - TOOLS-SEARCH-01: ls - TOOLS-SEARCH-02: glob_search - TOOLS-SEARCH-03: grep_search 3. **Edit Operations** (builds on read/write) - TOOLS-FS-04: edit_file 4. **Terminal Operations** (more complex, can be deferred) - TOOLS-TERM-01: create_terminal + ring_buffer - TOOLS-TERM-02: get_terminal_output - TOOLS-TERM-03: wait_for_terminal_exit - TOOLS-TERM-04: kill_terminal - TOOLS-TERM-05: release_terminal --- *Generated: 2025-11-12* *Package: dirigent_tools v0.1.0*