From e1411e5cd3d41d23515a0aa81b6d4a746939966d Mon Sep 17 00:00:00 2001 From: "devloai[bot]" <168258904+devloai[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:32:24 +0000 Subject: [PATCH 1/6] Add comprehensive documentation with knowledge graphs and mermaid diagrams --- ARCHITECTURE.md | 374 ++++++++++++++++++++++++++++++++++++ CONCEPTS.md | 238 +++++++++++++++++++++++ DEVELOPMENT.md | 386 +++++++++++++++++++++++++++++++++++++ FEATURES.md | 340 ++++++++++++++++++++++++++++++++ KNOWLEDGE_GRAPH.md | 469 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 349 +++++++++++++++++++++++++++++++-- ROADMAP.md | 261 +++++++++++++++++++++++++ 7 files changed, 2402 insertions(+), 15 deletions(-) create mode 100644 ARCHITECTURE.md create mode 100644 CONCEPTS.md create mode 100644 DEVELOPMENT.md create mode 100644 FEATURES.md create mode 100644 KNOWLEDGE_GRAPH.md create mode 100644 ROADMAP.md diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 000000000..3b5868cb2 --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,374 @@ +# Sidecar Architecture + +This document provides a detailed explanation of the Sidecar architecture, including component interactions, data flow, and design decisions. + +## Overview + +Sidecar is built as a Rust workspace with multiple crates that work together to provide AI-powered code assistance. The architecture follows a modular design with clear separation of concerns. + +```mermaid +flowchart TD + A[Aide Editor] <--> B[Webserver API] + B <--> C[Application Core] + C <--> D[LLM Client] + C <--> E[Repository Analysis] + C <--> F[Agentic Tools] + C <--> G[MCTS Decision Engine] + C <--> H[Code Chunking] + D <--> I[External LLM Providers] + E <--> J[Git Repository] + F <--> K[Symbol Management] + H <--> L[Language-Specific Parsers] +``` + +## Core Components + +### 1. Application Core + +The Application Core is the central component that coordinates all other parts of the system. It initializes and manages the various subsystems, handles configuration, and provides a unified interface for the webserver. + +**Key Responsibilities:** +- System initialization and configuration +- Component lifecycle management +- Resource allocation and management +- Cross-component coordination + +**Implementation Details:** +- Located in `sidecar/src/application/` +- Main class: `Application` in `application.rs` +- Configuration handled by `Configuration` in `config/configuration.rs` + +### 2. Webserver API + +The Webserver API provides HTTP endpoints for the Aide editor to communicate with Sidecar. It handles request routing, authentication, and response formatting. + +**Key Endpoints:** +- `/api/agentic/*`: Endpoints for AI agent operations +- `/api/tree_sitter/*`: Endpoints for code parsing and analysis +- `/api/file/*`: Endpoints for file operations +- `/api/plan/*`: Endpoints for planning operations + +**Implementation Details:** +- Located in `sidecar/src/webserver/` +- Main entry point: `webserver.rs` in `sidecar/src/bin/` +- Uses Axum for HTTP routing and handling + +### 3. LLM Client + +The LLM Client handles communication with various Large Language Model providers. It manages API keys, formats requests according to provider specifications, and processes responses. + +**Supported Providers:** +- OpenAI (GPT models) +- Anthropic (Claude models) +- Google AI (Gemini models) +- Various open-source models via Ollama, LM Studio, etc. + +**Implementation Details:** +- Located in `llm_client/src/` +- Main broker: `LLMBroker` in `broker.rs` +- Provider-specific clients in `clients/` + +### 4. Repository Analysis + +The Repository Analysis component analyzes code repositories to build a graph representation of the codebase. It uses PageRank-like algorithms to identify important symbols and relationships. + +**Key Features:** +- File and directory scanning +- Symbol extraction and relationship mapping +- Importance scoring using PageRank +- Context retrieval for relevant code sections + +**Implementation Details:** +- Located in `sidecar/src/repomap/` +- Main analyzer: `Analyser` in `analyser.rs` +- Graph implementation in `graph.rs` + +### 5. Agentic Tools + +The Agentic Tools component provides a collection of tools that AI agents can use to perform complex code operations. It includes tools for code editing, symbol analysis, and context gathering. + +**Key Tools:** +- Code editing tools +- Symbol analysis tools +- Repository search tools +- Context gathering tools + +**Implementation Details:** +- Located in `sidecar/src/agentic/` +- Tool management in `tool/` +- Symbol management in `symbol/` +- Memory management in `memory/` + +### 6. MCTS Decision Engine + +The Monte Carlo Tree Search (MCTS) Decision Engine explores possible code changes and selects the most promising ones. It uses a tree-based search algorithm to evaluate different actions and their potential outcomes. + +**Key Components:** +- Action node representation +- Selection strategies +- Value functions for evaluating changes +- Execution planning + +**Implementation Details:** +- Located in `sidecar/src/mcts/` +- Action node implementation in `action_node.rs` +- Selection strategies in `selector/` +- Execution handling in `execution/` + +### 7. Code Chunking + +The Code Chunking component parses and chunks code into meaningful segments for better understanding by LLMs. It uses language-specific parsers to extract symbols, relationships, and context. + +**Supported Languages:** +- Rust +- Python +- JavaScript/TypeScript +- Go + +**Implementation Details:** +- Located in `sidecar/src/chunking/` +- Language-specific parsers in language-named files (e.g., `rust.rs`) +- Common parsing utilities in `helpers.rs` +- Text document management in `text_document.rs` + +## Data Flow + +### Request Processing Flow + +```mermaid +sequenceDiagram + participant Editor as Aide Editor + participant API as Webserver API + participant App as Application Core + participant LLM as LLM Client + participant Repo as Repository Analysis + participant Agent as Agentic Tools + + Editor->>API: Request (code context, query) + API->>App: Process request + App->>Repo: Analyze repository context + Repo-->>App: Repository context + App->>Agent: Select appropriate tools + Agent->>LLM: Generate prompt with context + LLM-->>Agent: LLM response + Agent->>App: Process LLM response + App->>API: Formatted response + API->>Editor: Display results to user +``` + +### Code Editing Flow + +```mermaid +sequenceDiagram + participant Editor as Aide Editor + participant API as Webserver API + participant Agent as Agentic System + participant MCTS as MCTS Engine + participant LLM as LLM Client + participant FS as File System + + Editor->>API: Edit request with code context + API->>Agent: Process edit request + Agent->>MCTS: Generate possible edits + + loop Action Selection + MCTS->>LLM: Generate candidate actions + LLM-->>MCTS: Candidate actions + MCTS->>MCTS: Evaluate actions + MCTS->>MCTS: Select best action + end + + MCTS-->>Agent: Best edit action + Agent->>FS: Apply edit to file + FS-->>Agent: Edit result + Agent->>API: Edit response + API->>Editor: Updated code +``` + +## Component Interactions + +### Application Initialization + +```mermaid +sequenceDiagram + participant Main as Main + participant App as Application + participant Config as Configuration + participant Logging as Logging + participant LLM as LLM Broker + participant Repo as Repository Pool + participant Lang as Language Parsing + participant Tools as Tool Box + participant Symbols as Symbol Manager + + Main->>Config: Parse configuration + Main->>Logging: Install logging + Main->>App: Initialize application + App->>Repo: Initialize repository pool + App->>Lang: Initialize language parsing + App->>LLM: Initialize LLM broker + App->>Tools: Initialize tool box + App->>Symbols: Initialize symbol manager + Main->>Main: Start webserver +``` + +### Tool Execution + +```mermaid +sequenceDiagram + participant API as API Endpoint + participant Agent as Agent + participant ToolBox as Tool Box + participant Tool as Specific Tool + participant LLM as LLM Client + participant FS as File System + + API->>Agent: Tool use request + Agent->>ToolBox: Select appropriate tool + ToolBox->>Tool: Execute tool with parameters + Tool->>LLM: Generate content (if needed) + LLM-->>Tool: Generated content + Tool->>FS: Perform file operations (if needed) + FS-->>Tool: Operation result + Tool-->>ToolBox: Tool execution result + ToolBox-->>Agent: Processed result + Agent-->>API: Tool use response +``` + +## Design Decisions + +### Modular Architecture + +Sidecar uses a modular architecture with clear separation of concerns. This allows for easier maintenance, testing, and extension of the codebase. + +**Benefits:** +- Components can be developed and tested independently +- New features can be added without affecting existing functionality +- Different teams can work on different components simultaneously + +### Rust Workspace + +The project is organized as a Rust workspace with multiple crates. This provides better dependency management and compilation times. + +**Benefits:** +- Clear separation between major components +- Independent versioning of components +- Faster incremental compilation +- Better dependency management + +### Asynchronous Processing + +Sidecar uses asynchronous processing extensively to handle concurrent requests and long-running operations. + +**Benefits:** +- Better resource utilization +- Improved responsiveness +- Ability to handle multiple requests simultaneously +- Support for streaming responses + +### LLM Provider Abstraction + +The LLM client uses an abstraction layer to support multiple LLM providers. This allows for easy switching between providers and support for new providers. + +**Benefits:** +- Support for multiple LLM providers +- Easy addition of new providers +- Ability to switch providers at runtime +- Consistent interface for all providers + +### Tree-sitter Integration + +Sidecar uses Tree-sitter for code parsing and analysis. This provides accurate and efficient parsing for multiple programming languages. + +**Benefits:** +- Support for multiple programming languages +- Accurate parsing and symbol extraction +- Efficient incremental parsing +- Rich query capabilities + +## Performance Considerations + +### Token Usage Optimization + +Sidecar optimizes token usage to reduce costs and improve performance when communicating with LLM providers. + +**Strategies:** +- Context pruning to remove irrelevant information +- Chunking large files into smaller segments +- Caching frequently used prompts and responses +- Using embeddings for efficient similarity search + +### Caching + +Sidecar uses caching at multiple levels to improve performance and reduce redundant operations. + +**Cache Types:** +- Repository analysis cache +- LLM response cache +- Parsed code cache +- Symbol information cache + +### Parallel Processing + +Sidecar uses parallel processing for computationally intensive operations like repository analysis and code parsing. + +**Parallel Operations:** +- File scanning and parsing +- Repository graph construction +- PageRank calculation +- MCTS exploration + +## Security Considerations + +### API Key Management + +Sidecar handles API keys for various LLM providers. These keys are sensitive and must be protected. + +**Security Measures:** +- Keys are never logged or exposed in responses +- Keys can be provided via environment variables +- Support for key rotation and management + +### Code Execution + +Sidecar does not execute user code directly, but it does perform file operations that could potentially be exploited. + +**Security Measures:** +- Strict validation of file paths +- Limiting operations to the repository directory +- Careful handling of user input + +### Authentication + +The webserver API can be configured to require authentication for sensitive operations. + +**Security Measures:** +- Support for token-based authentication +- Role-based access control +- Secure token validation + +## Extensibility + +### Plugin System + +Sidecar is designed to be extensible through a plugin system. This allows for adding new functionality without modifying the core codebase. + +**Extension Points:** +- New language support +- Additional tools +- Custom LLM providers +- Alternative repository analysis methods + +### Configuration Options + +Sidecar provides extensive configuration options to customize its behavior for different environments and use cases. + +**Configurable Aspects:** +- LLM provider selection and parameters +- Repository analysis settings +- Caching behavior +- Performance tuning + +## Conclusion + +The Sidecar architecture is designed to be modular, extensible, and performant. It provides a solid foundation for AI-powered code assistance and can be extended to support new features and use cases. \ No newline at end of file diff --git a/CONCEPTS.md b/CONCEPTS.md new file mode 100644 index 000000000..a8e1d40bc --- /dev/null +++ b/CONCEPTS.md @@ -0,0 +1,238 @@ +# Sidecar Key Concepts and Terminology + +This document explains the key concepts and terminology used in the Sidecar project. Understanding these concepts will help you navigate the codebase and contribute effectively. + +## Table of Contents + +- [AI Concepts](#ai-concepts) +- [Code Understanding](#code-understanding) +- [System Architecture](#system-architecture) +- [Development Concepts](#development-concepts) +- [Integration Concepts](#integration-concepts) + +## AI Concepts + +### Large Language Models (LLMs) + +**Definition**: Large Language Models are AI models trained on vast amounts of text data that can generate human-like text, understand context, and perform various language tasks. + +**In Sidecar**: LLMs are used for code understanding, generation, and editing. Sidecar supports multiple LLM providers, including OpenAI, Anthropic, and Google AI. + +**Key Components**: +- `llm_client` crate: Handles communication with LLM providers +- `LLMBroker`: Manages different LLM clients and routes requests +- `LLMClient` trait: Interface for different LLM providers + +### Agentic System + +**Definition**: An agentic system is an AI system that can take actions autonomously to achieve specific goals. It can use tools, make decisions, and interact with its environment. + +**In Sidecar**: The agentic system allows AI to perform complex code operations, such as editing, refactoring, and analyzing code. + +**Key Components**: +- `agentic` module: Contains the core agentic functionality +- `ToolBox`: Collection of tools available to the agent +- `SymbolManager`: Manages code symbols and their relationships +- `Memory`: Stores context and information for the agent + +### Monte Carlo Tree Search (MCTS) + +**Definition**: MCTS is a heuristic search algorithm for decision processes, particularly useful for complex decision spaces where evaluating all possibilities is impractical. + +**In Sidecar**: MCTS is used to explore possible code changes and select the most promising ones for implementation. + +**Key Components**: +- `mcts` module: Contains the MCTS implementation +- `ActionNode`: Represents a node in the MCTS tree +- `Selector`: Selects nodes for exploration +- `ValueFunction`: Evaluates the value of nodes + +### Tool-Based Approach + +**Definition**: A tool-based approach allows an AI agent to use specific tools to interact with its environment and accomplish tasks. + +**In Sidecar**: Tools are used by the agent to perform specific operations, such as editing code, searching repositories, and analyzing symbols. + +**Key Components**: +- `tool` module: Contains tool implementations +- `Tool` trait: Interface for different tools +- `ToolBroker`: Manages tool selection and execution + +## Code Understanding + +### Symbol + +**Definition**: A symbol is a named entity in code, such as a function, class, variable, or module. + +**In Sidecar**: Symbols are the basic units of code understanding. Sidecar extracts symbols from code and analyzes their relationships. + +**Key Components**: +- `symbol` module: Contains symbol-related functionality +- `SymbolManager`: Manages symbols and their relationships +- `SymbolTrackerInline`: Tracks symbols in editor sessions + +### Repository Mapping + +**Definition**: Repository mapping is the process of analyzing a code repository to understand its structure, dependencies, and important components. + +**In Sidecar**: Repository mapping is used to build a graph representation of the codebase, which helps in understanding context and relationships. + +**Key Components**: +- `repomap` module: Contains repository mapping functionality +- `Analyser`: Analyzes repositories and builds graphs +- `Graph`: Represents the repository as a graph +- `PageRank`: Calculates importance scores for symbols + +### Code Chunking + +**Definition**: Code chunking is the process of breaking down code into meaningful segments for analysis and understanding. + +**In Sidecar**: Code chunking is used to parse and analyze code in a structured way, extracting symbols and their relationships. + +**Key Components**: +- `chunking` module: Contains code chunking functionality +- `TSLanguageParsing`: Uses Tree-sitter for language parsing +- `EditorParsing`: Parses code in editor sessions +- Language-specific parsers (e.g., `rust.rs`, `python.rs`) + +### Tree-sitter + +**Definition**: Tree-sitter is a parser generator tool and incremental parsing library that can build a concrete syntax tree for source code. + +**In Sidecar**: Tree-sitter is used for accurate and efficient parsing of multiple programming languages. + +**Key Components**: +- `tree-sitter` dependency: The core parsing library +- Language-specific grammars (e.g., `tree-sitter-rust`, `tree-sitter-python`) +- `TSLanguageParsing`: Wrapper for Tree-sitter functionality + +## System Architecture + +### Application Core + +**Definition**: The application core is the central component that coordinates all other parts of the system. + +**In Sidecar**: The application core initializes and manages the various subsystems, handles configuration, and provides a unified interface for the webserver. + +**Key Components**: +- `application` module: Contains the application core +- `Application` struct: Main application class +- `Configuration` struct: Application configuration + +### Webserver + +**Definition**: The webserver provides HTTP endpoints for external systems to communicate with Sidecar. + +**In Sidecar**: The webserver handles requests from the Aide editor, routes them to the appropriate components, and returns responses. + +**Key Components**: +- `webserver` module: Contains the webserver implementation +- `webserver.rs` binary: Main entry point for the webserver +- Various router functions (e.g., `agentic_router`, `tree_sitter_router`) + +### Repository Pool + +**Definition**: The repository pool manages access to code repositories and their state. + +**In Sidecar**: The repository pool provides a unified interface for accessing and manipulating repositories. + +**Key Components**: +- `repo` module: Contains repository-related functionality +- `RepositoryPool` struct: Manages repository access +- `state` module: Manages repository state + +### LLM Broker + +**Definition**: The LLM broker manages communication with different LLM providers and routes requests to the appropriate client. + +**In Sidecar**: The LLM broker provides a unified interface for generating text, chat completions, and other LLM operations. + +**Key Components**: +- `LLMBroker` struct: Main broker class +- `LLMClient` trait: Interface for LLM providers +- Provider-specific clients (e.g., `OpenAIClient`, `AnthropicClient`) + +## Development Concepts + +### Rust Workspace + +**Definition**: A Rust workspace is a collection of packages that share dependencies and configuration. + +**In Sidecar**: Sidecar is organized as a Rust workspace with multiple crates, each responsible for a specific aspect of functionality. + +**Key Components**: +- `Cargo.toml` at the root: Defines the workspace +- Individual crates: `sidecar`, `llm_client`, `llm_prompts`, `logging` +- Shared dependencies and configuration + +### Asynchronous Programming + +**Definition**: Asynchronous programming allows operations to run concurrently without blocking the main thread. + +**In Sidecar**: Asynchronous programming is used extensively for handling concurrent requests, I/O operations, and long-running tasks. + +**Key Components**: +- `tokio` dependency: Asynchronous runtime +- `async`/`await` syntax: Used for asynchronous functions +- `Future` trait: Represents asynchronous computations + +### Error Handling + +**Definition**: Error handling is the process of managing and responding to error conditions in a program. + +**In Sidecar**: Error handling is done using the `anyhow` and `thiserror` crates, which provide flexible and ergonomic error handling. + +**Key Components**: +- `anyhow` dependency: For general error handling +- `thiserror` dependency: For defining specific error types +- `Result` type: Used for functions that can fail + +### Tracing and Logging + +**Definition**: Tracing and logging are techniques for recording information about a program's execution for debugging and monitoring. + +**In Sidecar**: Tracing and logging are used to record information about the system's operation, errors, and performance. + +**Key Components**: +- `tracing` dependency: For structured logging and tracing +- `logging` crate: Custom logging utilities +- `tracing_subscriber`: For configuring tracing output + +## Integration Concepts + +### Aide Editor Integration + +**Definition**: Aide is a code editor that integrates with Sidecar for AI-powered code assistance. + +**In Sidecar**: Sidecar provides API endpoints for the Aide editor to request AI assistance and receive responses. + +**Key Components**: +- Webserver API endpoints +- Request and response formats +- Streaming response support + +### LLM Provider Integration + +**Definition**: LLM providers are services that offer access to large language models through APIs. + +**In Sidecar**: Sidecar integrates with multiple LLM providers to leverage their models for code understanding and generation. + +**Key Components**: +- Provider-specific clients +- API key management +- Request and response formatting + +### Git Integration + +**Definition**: Git is a distributed version control system used for tracking changes in source code. + +**In Sidecar**: Sidecar integrates with Git to understand repository history, changes, and structure. + +**Key Components**: +- `git` module: Contains Git-related functionality +- `gix` dependency: Git implementation in Rust +- Repository analysis based on Git history + +## Conclusion + +Understanding these key concepts and terminology will help you navigate the Sidecar codebase and contribute effectively to the project. If you encounter terms or concepts that are not explained here, please consider adding them to this document to help future contributors. \ No newline at end of file diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 000000000..6cde4ec50 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,386 @@ +# Sidecar Development Guide + +This document provides a comprehensive guide for developers who want to contribute to the Sidecar project. It covers setup, development workflows, testing, and best practices. + +## Table of Contents + +- [Development Environment Setup](#development-environment-setup) +- [Project Structure](#project-structure) +- [Development Workflow](#development-workflow) +- [Testing](#testing) +- [Debugging](#debugging) +- [Code Style and Guidelines](#code-style-and-guidelines) +- [Documentation](#documentation) +- [Common Tasks](#common-tasks) +- [Troubleshooting](#troubleshooting) + +## Development Environment Setup + +### Prerequisites + +- **Rust**: Version 1.79 or later +- **Cargo**: Latest version compatible with your Rust installation +- **Git**: For version control +- **SQLite**: For database operations +- **Tree-sitter**: For code parsing (installed automatically via Cargo) + +### Setup Steps + +1. **Clone the repository**: + ```bash + git clone https://github.com/codestoryai/sidecar.git + cd sidecar + ``` + +2. **Install Rust dependencies**: + ```bash + rustup update + rustup component add rustfmt + ``` + +3. **Build the project**: + ```bash + cargo build + ``` + +4. **Run the webserver**: + ```bash + cargo run --bin webserver + ``` + +### Environment Variables + +Sidecar uses environment variables for configuration. Here are the most important ones: + +- `OPENAI_API_KEY`: Your OpenAI API key +- `ANTHROPIC_API_KEY`: Your Anthropic API key +- `GOOGLE_AI_API_KEY`: Your Google AI API key +- `SIDECAR_PORT`: Port for the webserver (default: 3000) +- `SIDECAR_HOST`: Host for the webserver (default: 127.0.0.1) +- `SIDECAR_LOG_LEVEL`: Log level (default: info) + +You can set these variables in your shell or create a `.env` file in the project root. + +## Project Structure + +Sidecar is organized as a Rust workspace with multiple crates: + +``` +sidecar/ # Main crate with core functionality +├── src/ # Source code +│ ├── agentic/ # AI agent system +│ ├── agent/ # Agent implementation +│ ├── application/ # Application core +│ ├── bin/ # Binary entry points +│ ├── chunking/ # Code chunking and parsing +│ ├── git/ # Git integration +│ ├── llm/ # LLM integration +│ ├── mcts/ # Monte Carlo Tree Search +│ ├── repo/ # Repository management +│ ├── repomap/ # Repository mapping +│ ├── webserver/ # Web API +│ └── lib.rs # Library entry point +├── Cargo.toml # Crate manifest +└── build.rs # Build script + +llm_client/ # LLM client crate +├── src/ # Source code +│ ├── clients/ # LLM provider clients +│ ├── format/ # Request/response formatting +│ ├── tokenizer/ # Token counting and management +│ └── lib.rs # Library entry point +└── Cargo.toml # Crate manifest + +llm_prompts/ # LLM prompt generation crate +├── src/ # Source code +│ ├── chat/ # Chat prompt generation +│ ├── fim/ # Fill-in-middle prompt generation +│ ├── in_line_edit/ # Inline editing prompt generation +│ └── lib.rs # Library entry point +└── Cargo.toml # Crate manifest + +logging/ # Logging utilities crate +├── src/ # Source code +│ └── lib.rs # Library entry point +└── Cargo.toml # Crate manifest +``` + +## Development Workflow + +### Feature Development + +1. **Create a new branch**: + ```bash + git checkout -b feature/your-feature-name + ``` + +2. **Implement your changes**: + - Make the necessary code changes + - Add tests for your changes + - Update documentation as needed + +3. **Run tests**: + ```bash + cargo test + ``` + +4. **Format your code**: + ```bash + cargo fmt + ``` + +5. **Commit your changes**: + ```bash + git add . + git commit -m "Add your feature description" + ``` + +6. **Push your branch**: + ```bash + git push origin feature/your-feature-name + ``` + +7. **Create a pull request**: + - Go to the GitHub repository + - Click on "Pull Requests" and then "New Pull Request" + - Select your branch and provide a description of your changes + +### Code Review Process + +1. **Automated checks**: + - CI will run tests and linting on your PR + - Address any issues reported by CI + +2. **Peer review**: + - A maintainer will review your code + - Address any feedback from the review + +3. **Approval and merge**: + - Once approved, your PR will be merged + - The branch will be deleted after merging + +## Testing + +### Running Tests + +```bash +# Run all tests +cargo test + +# Run tests for a specific crate +cargo test -p sidecar + +# Run tests for a specific module +cargo test -p sidecar -- agentic::symbol + +# Run a specific test +cargo test -p sidecar -- agentic::symbol::test_symbol_manager +``` + +### Writing Tests + +Tests should be placed in the same file as the code they're testing, using the `#[cfg(test)]` attribute: + +```rust +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_something() { + // Test code here + assert_eq!(2 + 2, 4); + } +} +``` + +For integration tests, create files in the `tests/` directory of the respective crate. + +### Test Coverage + +You can generate test coverage reports using `cargo-tarpaulin`: + +```bash +cargo install cargo-tarpaulin +cargo tarpaulin -p sidecar +``` + +## Debugging + +### Logging + +Sidecar uses the `tracing` crate for logging. You can control the log level using the `RUST_LOG` environment variable: + +```bash +RUST_LOG=debug cargo run --bin webserver +``` + +Log levels from most to least verbose: `trace`, `debug`, `info`, `warn`, `error`. + +### Debugging with VS Code + +1. Install the [Rust Analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension +2. Create a `.vscode/launch.json` file with the following content: + +```json +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug webserver", + "cargo": { + "args": ["build", "--bin=webserver", "--package=sidecar"], + "filter": { + "name": "webserver", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} +``` + +3. Set breakpoints in your code +4. Press F5 to start debugging + +## Code Style and Guidelines + +### Formatting + +Sidecar uses `rustfmt` for code formatting. Format your code before committing: + +```bash +cargo fmt +``` + +### Naming Conventions + +- **Types** (structs, enums, traits): `PascalCase` +- **Variables and functions**: `snake_case` +- **Constants**: `SCREAMING_SNAKE_CASE` +- **Modules**: `snake_case` + +### Documentation + +All public items should be documented using rustdoc comments: + +```rust +/// This function does something useful. +/// +/// # Arguments +/// +/// * `arg1` - The first argument +/// * `arg2` - The second argument +/// +/// # Returns +/// +/// A result containing the output or an error +/// +/// # Examples +/// +/// ``` +/// let result = do_something(1, 2); +/// assert_eq!(result, Ok(3)); +/// ``` +pub fn do_something(arg1: i32, arg2: i32) -> Result { + // Implementation +} +``` + +### Error Handling + +Use the `anyhow` crate for error handling in most cases. For library code that needs to define specific error types, use `thiserror`. + +```rust +// Using anyhow +use anyhow::{Result, Context}; + +fn do_something() -> Result<()> { + let file = std::fs::File::open("file.txt") + .context("Failed to open file.txt")?; + // More code... + Ok(()) +} + +// Using thiserror +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum MyError { + #[error("IO error: {0}")] + Io(#[from] std::io::Error), + + #[error("Invalid value: {0}")] + InvalidValue(String), +} +``` + +## Documentation + +### Generating Documentation + +You can generate and view the API documentation locally: + +```bash +cargo doc --open +``` + +### Writing Documentation + +- Document all public items (functions, structs, enums, traits) +- Include examples where appropriate +- Explain the purpose and behavior of each item +- Document error conditions and return values + +## Common Tasks + +### Adding a New LLM Provider + +1. Create a new file in `llm_client/src/clients/` for your provider +2. Implement the `LLMClient` trait for your provider +3. Add your provider to the `LLMType` enum in `llm_client/src/clients/types.rs` +4. Register your provider in the `LLMBroker::new()` method in `llm_client/src/broker.rs` + +### Adding a New Language Parser + +1. Add the tree-sitter grammar dependency to `sidecar/Cargo.toml` +2. Create a new file in `sidecar/src/chunking/` for your language +3. Implement the parsing logic for your language +4. Register your language in `sidecar/src/chunking/languages.rs` + +### Adding a New Tool + +1. Create a new file in `sidecar/src/agentic/tool/` for your tool +2. Implement the `Tool` trait for your tool +3. Register your tool in the `ToolBox::new()` method in `sidecar/src/agentic/symbol/tool_box.rs` + +## Troubleshooting + +### Common Issues + +#### Build Failures + +- **Missing dependencies**: Make sure you have all required system dependencies installed +- **Incompatible Rust version**: Ensure you're using Rust 1.79 or later +- **Cargo.lock conflicts**: Try running `cargo clean` and then `cargo build` + +#### Runtime Errors + +- **API key issues**: Check that you've set the required API keys as environment variables +- **Port conflicts**: If the port is already in use, change it using the `SIDECAR_PORT` environment variable +- **Database errors**: Check that SQLite is installed and working correctly + +### Getting Help + +If you're stuck, you can get help from the community: + +- **GitHub Issues**: Search existing issues or create a new one +- **Discord**: Join our [Discord server](https://discord.gg/mtgrhXM5Xf) for real-time help + +## Conclusion + +This development guide should help you get started with contributing to Sidecar. If you have any questions or suggestions for improving this guide, please open an issue or pull request. \ No newline at end of file diff --git a/FEATURES.md b/FEATURES.md new file mode 100644 index 000000000..82e0e3b46 --- /dev/null +++ b/FEATURES.md @@ -0,0 +1,340 @@ +# Sidecar Features and Capabilities + +This document provides a comprehensive overview of the features and capabilities of Sidecar, the AI intelligence engine that powers the Aide code editor. + +## Table of Contents + +- [AI-Powered Code Assistance](#ai-powered-code-assistance) +- [Code Understanding](#code-understanding) +- [Repository Analysis](#repository-analysis) +- [Language Support](#language-support) +- [LLM Integration](#llm-integration) +- [Agentic Tools](#agentic-tools) +- [Decision Making](#decision-making) +- [User Interaction](#user-interaction) +- [Performance Optimizations](#performance-optimizations) +- [Security Features](#security-features) + +## AI-Powered Code Assistance + +### Code Editing + +Sidecar provides AI-powered code editing capabilities that help developers write, modify, and refactor code more efficiently. + +**Key Features:** +- **Smart Code Completion**: Context-aware code completion that understands the codebase +- **Code Refactoring**: Intelligent refactoring suggestions and implementations +- **Bug Fixing**: Identification and correction of bugs and issues +- **Code Generation**: Generation of new code based on natural language descriptions + +### Code Explanation + +Sidecar can explain code to help developers understand complex or unfamiliar code more quickly. + +**Key Features:** +- **Function Explanation**: Detailed explanations of function behavior and purpose +- **Algorithm Explanation**: Descriptions of algorithms and their implementation +- **Code Flow Analysis**: Analysis of code execution flow and logic +- **Documentation Generation**: Automatic generation of documentation from code + +### Code Review + +Sidecar can assist with code reviews by identifying issues, suggesting improvements, and providing feedback. + +**Key Features:** +- **Issue Detection**: Identification of potential bugs, performance issues, and security vulnerabilities +- **Style Checking**: Verification of code style and consistency +- **Best Practice Suggestions**: Recommendations for following best practices +- **Improvement Suggestions**: Ideas for improving code quality and maintainability + +## Code Understanding + +### Symbol Analysis + +Sidecar analyzes code symbols (functions, classes, variables, etc.) to understand their purpose, behavior, and relationships. + +**Key Features:** +- **Symbol Extraction**: Identification and extraction of symbols from code +- **Symbol Relationship Mapping**: Analysis of relationships between symbols +- **Symbol Usage Analysis**: Tracking of symbol usage throughout the codebase +- **Symbol Documentation**: Generation of documentation for symbols + +### Semantic Analysis + +Sidecar performs semantic analysis to understand the meaning and intent of code beyond its syntax. + +**Key Features:** +- **Type Inference**: Determination of variable and expression types +- **Control Flow Analysis**: Analysis of code execution paths +- **Data Flow Analysis**: Tracking of data movement through the code +- **Intent Recognition**: Understanding the purpose and intent of code sections + +### Context Awareness + +Sidecar maintains context awareness to provide more relevant and accurate assistance. + +**Key Features:** +- **File Context**: Understanding of the current file and its purpose +- **Project Context**: Awareness of the overall project structure and goals +- **User Context**: Adaptation to user preferences and work patterns +- **Historical Context**: Consideration of previous interactions and changes + +## Repository Analysis + +### Repository Mapping + +Sidecar maps the structure and relationships within a code repository to provide better context for AI operations. + +**Key Features:** +- **File Relationship Analysis**: Identification of relationships between files +- **Dependency Mapping**: Analysis of import and dependency relationships +- **Module Structure Analysis**: Understanding of the module and package structure +- **Architecture Visualization**: Visual representation of the codebase architecture + +### PageRank-Based Importance Scoring + +Sidecar uses a PageRank-like algorithm to identify important symbols and files in the codebase. + +**Key Features:** +- **Symbol Importance Scoring**: Ranking of symbols by their importance in the codebase +- **File Importance Scoring**: Ranking of files by their importance in the codebase +- **Relevance Determination**: Identification of code relevant to specific queries or tasks +- **Focus Prioritization**: Prioritization of important code sections for analysis + +### Git Integration + +Sidecar integrates with Git to understand repository history and changes. + +**Key Features:** +- **Commit History Analysis**: Analysis of commit history and patterns +- **Change Tracking**: Tracking of changes to specific files and symbols +- **Author Attribution**: Identification of code authors and contributors +- **Branch Analysis**: Understanding of branch structure and purpose + +## Language Support + +### Multi-Language Parsing + +Sidecar supports parsing and understanding of multiple programming languages. + +**Supported Languages:** +- **Rust**: Full support for Rust syntax and semantics +- **Python**: Comprehensive Python language support +- **JavaScript/TypeScript**: Support for JavaScript and TypeScript +- **Go**: Go language parsing and analysis + +### Language-Specific Features + +Sidecar provides language-specific features tailored to the characteristics and idioms of each supported language. + +**Key Features:** +- **Rust**: Ownership and borrowing analysis, trait understanding +- **Python**: Type hint analysis, decorator understanding +- **JavaScript/TypeScript**: Type inference, async/await analysis +- **Go**: Interface implementation checking, goroutine analysis + +### Extensible Language Support + +Sidecar's language support is designed to be extensible, allowing for the addition of new languages. + +**Key Features:** +- **Language Parser Interface**: Common interface for language parsers +- **Tree-sitter Integration**: Use of Tree-sitter for efficient parsing +- **Language Configuration**: Configurable language settings +- **Custom Language Rules**: Support for custom language-specific rules + +## LLM Integration + +### Multi-Provider Support + +Sidecar integrates with multiple LLM providers to leverage their models for code understanding and generation. + +**Supported Providers:** +- **OpenAI**: Integration with GPT models +- **Anthropic**: Support for Claude models +- **Google AI**: Integration with Gemini models +- **Open-Source Models**: Support for various open-source models via Ollama, LM Studio, etc. + +### Provider-Specific Optimizations + +Sidecar includes optimizations for specific LLM providers to maximize their effectiveness. + +**Key Features:** +- **Prompt Engineering**: Provider-specific prompt templates and strategies +- **Token Optimization**: Efficient use of tokens for each provider +- **Model Selection**: Intelligent selection of appropriate models +- **Parameter Tuning**: Optimization of request parameters + +### Fallback Mechanisms + +Sidecar includes fallback mechanisms to handle provider failures or limitations. + +**Key Features:** +- **Provider Failover**: Automatic switching to alternative providers +- **Graceful Degradation**: Reduced functionality when optimal providers are unavailable +- **Error Recovery**: Recovery from provider errors and limitations +- **Offline Capabilities**: Basic functionality without LLM access + +## Agentic Tools + +### Tool Selection + +Sidecar's agentic system can select appropriate tools for specific tasks. + +**Key Features:** +- **Task Analysis**: Analysis of tasks to determine required tools +- **Tool Matching**: Matching of tasks to appropriate tools +- **Tool Composition**: Combination of multiple tools for complex tasks +- **Tool Adaptation**: Adaptation of tools to specific contexts + +### Tool Execution + +Sidecar can execute tools to perform specific operations. + +**Key Features:** +- **Parameter Determination**: Intelligent determination of tool parameters +- **Execution Monitoring**: Monitoring of tool execution +- **Result Processing**: Processing and interpretation of tool results +- **Error Handling**: Handling of tool execution errors + +### Available Tools + +Sidecar includes a variety of tools for different operations. + +**Key Tools:** +- **Code Editing Tools**: Tools for modifying code +- **Symbol Analysis Tools**: Tools for analyzing code symbols +- **Repository Search Tools**: Tools for searching the repository +- **Context Gathering Tools**: Tools for gathering relevant context + +## Decision Making + +### Monte Carlo Tree Search + +Sidecar uses Monte Carlo Tree Search (MCTS) to explore possible code changes and select the most promising ones. + +**Key Features:** +- **Action Space Exploration**: Exploration of possible actions +- **Value Estimation**: Estimation of action values +- **Selection Strategy**: Intelligent selection of actions to explore +- **Execution Planning**: Planning of action execution + +### Feedback-Based Learning + +Sidecar can learn from feedback to improve its decision making. + +**Key Features:** +- **User Feedback Processing**: Processing of explicit user feedback +- **Implicit Feedback Analysis**: Analysis of implicit feedback from user actions +- **Preference Learning**: Learning of user preferences +- **Adaptation**: Adaptation to user preferences and patterns + +### Multi-Step Planning + +Sidecar can plan and execute multi-step operations. + +**Key Features:** +- **Task Decomposition**: Breaking down complex tasks into steps +- **Step Sequencing**: Determining the optimal sequence of steps +- **Dependency Management**: Handling dependencies between steps +- **Progress Tracking**: Tracking progress through multi-step plans + +## User Interaction + +### Natural Language Understanding + +Sidecar can understand and process natural language queries and instructions. + +**Key Features:** +- **Query Parsing**: Parsing and understanding of user queries +- **Intent Recognition**: Identification of user intent +- **Context Incorporation**: Incorporation of context into query understanding +- **Ambiguity Resolution**: Resolution of ambiguous queries + +### Response Generation + +Sidecar generates natural language responses to user queries. + +**Key Features:** +- **Clear Explanations**: Generation of clear and concise explanations +- **Code Examples**: Inclusion of relevant code examples +- **Contextual References**: References to relevant code and documentation +- **Follow-up Suggestions**: Suggestions for follow-up queries or actions + +### Interactive Sessions + +Sidecar supports interactive sessions for ongoing user interaction. + +**Key Features:** +- **Session State Management**: Maintenance of session state +- **Context Retention**: Retention of context across interactions +- **Conversation History**: Tracking of conversation history +- **Session Persistence**: Persistence of sessions across restarts + +## Performance Optimizations + +### Token Usage Optimization + +Sidecar optimizes token usage to reduce costs and improve performance. + +**Key Features:** +- **Context Pruning**: Removal of irrelevant context +- **Chunking**: Breaking large content into manageable chunks +- **Compression**: Compression of context information +- **Prioritization**: Prioritization of important content + +### Caching + +Sidecar uses caching to improve performance and reduce redundant operations. + +**Key Features:** +- **Response Caching**: Caching of LLM responses +- **Analysis Caching**: Caching of code analysis results +- **Repository Caching**: Caching of repository information +- **Invalidation Strategies**: Intelligent cache invalidation + +### Parallel Processing + +Sidecar uses parallel processing for computationally intensive operations. + +**Key Features:** +- **Multi-threading**: Use of multiple threads for parallel operations +- **Asynchronous Processing**: Non-blocking asynchronous operations +- **Work Distribution**: Intelligent distribution of work +- **Resource Management**: Efficient management of system resources + +## Security Features + +### API Key Management + +Sidecar securely manages API keys for various services. + +**Key Features:** +- **Secure Storage**: Secure storage of API keys +- **Access Control**: Controlled access to API keys +- **Key Rotation**: Support for key rotation +- **Minimal Exposure**: Minimization of key exposure + +### Code Safety + +Sidecar includes features to ensure the safety of code operations. + +**Key Features:** +- **Path Validation**: Validation of file paths +- **Operation Limits**: Limits on potentially dangerous operations +- **Input Sanitization**: Sanitization of user input +- **Permission Checking**: Checking of operation permissions + +### Privacy Protection + +Sidecar includes features to protect user privacy. + +**Key Features:** +- **Data Minimization**: Minimization of data sent to external services +- **Local Processing**: Local processing when possible +- **Anonymization**: Anonymization of sensitive information +- **Transparency**: Transparency about data usage + +## Conclusion + +Sidecar provides a comprehensive set of features and capabilities for AI-powered code assistance. Its modular architecture, extensible design, and focus on performance and security make it a powerful tool for developers working with the Aide editor. \ No newline at end of file diff --git a/KNOWLEDGE_GRAPH.md b/KNOWLEDGE_GRAPH.md new file mode 100644 index 000000000..e8d8fad5d --- /dev/null +++ b/KNOWLEDGE_GRAPH.md @@ -0,0 +1,469 @@ +# Sidecar Knowledge Graph + +This document provides a comprehensive knowledge graph of the Sidecar codebase, showing the relationships between different components and modules. + +## Repository Structure + +```mermaid +graph TD + Root["/ (Root)"] --> Sidecar["sidecar/"] + Root --> LLMClient["llm_client/"] + Root --> LLMPrompts["llm_prompts/"] + Root --> Logging["logging/"] + + Sidecar --> SrcSidecar["src/"] + SrcSidecar --> Webserver["webserver/"] + SrcSidecar --> MCTS["mcts/"] + SrcSidecar --> Agentic["agentic/"] + SrcSidecar --> Repomap["repomap/"] + SrcSidecar --> LLM["llm/"] + SrcSidecar --> Repo["repo/"] + SrcSidecar --> Chunking["chunking/"] + SrcSidecar --> Agent["agent/"] + SrcSidecar --> Git["git/"] + SrcSidecar --> Bin["bin/"] + + LLMClient --> SrcLLM["src/"] + SrcLLM --> Clients["clients/"] + SrcLLM --> Format["format/"] + SrcLLM --> Tokenizer["tokenizer/"] + + LLMPrompts --> SrcPrompts["src/"] + SrcPrompts --> FIM["fim/"] + SrcPrompts --> Chat["chat/"] + SrcPrompts --> InLineEdit["in_line_edit/"] + + Logging --> SrcLogging["src/"] +``` + +## Crate Dependencies + +```mermaid +graph TD + Sidecar["sidecar"] --> LLMClient["llm_client"] + Sidecar --> LLMPrompts["llm_prompts"] + Sidecar --> Logging["logging"] + LLMPrompts --> LLMClient + Logging --> LLMClient +``` + +## Core Components and Their Relationships + +```mermaid +flowchart TD + subgraph Application + App["Application Core"] --> Config["Configuration"] + App --> RepoPool["Repository Pool"] + App --> LangParsing["Language Parsing"] + App --> LLMBroker["LLM Broker"] + App --> SymbolMgr["Symbol Manager"] + App --> ToolBox["Tool Box"] + end + + subgraph WebServer + Server["Web Server"] --> AgenticRouter["Agentic Router"] + Server --> PlanRouter["Plan Router"] + Server --> TreeSitterRouter["Tree Sitter Router"] + Server --> FileOpsRouter["File Operations Router"] + end + + subgraph Agentic + SymbolMgr --> ToolBroker["Tool Broker"] + ToolBox --> ToolBroker + ToolBroker --> CodeEditBroker["Code Edit Broker"] + SymbolMgr --> SymbolTracker["Symbol Tracker"] + ToolBox --> SymbolTracker + SymbolMgr --> EditorParsing["Editor Parsing"] + ToolBox --> EditorParsing + end + + subgraph LLM + LLMBroker --> Clients["LLM Clients"] + Clients --> OpenAI["OpenAI"] + Clients --> Anthropic["Anthropic"] + Clients --> GoogleAI["Google AI"] + Clients --> Ollama["Ollama"] + Clients --> Others["Other Providers"] + end + + App --> Server + SymbolMgr --> LLMBroker + ToolBroker --> LLMBroker +``` + +## Detailed Module Relationships + +### Webserver Module + +```mermaid +classDiagram + class Webserver { + +start(app: Application) + +run(app: Application) + } + + class AgenticRouter { + +probe_request_stop() + +code_sculpting() + +push_diagnostics() + +agent_session_chat() + +agent_session_edit_anchored() + +agent_session_edit_agentic() + +agent_session_plan() + +agent_tool_use() + } + + class TreeSitterRouter { + +extract_documentation_strings() + +extract_diagnostics_range() + +tree_sitter_node_check() + +check_valid_xml() + } + + class FileOperationsRouter { + +file_edit() + } + + Webserver --> AgenticRouter + Webserver --> TreeSitterRouter + Webserver --> FileOperationsRouter +``` + +### Agentic Module + +```mermaid +classDiagram + class SymbolManager { + +tool_broker: ToolBroker + +symbol_tracker: SymbolTrackerInline + +editor_parsing: EditorParsing + +llm_properties: LLMProperties + } + + class ToolBox { + +tool_broker: ToolBroker + +symbol_tracker: SymbolTrackerInline + +editor_parsing: EditorParsing + } + + class ToolBroker { + +llm_broker: LLMBroker + +code_edit_broker: CodeEditBroker + +symbol_tracker: SymbolTrackerInline + +language_parsing: TSLanguageParsing + +configuration: ToolBrokerConfiguration + +llm_properties: LLMProperties + } + + class Memory { + +store(key, value) + +retrieve(key) + +list_keys() + } + + SymbolManager --> ToolBroker + ToolBox --> ToolBroker + SymbolManager --> Memory +``` + +### MCTS (Monte Carlo Tree Search) Module + +```mermaid +classDiagram + class ActionNode { + +id: String + +parent_id: Option + +children: Vec + +action: Action + +state: ActionState + +visits: u64 + +value: f64 + } + + class Selector { + +select_node(nodes: &[ActionNode]) + } + + class Decider { + +decide(nodes: &[ActionNode]) + } + + class Execution { + +execute(action: Action) + } + + class Feedback { + +evaluate(action: Action, result: ActionResult) + } + + class ValueFunction { + +calculate(node: &ActionNode) + } + + ActionNode --> Selector + Selector --> Decider + Decider --> Execution + Execution --> Feedback + Feedback --> ValueFunction + ValueFunction --> ActionNode +``` + +### Repository Mapping Module + +```mermaid +classDiagram + class Analyser { + +analyze_repository(repo_path: &Path) + } + + class Graph { + +add_node(node: Node) + +add_edge(from: NodeId, to: NodeId) + +calculate_page_rank() + } + + class TreeWalker { + +walk(root: &Path) + } + + class Files { + +list_files(root: &Path) + +filter_files(files: &[PathBuf], ignore_patterns: &[String]) + } + + class TreeContext { + +get_context(node: &Node, depth: usize) + } + + Analyser --> Graph + Analyser --> TreeWalker + TreeWalker --> Files + Graph --> TreeContext +``` + +### LLM Client Module + +```mermaid +classDiagram + class LLMBroker { + +clients: Map + +get_client(llm_type: LLMType) + +generate_completion(prompt: String, llm_type: LLMType) + +generate_chat_completion(messages: Vec, llm_type: LLMType) + } + + class LLMClient { + +generate_completion(prompt: String) + +generate_chat_completion(messages: Vec) + +stream_chat_completion(messages: Vec) + } + + class OpenAIClient { + +api_key: String + +model: String + } + + class AnthropicClient { + +api_key: String + +model: String + } + + class GoogleAIClient { + +api_key: String + +model: String + } + + class LLMTokenizer { + +count_tokens(text: &str, model: &str) + +truncate_text(text: &str, max_tokens: usize, model: &str) + } + + LLMBroker --> LLMClient + LLMClient <|-- OpenAIClient + LLMClient <|-- AnthropicClient + LLMClient <|-- GoogleAIClient + LLMBroker --> LLMTokenizer +``` + +### Code Chunking Module + +```mermaid +classDiagram + class TSLanguageParsing { + +parse_file(file_path: &Path, language: Language) + +get_symbols(parsed: &Tree) + } + + class EditorParsing { + +parse_text(text: &str, language: Language) + +get_symbols_at_position(parsed: &Tree, position: Position) + } + + class FileContent { + +path: PathBuf + +content: String + +language: Language + } + + class TextDocument { + +uri: String + +version: i32 + +content: String + +language_id: String + } + + class ScopeGraph { + +add_scope(scope: Scope) + +connect_scopes(parent: ScopeId, child: ScopeId) + +get_scope_at_position(position: Position) + } + + TSLanguageParsing --> FileContent + EditorParsing --> TextDocument + TSLanguageParsing --> ScopeGraph + EditorParsing --> ScopeGraph +``` + +## Data Flow Diagrams + +### Request Processing Flow + +```mermaid +sequenceDiagram + participant Editor as Aide Editor + participant API as Webserver API + participant App as Application Core + participant LLM as LLM Client + participant Repo as Repository Analysis + participant Agent as Agentic Tools + + Editor->>API: Request (code context, query) + API->>App: Process request + App->>Repo: Analyze repository context + Repo-->>App: Repository context + App->>Agent: Select appropriate tools + Agent->>LLM: Generate prompt with context + LLM-->>Agent: LLM response + Agent->>App: Process LLM response + App->>API: Formatted response + API->>Editor: Display results to user +``` + +### Code Editing Flow + +```mermaid +sequenceDiagram + participant Editor as Aide Editor + participant API as Webserver API + participant Agent as Agentic System + participant MCTS as MCTS Engine + participant LLM as LLM Client + participant FS as File System + + Editor->>API: Edit request with code context + API->>Agent: Process edit request + Agent->>MCTS: Generate possible edits + + loop Action Selection + MCTS->>LLM: Generate candidate actions + LLM-->>MCTS: Candidate actions + MCTS->>MCTS: Evaluate actions + MCTS->>MCTS: Select best action + end + + MCTS-->>Agent: Best edit action + Agent->>FS: Apply edit to file + FS-->>Agent: Edit result + Agent->>API: Edit response + API->>Editor: Updated code +``` + +### Symbol Analysis Flow + +```mermaid +sequenceDiagram + participant Editor as Aide Editor + participant API as Webserver API + participant SymbolMgr as Symbol Manager + participant Parser as Language Parser + participant LLM as LLM Client + + Editor->>API: Symbol analysis request + API->>SymbolMgr: Process symbol request + SymbolMgr->>Parser: Parse code for symbols + Parser-->>SymbolMgr: Symbol tree + SymbolMgr->>LLM: Generate symbol analysis + LLM-->>SymbolMgr: Symbol insights + SymbolMgr->>API: Symbol analysis response + API->>Editor: Display symbol insights +``` + +## Key Concepts and Abstractions + +```mermaid +mindmap + root((Sidecar)) + Application + Configuration + Repository Pool + Language Parsing + AI Components + LLM Integration + OpenAI + Anthropic + Google AI + Others + Agentic System + Tool Box + Symbol Manager + Memory + MCTS + Action Nodes + Selection Strategy + Execution + Code Understanding + Repository Mapping + Page Rank + Symbol Graph + Code Chunking + Language Parsers + Symbol Extraction + Tree-sitter Integration + Web Interface + API Endpoints + Request Handling + Response Streaming +``` + +## Feature Dependency Graph + +```mermaid +graph TD + CodeEditing["Code Editing"] --> SymbolAnalysis["Symbol Analysis"] + CodeEditing --> LanguageParsing["Language Parsing"] + CodeEditing --> LLMIntegration["LLM Integration"] + + SymbolAnalysis --> RepositoryMapping["Repository Mapping"] + SymbolAnalysis --> TreeSitter["Tree-sitter Parsing"] + + AgentChat["Agent Chat"] --> LLMIntegration + AgentChat --> ContextGathering["Context Gathering"] + + ContextGathering --> RepositoryMapping + ContextGathering --> FileAnalysis["File Analysis"] + + MCTSDecision["MCTS Decision Making"] --> LLMIntegration + MCTSDecision --> ToolExecution["Tool Execution"] + + ToolExecution --> FileSystem["File System Access"] + ToolExecution --> GitIntegration["Git Integration"] + + InlineCompletion["Inline Completion"] --> LanguageParsing + InlineCompletion --> LLMIntegration + + LanguageParsing --> TreeSitter +``` + +## Conclusion + +This knowledge graph provides a comprehensive view of the Sidecar codebase structure and relationships between different components. It should help developers understand how the various parts of the system interact and how data flows through the application. \ No newline at end of file diff --git a/README.md b/README.md index 42e8b63b8..e195a7e07 100644 --- a/README.md +++ b/README.md @@ -17,30 +17,349 @@ ![Latest release](https://img.shields.io/github/v/release/codestoryai/binaries?label=version) ![Discord Shield](https://discord.com/api/guilds/1138070673756004464/widget.png?style=shield) -## Sidecar +# Sidecar: The AI Brain for Aide Editor -Sidecar is the AI brains of Aide the editor. To accomplish the work of creating the prompts, talking to LLM and everything else in between Sidecar is responsible for making sure it all works together. +## Overview -Broadly speaking these are the following important bits in Sidecar: +Sidecar is the AI intelligence engine that powers the Aide code editor. It handles everything from prompt creation and LLM communication to code analysis and intelligent editing assistance. This repository contains the core AI functionality that enables Aide to understand and interact with your codebase at a deep level. -- `tool_box.rs` - The collection of all and any tools AI might need is present here, all the language specific smartness is handled by `tool_box.rs` -- `symbol/` - The symbol folder contains the code which allows each individual symbol to be smart and independent. This can work on any granularity level, all the way from a file to a single function or function inside a class (its very versatile) -- `llm_prompts/` - This is a relic of the past (and somewhat in use still) for creating prompts especially for the inline completion bits. The inline completions bits are not maintained any longer but if you want to take a stab at working on it, please reach out to us on Discord, we are happy to support you. -- `repomap` - This creates a repository map using page rank on the code symbols. Most of the code here is a port of the python implementation done on Aider (do check it out if you are in the market for a CLI tool for code-generation) +## Table of Contents + +- [Architecture](#architecture) +- [Core Components](#core-components) +- [Knowledge Graph](#knowledge-graph) +- [Getting Started](#getting-started) +- [Project Structure](#project-structure) +- [Key Features](#key-features) +- [Integration with Aide](#integration-with-aide) +- [Feature Ideas](#feature-ideas) +- [Contributing](#contributing) +- [Feedback](#feedback) +- [Code of Conduct](#code-of-conduct) +- [License](#license) + +## Architecture + +Sidecar is built as a Rust workspace with multiple crates that work together to provide AI-powered code assistance. The architecture follows a modular design with clear separation of concerns. + +```mermaid +flowchart TD + A[Aide Editor] <--> B[Webserver API] + B <--> C[Application Core] + C <--> D[LLM Client] + C <--> E[Repository Analysis] + C <--> F[Agentic Tools] + C <--> G[MCTS Decision Engine] + C <--> H[Code Chunking] + D <--> I[External LLM Providers] + E <--> J[Git Repository] + F <--> K[Symbol Management] + H <--> L[Language-Specific Parsers] +``` + +### Data Flow + +```mermaid +sequenceDiagram + participant Editor as Aide Editor + participant API as Webserver API + participant App as Application Core + participant LLM as LLM Client + participant Repo as Repository Analysis + participant Agent as Agentic Tools + + Editor->>API: Request (code context, query) + API->>App: Process request + App->>Repo: Analyze repository context + Repo-->>App: Repository context + App->>Agent: Select appropriate tools + Agent->>LLM: Generate prompt with context + LLM-->>Agent: LLM response + Agent->>App: Process LLM response + App->>API: Formatted response + API->>Editor: Display results to user +``` + +## Core Components + +Sidecar consists of several key components that work together: + +### 1. Webserver + +The entry point for the application, handling HTTP requests from the Aide editor. It provides API endpoints for various AI-assisted operations. + +**Key Files:** +- `sidecar/src/bin/webserver.rs`: Main entry point +- `sidecar/src/webserver/mod.rs`: API route definitions + +### 2. LLM Client + +Handles communication with various Large Language Model providers (OpenAI, Anthropic, etc.). + +**Key Features:** +- Support for multiple LLM providers +- Token counting and management +- Request formatting for different models +- Response parsing and streaming + +### 3. Agentic System + +The core AI agent system that can perform complex code operations. + +**Key Components:** +- Tool selection and execution +- Memory management for context retention +- Symbol-level intelligence for code understanding +- Session management for ongoing interactions + +### 4. Monte Carlo Tree Search (MCTS) + +A decision-making system that explores possible code changes and selects the most promising ones. + +**Key Features:** +- Action node representation +- Selection strategies +- Value functions for evaluating changes +- Execution planning + +### 5. Repository Mapping + +Analyzes and maps the structure of a code repository to provide context for AI operations. + +**Key Features:** +- PageRank-based importance scoring +- Symbol relationship graphing +- File and directory analysis +- Context retrieval for relevant code sections + +### 6. Code Chunking + +Parses and chunks code into meaningful segments for better understanding by LLMs. + +**Key Features:** +- Language-specific parsing (Rust, Python, JavaScript, TypeScript, Go) +- Symbol extraction and relationship mapping +- Scope analysis +- Text document management + +## Knowledge Graph + +```mermaid +graph TD + subgraph Workspace + Sidecar["sidecar (Main Crate)"] --- LLMClient["llm_client"] + Sidecar --- LLMPrompts["llm_prompts"] + Sidecar --- Logging["logging"] + end + + subgraph SidecarComponents + Webserver["webserver"] --- Application["application"] + Application --- Agentic["agentic"] + Application --- MCTS["mcts"] + Application --- Repomap["repomap"] + Application --- Chunking["chunking"] + Application --- Agent["agent"] + Application --- Git["git"] + Application --- Repo["repo"] + end + + subgraph AgenticComponents + SymbolManager["symbol/manager"] --- ToolBox["symbol/tool_box"] + ToolBox --- Tools["tool/*"] + SymbolManager --- Memory["memory/*"] + end + + subgraph LLMComponents + Clients["clients/*"] --- Provider["provider"] + Provider --- Broker["broker"] + Broker --- Tokenizer["tokenizer"] + end + + Sidecar --- SidecarComponents + Agentic --- AgenticComponents + LLMClient --- LLMComponents +``` + +### Component Relationships + +```mermaid +classDiagram + class Application { + +config: Configuration + +repo_pool: RepositoryPool + +language_parsing: TSLanguageParsing + +llm_broker: LLMBroker + +symbol_manager: SymbolManager + +tool_box: ToolBox + +initialize() + +install_logging() + +setup_scratch_pad() + } + + class SymbolManager { + +tool_broker: ToolBroker + +symbol_tracker: SymbolTrackerInline + +editor_parsing: EditorParsing + +llm_properties: LLMProperties + } + + class ToolBox { + +tool_broker: ToolBroker + +symbol_tracker: SymbolTrackerInline + +editor_parsing: EditorParsing + } + + class LLMBroker { + +clients: Map + +get_client() + +generate_completion() + +generate_chat_completion() + } + + class Webserver { + +start(app: Application) + +agentic_router() + +tree_sitter_router() + +file_operations_router() + } + + Application "1" *-- "1" SymbolManager + Application "1" *-- "1" ToolBox + Application "1" *-- "1" LLMBroker + Webserver "1" -- "1" Application +``` ## Getting Started -1. Ensure you are using Rust 1.79 -2. Build the binary: `cargo build --bin webserver` -3. Run the binary: `./target/debug/webserver` -4. Profit! +### Prerequisites + +- Rust 1.79 or later +- Cargo with workspace support +- Git (for repository analysis features) -## Bonus on how to get your Aide editor to talk to Sidecar +### Installation -1. Run the Aide production build or build from source using [this](https://github.com/codestoryai/ide) +1. Clone the repository: + ```bash + git clone https://github.com/codestoryai/sidecar.git + cd sidecar + ``` + +2. Build the project: + ```bash + cargo build --bin webserver + ``` + +3. Run the webserver: + ```bash + ./target/debug/webserver + ``` + +### Configuration + +Sidecar can be configured through command-line arguments or environment variables. Key configuration options include: + +- LLM provider API keys +- Port and host settings +- Repository indexing options +- Logging levels and destinations + +## Project Structure + +```mermaid +graph TD + Root["/ (Root)"] --> Sidecar["sidecar/"] + Root --> LLMClient["llm_client/"] + Root --> LLMPrompts["llm_prompts/"] + Root --> Logging["logging/"] + + Sidecar --> SrcSidecar["src/"] + SrcSidecar --> Webserver["webserver/"] + SrcSidecar --> MCTS["mcts/"] + SrcSidecar --> Agentic["agentic/"] + SrcSidecar --> Repomap["repomap/"] + SrcSidecar --> LLM["llm/"] + SrcSidecar --> Repo["repo/"] + SrcSidecar --> Chunking["chunking/"] + SrcSidecar --> Agent["agent/"] + SrcSidecar --> Git["git/"] + SrcSidecar --> Bin["bin/"] + + LLMClient --> SrcLLM["src/"] + SrcLLM --> Clients["clients/"] + SrcLLM --> Format["format/"] + SrcLLM --> Tokenizer["tokenizer/"] + + LLMPrompts --> SrcPrompts["src/"] + SrcPrompts --> FIM["fim/"] + SrcPrompts --> Chat["chat/"] + SrcPrompts --> InLineEdit["in_line_edit/"] + + Logging --> SrcLogging["src/"] +``` + +## Key Features + +### Symbol-Level Intelligence + +Sidecar can understand and operate on individual code symbols (functions, classes, variables) with context awareness. + +### Repository Mapping + +Builds a graph representation of your codebase to understand relationships between files and symbols. + +### Multi-Language Support + +Supports parsing and understanding of multiple programming languages: +- Rust +- Python +- JavaScript/TypeScript +- Go + +### Agentic Tools + +Provides a collection of tools that AI agents can use to perform complex code operations: +- Code editing +- Symbol analysis +- Repository search +- Context gathering + +### Monte Carlo Tree Search + +Uses MCTS to explore possible code changes and select the most promising ones for implementation. + +## Integration with Aide + +Sidecar is designed to work seamlessly with the Aide editor. To connect your local Sidecar instance with Aide: + +1. Run the Aide production build or build from source using [this repository](https://github.com/codestoryai/ide) 2. Run the sidecar binary -3. Since you have a sidecar binary already running, the editor will prefer to use this over starting its own process. -4. Congratulations! You are now running sidecar for Aide locally with your own built binary. +3. Since you have a sidecar binary already running, the editor will prefer to use this over starting its own process +4. Congratulations! You are now running sidecar for Aide locally with your own built binary + +## Feature Ideas + +Here are 10 creative and easy-to-implement ideas for enhancing Sidecar: + +1. **Language-Specific Documentation Generator**: Automatically generate documentation comments based on code analysis and best practices for each language. + +2. **Code Health Metrics Dashboard**: Create a simple dashboard that shows code quality metrics and suggests improvements. + +3. **Commit Message Generator**: Analyze git diffs and generate meaningful commit messages based on the changes. + +4. **Test Case Generator**: Automatically generate unit tests for functions based on their signatures and usage patterns. + +5. **Code Explanation Mode**: Add a feature to explain complex code sections in plain English with customizable detail levels. + +6. **Dependency Analyzer**: Scan the codebase for outdated or vulnerable dependencies and suggest updates. + +7. **Code Style Enforcer**: Implement a tool that suggests style improvements based on language-specific best practices. + +8. **Performance Hotspot Detector**: Analyze code to identify potential performance bottlenecks and suggest optimizations. + +9. **Interactive Tutorial Generator**: Create interactive tutorials for new developers to understand the codebase structure. + +10. **Code Review Assistant**: Implement a tool that provides automated code review comments based on common issues and best practices. ## Contributing diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 000000000..2355045e9 --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,261 @@ +# Sidecar Project Roadmap + +This document outlines the future direction and planned enhancements for the Sidecar project. + +## Current Status + +Sidecar is currently a functional AI-powered code assistant that integrates with the Aide editor. It provides capabilities for: + +- Code understanding and analysis +- AI-assisted code editing +- Repository mapping and context gathering +- Multi-language support (Rust, Python, JavaScript/TypeScript, Go) +- Integration with multiple LLM providers + +## Short-Term Goals (0-3 months) + +```mermaid +gantt + title Short-Term Goals + dateFormat YYYY-MM-DD + section Performance + Optimize repository mapping algorithm :a1, 2024-04-01, 30d + Improve token usage efficiency :a2, after a1, 30d + Enhance response streaming :a3, 2024-04-15, 30d + + section Features + Add support for more languages :b1, 2024-04-01, 45d + Implement code health metrics :b2, 2024-04-15, 30d + Create documentation generator :b3, after b2, 30d + + section User Experience + Improve error handling and reporting :c1, 2024-04-01, 30d + Enhance configuration options :c2, after c1, 30d + Add user feedback mechanisms :c3, 2024-05-01, 30d +``` + +### Performance Improvements + +1. **Optimize Repository Mapping Algorithm** + - Improve the efficiency of the PageRank algorithm for large codebases + - Implement incremental updates to avoid full re-indexing + - Add caching mechanisms for frequently accessed symbols + +2. **Improve Token Usage Efficiency** + - Enhance context pruning to reduce token usage + - Implement smarter chunking strategies for large files + - Optimize prompt templates for different LLM providers + +3. **Enhance Response Streaming** + - Reduce latency in streaming responses + - Implement partial result processing + - Add progress indicators for long-running operations + +### Feature Enhancements + +1. **Add Support for More Languages** + - Add support for Java, C#, and PHP + - Improve existing language parsers + - Create a plugin system for language-specific features + +2. **Implement Code Health Metrics** + - Add code complexity analysis + - Implement duplicate code detection + - Create visualizations for code health metrics + +3. **Create Documentation Generator** + - Automatically generate documentation from code + - Support multiple documentation formats (Markdown, JSDoc, etc.) + - Integrate with existing documentation tools + +### User Experience Improvements + +1. **Improve Error Handling and Reporting** + - Enhance error messages with actionable information + - Implement error recovery mechanisms + - Add detailed logging for troubleshooting + +2. **Enhance Configuration Options** + - Create a unified configuration system + - Add support for project-specific configurations + - Implement configuration validation + +3. **Add User Feedback Mechanisms** + - Implement thumbs up/down feedback for AI responses + - Create a system for collecting and analyzing user feedback + - Use feedback to improve AI responses over time + +## Medium-Term Goals (3-6 months) + +```mermaid +gantt + title Medium-Term Goals + dateFormat YYYY-MM-DD + section Intelligence + Enhance MCTS decision making :d1, 2024-07-01, 45d + Implement learning from user feedback :d2, after d1, 45d + Add multi-step planning capabilities :d3, 2024-08-01, 45d + + section Integration + Expand IDE integration options :e1, 2024-07-01, 30d + Add CI/CD integration :e2, after e1, 30d + Create API for external tools :e3, 2024-08-15, 45d + + section Collaboration + Implement multi-user collaboration :f1, 2024-07-15, 60d + Add team knowledge sharing :f2, after f1, 45d + Create project-specific memory :f3, 2024-09-01, 30d +``` + +### Intelligence Enhancements + +1. **Enhance MCTS Decision Making** + - Improve action selection algorithms + - Implement more sophisticated value functions + - Add support for parallel exploration + +2. **Implement Learning from User Feedback** + - Create a system for learning from user edits + - Implement preference learning from feedback + - Add personalization based on user behavior + +3. **Add Multi-Step Planning Capabilities** + - Implement hierarchical planning + - Add support for complex refactoring operations + - Create visualization tools for plans + +### Integration Improvements + +1. **Expand IDE Integration Options** + - Add support for more code editors (VS Code, JetBrains IDEs) + - Implement deeper integration with editor features + - Create a standardized protocol for editor communication + +2. **Add CI/CD Integration** + - Implement integration with popular CI/CD systems + - Add support for automated code reviews + - Create tools for test generation and validation + +3. **Create API for External Tools** + - Design and implement a public API + - Create documentation and examples + - Build a plugin system for extending functionality + +### Collaboration Features + +1. **Implement Multi-User Collaboration** + - Add support for real-time collaboration + - Implement conflict resolution mechanisms + - Create tools for sharing context between users + +2. **Add Team Knowledge Sharing** + - Implement team-specific knowledge bases + - Create tools for sharing insights between team members + - Add support for organizational knowledge + +3. **Create Project-Specific Memory** + - Implement long-term memory for projects + - Add support for project-specific preferences + - Create tools for knowledge transfer between projects + +## Long-Term Vision (6+ months) + +```mermaid +mindmap + root((Long-Term Vision)) + Autonomous Development Assistant + Self-improving capabilities + Proactive code maintenance + Autonomous bug fixing + Advanced Intelligence + Multi-agent collaboration + Domain-specific expertise + Contextual understanding + Ecosystem Integration + Full development lifecycle + Cross-tool coordination + Knowledge graph integration + Enterprise Features + Compliance and security + Custom model training + Enterprise knowledge base +``` + +### Autonomous Development Assistant + +- **Self-Improving Capabilities**: Implement systems that learn from interactions and improve over time +- **Proactive Code Maintenance**: Develop features that proactively suggest improvements and fixes +- **Autonomous Bug Fixing**: Create capabilities for automatically identifying and fixing common bugs + +### Advanced Intelligence + +- **Multi-Agent Collaboration**: Implement systems where multiple specialized agents work together +- **Domain-Specific Expertise**: Develop expertise in specific domains (web development, data science, etc.) +- **Contextual Understanding**: Enhance understanding of project context, business logic, and requirements + +### Ecosystem Integration + +- **Full Development Lifecycle**: Integrate with all aspects of the development lifecycle +- **Cross-Tool Coordination**: Enable coordination between different development tools +- **Knowledge Graph Integration**: Create a comprehensive knowledge graph of code, documentation, and discussions + +### Enterprise Features + +- **Compliance and Security**: Add features for ensuring code compliance and security +- **Custom Model Training**: Provide tools for training custom models on proprietary codebases +- **Enterprise Knowledge Base**: Create an enterprise-wide knowledge base for code and best practices + +## Community Roadmap + +```mermaid +gantt + title Community Roadmap + dateFormat YYYY-MM-DD + section Community + Improve documentation :g1, 2024-04-01, 30d + Create contributor guides :g2, after g1, 30d + Implement community feedback system :g3, 2024-05-15, 45d + + section Open Source + Enhance plugin system :h1, 2024-06-01, 45d + Create extension marketplace :h2, after h1, 60d + Implement community governance :h3, 2024-08-01, 90d +``` + +### Community Building + +1. **Improve Documentation** + - Enhance user and developer documentation + - Create tutorials and examples + - Add interactive documentation + +2. **Create Contributor Guides** + - Develop comprehensive guides for contributors + - Create templates for common contributions + - Implement mentoring programs for new contributors + +3. **Implement Community Feedback System** + - Create tools for gathering community feedback + - Implement transparent feature voting + - Develop a roadmap influenced by community needs + +### Open Source Development + +1. **Enhance Plugin System** + - Create a robust plugin architecture + - Develop tools for plugin development + - Implement plugin testing and validation + +2. **Create Extension Marketplace** + - Build a marketplace for community extensions + - Implement rating and review systems + - Create tools for discovering useful extensions + +3. **Implement Community Governance** + - Develop transparent governance processes + - Create systems for community decision-making + - Implement open planning and prioritization + +## Conclusion + +This roadmap outlines the planned direction for the Sidecar project, but it is subject to change based on user feedback, technological advancements, and community contributions. We welcome input from the community to help shape the future of Sidecar. \ No newline at end of file From ec9d2eaef7a41564326255f046bc82c78026030b Mon Sep 17 00:00:00 2001 From: "agentfarmx[bot]" <198411105+agentfarmx[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:44:46 +0000 Subject: [PATCH 2/6] feat: add operation ID extraction for PR tracking --- sidecar/src/agentic/tool/errors.rs | 5 +- sidecar/src/agentic/tool/git/diff_client.rs | 42 ++++++++++- sidecar/src/agentic/tool/git/edited_files.rs | 79 +++++++++++++++++++- 3 files changed, 121 insertions(+), 5 deletions(-) diff --git a/sidecar/src/agentic/tool/errors.rs b/sidecar/src/agentic/tool/errors.rs index 14e56a701..3c4b006e8 100644 --- a/sidecar/src/agentic/tool/errors.rs +++ b/sidecar/src/agentic/tool/errors.rs @@ -92,9 +92,12 @@ pub enum ToolError { #[error("Cancelled by user")] UserCancellation, + #[error("No operation ID found for this PR. Please include an operation ID in the PR title or description.")] + MissingOperationID, + #[error("Invalid input: {0}")] InvalidInput(String), #[error("Invocation error: {0}")] InvocationError(String), -} +} \ No newline at end of file diff --git a/sidecar/src/agentic/tool/git/diff_client.rs b/sidecar/src/agentic/tool/git/diff_client.rs index 4c0eb4904..fd82c6762 100644 --- a/sidecar/src/agentic/tool/git/diff_client.rs +++ b/sidecar/src/agentic/tool/git/diff_client.rs @@ -59,6 +59,7 @@ pub struct GitDiffClientResponse { fs_file_path: String, old_version: String, new_version: String, + operation_id: Option, } impl GitDiffClientResponse { @@ -69,6 +70,10 @@ impl GitDiffClientResponse { pub fn new_version(&self) -> &str { &self.new_version } + + pub fn operation_id(&self) -> Option<&str> { + self.operation_id.as_deref() + } } async fn run_command( @@ -120,6 +125,9 @@ async fn run_command( } if !expanded { + // Try to extract operation ID from the git diff output + let operation_id = extract_operation_id(&output); + return Ok(GitDiffClientResponse { fs_file_path: "".to_owned(), old_version: "".to_owned(), @@ -127,6 +135,7 @@ async fn run_command( // feeling too lazy to create a new tool so this is implict understood // behavior new_version: output, + operation_id, }); } @@ -155,6 +164,32 @@ async fn run_command( // Ok(()) // } +/// Extracts operation ID from PR description or title +/// Returns None if no operation ID is found +fn extract_operation_id(content: &str) -> Option { + // Common patterns for operation IDs in PR titles or descriptions + let patterns = [ + // Look for explicit operation ID format: "operation_id: XXX" or "operationId: XXX" + r"operation[_\s]?[iI]d:\s*([a-zA-Z0-9_-]+)", + // Look for operation ID in brackets: [XXX] + r"\[([a-zA-Z0-9_-]+)\]", + // Look for operation ID in parentheses: (XXX) + r"\(([a-zA-Z0-9_-]+)\)", + // Look for operation ID with prefix: op-XXX + r"op-([a-zA-Z0-9_-]+)", + ]; + + for pattern in patterns { + if let Some(captures) = regex::Regex::new(pattern).ok()?.captures(content) { + if let Some(id) = captures.get(1) { + return Some(id.as_str().to_string()); + } + } + } + + None +} + fn parse_git_diff_output_full_length( git_diff: &str, root_directory: &str, @@ -192,11 +227,16 @@ fn parse_git_diff_output_full_length( // we start after the diff git -- and index {crap} lines let slice_limits = &git_diff_lines[idx + 2..=section_limit]; let (old_version, new_version) = extract_versions(slice_limits); + + // Extract operation ID from the content (try both old and new versions) + let operation_id = extract_operation_id(&old_version) + .or_else(|| extract_operation_id(&new_version)); diff_outputs.push(GitDiffClientResponse { fs_file_path: joined_path_str.to_owned(), old_version, new_version, + operation_id, }); idx = section_limit; } @@ -285,4 +325,4 @@ impl Tool for GitDiffClient { fn get_reward_scale(&self, _trajectory_length: usize) -> Vec { vec![] } -} +} \ No newline at end of file diff --git a/sidecar/src/agentic/tool/git/edited_files.rs b/sidecar/src/agentic/tool/git/edited_files.rs index 3ca5de363..c3d95ee69 100644 --- a/sidecar/src/agentic/tool/git/edited_files.rs +++ b/sidecar/src/agentic/tool/git/edited_files.rs @@ -11,6 +11,32 @@ use crate::agentic::tool::{ use async_trait::async_trait; use logging::new_client; +/// Extracts operation ID from PR description or title +/// Returns None if no operation ID is found +fn extract_operation_id(content: &str) -> Option { + // Common patterns for operation IDs in PR titles or descriptions + let patterns = [ + // Look for explicit operation ID format: "operation_id: XXX" or "operationId: XXX" + r"operation[_\s]?[iI]d:\s*([a-zA-Z0-9_-]+)", + // Look for operation ID in brackets: [XXX] + r"\[([a-zA-Z0-9_-]+)\]", + // Look for operation ID in parentheses: (XXX) + r"\(([a-zA-Z0-9_-]+)\)", + // Look for operation ID with prefix: op-XXX + r"op-([a-zA-Z0-9_-]+)", + ]; + + for pattern in patterns { + if let Some(captures) = regex::Regex::new(pattern).ok()?.captures(content) { + if let Some(id) = captures.get(1) { + return Some(id.as_str().to_string()); + } + } + } + + None +} + #[derive(Debug, Clone, serde::Serialize)] pub struct EditedFilesRequest { editor_url: String, @@ -32,6 +58,8 @@ pub struct EditedGitDiffFile { diff: String, current_content: String, updated_timestamp_ms: i64, + #[serde(default)] + operation_id: Option, } impl EditedGitDiffFile { @@ -50,17 +78,58 @@ impl EditedGitDiffFile { pub fn current_content(&self) -> &str { &self.current_content } + + pub fn operation_id(&self) -> Option<&str> { + self.operation_id.as_deref() + } + + /// Tries to extract operation ID from diff or current content if not already set + pub fn extract_operation_id(&mut self) { + if self.operation_id.is_none() { + self.operation_id = extract_operation_id(&self.diff) + .or_else(|| extract_operation_id(&self.current_content)); + } + } } #[derive(Debug, Clone, serde::Deserialize)] pub struct EditedFilesResponse { changed_files: Vec, + #[serde(default)] + operation_id: Option, } impl EditedFilesResponse { - pub fn changed_files(self) -> Vec { + pub fn changed_files(mut self) -> Vec { + // Extract operation IDs from files if not already set + for file in &mut self.changed_files { + file.extract_operation_id(); + } self.changed_files } + + pub fn operation_id(&self) -> Option<&str> { + self.operation_id.as_deref() + } + + /// Tries to find an operation ID from any of the changed files + pub fn extract_operation_id(&mut self) -> Option { + // First check if we already have an operation ID + if let Some(id) = &self.operation_id { + return Some(id.clone()); + } + + // Try to extract from any of the changed files + for file in &mut self.changed_files { + file.extract_operation_id(); + if let Some(id) = file.operation_id() { + self.operation_id = Some(id.to_string()); + return self.operation_id.clone(); + } + } + + None + } } pub struct EditedFiles { @@ -87,10 +156,14 @@ impl Tool for EditedFiles { .send() .await .map_err(|_e| ToolError::ErrorCommunicatingWithEditor)?; - let response: EditedFilesResponse = response.json().await.map_err(|e| { + let mut response: EditedFilesResponse = response.json().await.map_err(|e| { eprintln!("edited_files::{:?}", &e); ToolError::SerdeConversionFailed })?; + + // Try to extract operation ID if not already set + response.extract_operation_id(); + Ok(ToolOutput::edited_files(response)) } @@ -109,4 +182,4 @@ impl Tool for EditedFiles { fn get_reward_scale(&self, _trajectory_length: usize) -> Vec { vec![] } -} +} \ No newline at end of file From 3898c9d39e82988fbe84ab72bd8b8d1dfc2848a0 Mon Sep 17 00:00:00 2001 From: "agentfarmx[bot]" <198411105+agentfarmx[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:41:46 +0000 Subject: [PATCH 3/6] refactor: move extract_operation_id to dedicated module --- sidecar/src/agentic/tool/git/diff_client.rs | 27 +------------------- sidecar/src/agentic/tool/git/edited_files.rs | 27 +------------------- sidecar/src/agentic/tool/git/mod.rs | 1 + sidecar/src/agentic/tool/git/operation_id.rs | 27 ++++++++++++++++++++ 4 files changed, 30 insertions(+), 52 deletions(-) create mode 100644 sidecar/src/agentic/tool/git/operation_id.rs diff --git a/sidecar/src/agentic/tool/git/diff_client.rs b/sidecar/src/agentic/tool/git/diff_client.rs index fd82c6762..d9277afe5 100644 --- a/sidecar/src/agentic/tool/git/diff_client.rs +++ b/sidecar/src/agentic/tool/git/diff_client.rs @@ -12,6 +12,7 @@ use tokio::process::Command; use crate::agentic::tool::r#type::ToolRewardScale; use crate::agentic::tool::{errors::ToolError, input::ToolInput, output::ToolOutput, r#type::Tool}; +use crate::agentic::tool::git::operation_id::extract_operation_id; use async_trait::async_trait; // TODO(skcd): We want to talk to the editor to get the git-diff of the recently @@ -164,32 +165,6 @@ async fn run_command( // Ok(()) // } -/// Extracts operation ID from PR description or title -/// Returns None if no operation ID is found -fn extract_operation_id(content: &str) -> Option { - // Common patterns for operation IDs in PR titles or descriptions - let patterns = [ - // Look for explicit operation ID format: "operation_id: XXX" or "operationId: XXX" - r"operation[_\s]?[iI]d:\s*([a-zA-Z0-9_-]+)", - // Look for operation ID in brackets: [XXX] - r"\[([a-zA-Z0-9_-]+)\]", - // Look for operation ID in parentheses: (XXX) - r"\(([a-zA-Z0-9_-]+)\)", - // Look for operation ID with prefix: op-XXX - r"op-([a-zA-Z0-9_-]+)", - ]; - - for pattern in patterns { - if let Some(captures) = regex::Regex::new(pattern).ok()?.captures(content) { - if let Some(id) = captures.get(1) { - return Some(id.as_str().to_string()); - } - } - } - - None -} - fn parse_git_diff_output_full_length( git_diff: &str, root_directory: &str, diff --git a/sidecar/src/agentic/tool/git/edited_files.rs b/sidecar/src/agentic/tool/git/edited_files.rs index c3d95ee69..1160f36ae 100644 --- a/sidecar/src/agentic/tool/git/edited_files.rs +++ b/sidecar/src/agentic/tool/git/edited_files.rs @@ -7,36 +7,11 @@ use crate::agentic::tool::{ input::ToolInput, output::ToolOutput, r#type::{Tool, ToolRewardScale}, + git::operation_id::extract_operation_id, }; use async_trait::async_trait; use logging::new_client; -/// Extracts operation ID from PR description or title -/// Returns None if no operation ID is found -fn extract_operation_id(content: &str) -> Option { - // Common patterns for operation IDs in PR titles or descriptions - let patterns = [ - // Look for explicit operation ID format: "operation_id: XXX" or "operationId: XXX" - r"operation[_\s]?[iI]d:\s*([a-zA-Z0-9_-]+)", - // Look for operation ID in brackets: [XXX] - r"\[([a-zA-Z0-9_-]+)\]", - // Look for operation ID in parentheses: (XXX) - r"\(([a-zA-Z0-9_-]+)\)", - // Look for operation ID with prefix: op-XXX - r"op-([a-zA-Z0-9_-]+)", - ]; - - for pattern in patterns { - if let Some(captures) = regex::Regex::new(pattern).ok()?.captures(content) { - if let Some(id) = captures.get(1) { - return Some(id.as_str().to_string()); - } - } - } - - None -} - #[derive(Debug, Clone, serde::Serialize)] pub struct EditedFilesRequest { editor_url: String, diff --git a/sidecar/src/agentic/tool/git/mod.rs b/sidecar/src/agentic/tool/git/mod.rs index a982bee7a..a11db1a9e 100644 --- a/sidecar/src/agentic/tool/git/mod.rs +++ b/sidecar/src/agentic/tool/git/mod.rs @@ -1,3 +1,4 @@ //! Contains the helper functions for git related operations on the repo pub(crate) mod diff_client; pub(crate) mod edited_files; +pub(crate) mod operation_id; \ No newline at end of file diff --git a/sidecar/src/agentic/tool/git/operation_id.rs b/sidecar/src/agentic/tool/git/operation_id.rs new file mode 100644 index 000000000..5779e8ecc --- /dev/null +++ b/sidecar/src/agentic/tool/git/operation_id.rs @@ -0,0 +1,27 @@ +//! Utility functions for extracting operation IDs from PR content + +/// Extracts operation ID from PR description or title +/// Returns None if no operation ID is found +pub fn extract_operation_id(content: &str) -> Option { + // Common patterns for operation IDs in PR titles or descriptions + let patterns = [ + // Look for explicit operation ID format: "operation_id: XXX" or "operationId: XXX" + r"operation[_\s]?[iI]d:\s*([a-zA-Z0-9_-]+)", + // Look for operation ID in brackets: [XXX] + r"\[([a-zA-Z0-9_-]+)\]", + // Look for operation ID in parentheses: (XXX) + r"\(([a-zA-Z0-9_-]+)\)", + // Look for operation ID with prefix: op-XXX + r"op-([a-zA-Z0-9_-]+)", + ]; + + for pattern in patterns { + if let Some(captures) = regex::Regex::new(pattern).ok()?.captures(content) { + if let Some(id) = captures.get(1) { + return Some(id.as_str().to_string()); + } + } + } + + None +} \ No newline at end of file From ed276ca4c5dec5266b22e5aaf700213a894cc788 Mon Sep 17 00:00:00 2001 From: "agentfarmx[bot]" <198411105+agentfarmx[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:49:22 +0000 Subject: [PATCH 4/6] feat(sidecar): add TUI interface for AI agent interactions --- sidecar/Cargo.toml | 2 + sidecar/src/bin/tui.rs | 533 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 535 insertions(+) create mode 100644 sidecar/src/bin/tui.rs diff --git a/sidecar/Cargo.toml b/sidecar/Cargo.toml index 6be288c9f..2fa6bc7c2 100644 --- a/sidecar/Cargo.toml +++ b/sidecar/Cargo.toml @@ -86,6 +86,8 @@ diffy = "0.4.0" colored = "2.1.0" reqwest-middleware = "0.4.0" mcp_client_rs = "0.1.7" +ratatui = "0.26.1" +crossterm = "0.27.0" [target.'cfg(unix)'.dependencies] openssl = { version = "0.10", features = ["vendored"] } diff --git a/sidecar/src/bin/tui.rs b/sidecar/src/bin/tui.rs new file mode 100644 index 000000000..0732a6de4 --- /dev/null +++ b/sidecar/src/bin/tui.rs @@ -0,0 +1,533 @@ +use std::{ + io::{self, Stdout}, + path::PathBuf, + sync::Arc, + time::{Duration, Instant}, +}; + +use clap::Parser; +use crossterm::{ + event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEventKind}, + execute, + terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, +}; +use llm_client::{ + broker::LLMBroker, + clients::types::LLMType, + provider::{AnthropicAPIKey, LLMProvider, LLMProviderAPIKeys}, +}; +use ratatui::{ + backend::CrosstermBackend, + layout::{Constraint, Direction, Layout}, + style::{Color, Modifier, Style}, + text::{Line, Span, Text}, + widgets::{Block, Borders, List, ListItem, Paragraph, Wrap}, + Frame, Terminal, +}; +use sidecar::{ + agentic::{ + symbol::{ + events::{input::SymbolEventRequestId, message_event::SymbolEventMessageProperties}, + identifier::LLMProperties, + ui_event::UIEventWithID, + }, + tool::{ + r#type::ToolType, + session::tool_use_agent::{AgentThinkingMode, ToolUseAgentProperties}, + }, + }, + application::{application::Application, config::configuration::Configuration}, + repo::types::RepoRef, + user_context::types::UserContext, +}; +use tokio::sync::mpsc::{self, UnboundedReceiver, UnboundedSender}; + +/// Define the command-line arguments +#[derive(Parser, Debug)] +#[command( + author = "CodeStory AI", + version = "1.0", + about = "Sidecar TUI - Terminal User Interface for the AI agent" +)] +struct CliArgs { + /// Working directory path + #[arg(long, default_value = ".")] + working_directory: PathBuf, + + /// Anthropic API key + #[arg(long, env = "ANTHROPIC_API_KEY")] + anthropic_api_key: Option, + + /// OpenAI API key + #[arg(long, env = "OPENAI_API_KEY")] + openai_api_key: Option, + + /// Model to use + #[arg(long, default_value = "claude-3-sonnet-20240229")] + model: String, + + /// Repository name + #[arg(long, default_value = "current")] + repo_name: String, +} + +enum InputMode { + Normal, + Editing, +} + +struct App { + input: String, + input_mode: InputMode, + messages: Vec, + session_id: String, + exchange_id: usize, + sender: UnboundedSender, + working_directory: String, + repo_name: String, + is_processing: bool, +} + +struct ChatMessage { + role: String, + content: String, + timestamp: Instant, +} + +impl App { + fn new( + sender: UnboundedSender, + working_directory: String, + repo_name: String, + ) -> Self { + Self { + input: String::new(), + input_mode: InputMode::Normal, + messages: Vec::new(), + session_id: uuid::Uuid::new_v4().to_string(), + exchange_id: 0, + sender, + working_directory, + repo_name, + is_processing: false, + } + } + + fn submit_message(&mut self) { + if self.input.trim().is_empty() { + return; + } + + // Add user message to chat history + self.messages.push(ChatMessage { + role: "user".to_string(), + content: self.input.clone(), + timestamp: Instant::now(), + }); + + // Send the message to the agent + let exchange_id = self.exchange_id.to_string(); + self.exchange_id += 1; + + let ui_event = UIEventWithID::user_message( + self.session_id.clone(), + exchange_id, + self.input.clone(), + ); + self.sender.send(ui_event).unwrap(); + + // Clear the input field + self.input.clear(); + self.is_processing = true; + } + + fn add_agent_response(&mut self, content: String) { + self.messages.push(ChatMessage { + role: "assistant".to_string(), + content, + timestamp: Instant::now(), + }); + self.is_processing = false; + } +} + +async fn check_session_storage_path(config: Arc, session_id: String) -> String { + let mut session_path = config.index_dir.clone(); + session_path = session_path.join("session"); + // check if the plan_storage_path_exists + if tokio::fs::metadata(&session_path).await.is_err() { + tokio::fs::create_dir(&session_path) + .await + .expect("directory creation to not fail"); + } + session_path = session_path.join(session_id); + session_path + .to_str() + .expect("path conversion to work on all platforms") + .to_owned() +} + +async fn setup_agent( + args: &CliArgs, + app: &App, + sender: UnboundedSender, +) -> ( + Arc, + SymbolEventMessageProperties, + String, + tokio_util::sync::CancellationToken, +) { + let mut configuration = Configuration::default(); + configuration.apply_directly = true; + + // Setup the application + Application::install_logging(&configuration); + Application::setup_scratch_pad(&configuration).await; + + let application = Application::initialize(configuration) + .await + .expect("application setup should work"); + + // Determine which API key and model to use + let llm_provider = if let Some(anthropic_key) = &args.anthropic_api_key { + LLMProperties::new( + LLMType::Custom(args.model.clone()), + LLMProvider::Anthropic, + LLMProviderAPIKeys::Anthropic(AnthropicAPIKey::new(anthropic_key.clone())), + ) + } else if let Some(openai_key) = &args.openai_api_key { + LLMProperties::new( + LLMType::Gpt4O, + LLMProvider::OpenAI, + LLMProviderAPIKeys::OpenAI(llm_client::provider::OpenAIProvider::new( + openai_key.clone(), + )), + ) + } else { + panic!("Either ANTHROPIC_API_KEY or OPENAI_API_KEY must be provided"); + }; + + let cancellation_token = tokio_util::sync::CancellationToken::new(); + let editor_url = "http://localhost:42427".to_owned(); + + let message_properties = SymbolEventMessageProperties::new( + SymbolEventRequestId::new("0".to_owned(), app.session_id.clone()), + sender.clone(), + editor_url, + cancellation_token.clone(), + llm_provider, + ); + + let session_storage_path = + check_session_storage_path(application.config.clone(), app.session_id.clone()).await; + + ( + application, + message_properties, + session_storage_path, + cancellation_token, + ) +} + +async fn process_agent_response( + mut receiver: UnboundedReceiver, + app_sender: UnboundedSender, +) { + let mut response_buffer = String::new(); + + while let Some(event) = receiver.recv().await { + match event { + UIEventWithID::AgentResponse { + session_id: _, + exchange_id: _, + response, + is_final: _, + } => { + response_buffer.push_str(&response); + // For simplicity, we're sending each chunk immediately + // In a more sophisticated implementation, you might want to buffer and send complete messages + app_sender.send(response.clone()).unwrap(); + } + UIEventWithID::AgentThinking { + session_id: _, + exchange_id: _, + thinking, + } => { + // For debugging, you might want to show the agent's thinking process + println!("Agent thinking: {}", thinking); + } + UIEventWithID::AgentToolUse { + session_id: _, + exchange_id: _, + tool_name, + tool_input, + tool_output, + } => { + let tool_use_message = format!( + "\n\nTool: {}\nInput: {}\nOutput: {}\n\n", + tool_name, tool_input, tool_output + ); + response_buffer.push_str(&tool_use_message); + app_sender.send(tool_use_message).unwrap(); + } + UIEventWithID::AgentComplete { + session_id: _, + exchange_id: _, + } => { + // Signal that the agent has completed its response + app_sender.send("__COMPLETE__".to_string()).unwrap(); + response_buffer.clear(); + } + _ => { + // Handle other event types if needed + } + } + } +} + +fn ui(f: &mut Frame, app: &App) { + let chunks = Layout::default() + .direction(Direction::Vertical) + .constraints([Constraint::Min(1), Constraint::Length(3)].as_ref()) + .split(f.size()); + + // Chat history + let messages: Vec = app + .messages + .iter() + .map(|m| { + let role_style = if m.role == "user" { + Style::default().fg(Color::Blue).add_modifier(Modifier::BOLD) + } else { + Style::default().fg(Color::Green).add_modifier(Modifier::BOLD) + }; + + let role_span = Span::styled(format!("{}: ", m.role), role_style); + let content = Text::from(m.content.clone()); + + ListItem::new(vec![ + Line::from(role_span), + Line::from(""), + Line::from(content), + Line::from(""), + ]) + }) + .collect(); + + let messages = List::new(messages) + .block(Block::default().borders(Borders::ALL).title("Messages")) + .highlight_style(Style::default().add_modifier(Modifier::BOLD)) + .highlight_symbol("> "); + + f.render_widget(messages, chunks[0]); + + // Input box + let input = Paragraph::new(app.input.as_ref()) + .style(match app.input_mode { + InputMode::Normal => Style::default(), + InputMode::Editing => Style::default().fg(Color::Yellow), + }) + .block( + Block::default() + .borders(Borders::ALL) + .title(if app.is_processing { + "Input (Processing...)" + } else { + "Input (Press Enter to edit, Esc to exit edit mode)" + }), + ) + .wrap(Wrap { trim: true }); + + f.render_widget(input, chunks[1]); + + // Show cursor when in editing mode + if let InputMode::Editing = app.input_mode { + f.set_cursor( + chunks[1].x + app.input.len() as u16 + 1, + chunks[1].y + 1, + ); + } +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + let args = CliArgs::parse(); + + // Setup terminal + enable_raw_mode()?; + let mut stdout = io::stdout(); + execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?; + let backend = CrosstermBackend::new(stdout); + let mut terminal = Terminal::new(backend)?; + + // Create channels for communication + let (ui_sender, ui_receiver) = mpsc::unbounded_channel(); + let (app_sender, mut app_receiver) = mpsc::unbounded_channel(); + + // Create app state + let working_directory = args + .working_directory + .to_str() + .unwrap_or(".") + .to_string(); + let mut app = App::new(ui_sender.clone(), working_directory.clone(), args.repo_name.clone()); + + // Setup agent components + let (application, message_properties, session_storage_path, _cancellation_token) = + setup_agent(&args, &app, ui_sender.clone()).await; + + // Spawn a task to process agent responses + tokio::spawn(process_agent_response(ui_receiver, app_sender.clone())); + + // Main event loop + let tick_rate = Duration::from_millis(100); + let mut last_tick = Instant::now(); + + loop { + terminal.draw(|f| ui(f, &app))?; + + // Check for agent responses + while let Ok(response) = app_receiver.try_recv() { + if response == "__COMPLETE__" { + app.is_processing = false; + } else { + // If this is the first response for this exchange, create a new message + if !app.is_processing || app.messages.is_empty() || app.messages.last().unwrap().role != "assistant" { + app.add_agent_response(response); + } else { + // Otherwise, append to the existing message + if let Some(last_message) = app.messages.last_mut() { + if last_message.role == "assistant" { + last_message.content.push_str(&response); + } + } + } + } + } + + let timeout = tick_rate + .checked_sub(last_tick.elapsed()) + .unwrap_or_else(|| Duration::from_secs(0)); + + if crossterm::event::poll(timeout)? { + if let Event::Key(key) = event::read()? { + if key.kind == KeyEventKind::Press { + match app.input_mode { + InputMode::Normal => match key.code { + KeyCode::Char('q') => { + break; + } + KeyCode::Enter => { + app.input_mode = InputMode::Editing; + } + _ => {} + }, + InputMode::Editing => match key.code { + KeyCode::Enter if !app.is_processing => { + app.submit_message(); + + // Process the message with the agent + let session_service = application.session_service.clone(); + let tool_box = application.tool_box.clone(); + let llm_broker = application.llm_broker.clone(); + let session_id = app.session_id.clone(); + let exchange_id = (app.exchange_id - 1).to_string(); + let user_message = app.messages.last().unwrap().content.clone(); + let working_dir = working_directory.clone(); + let repo_name = app.repo_name.clone(); + let message_props = message_properties.clone(); + let session_storage = session_storage_path.clone(); + + tokio::spawn(async move { + // Define the tools the agent can use + let tools = vec![ + ToolType::ListFiles, + ToolType::SearchFileContentWithRegex, + ToolType::OpenFile, + ToolType::CodeEditing, + ToolType::AttemptCompletion, + ToolType::TerminalCommand, + ToolType::FindFiles, + ]; + + // Define agent properties + let aide_rules = Some(format!( + r#"You are helping the user in the repository present in {} +FOLLOW these steps to resolve the issue: +1. As a first step, it might be a good idea to explore the repo to familiarize yourself with its structure. +2. Edit the sourcecode of the repo to resolve the issue +3. Think about edgecases and make sure your fix handles them as well + +Your thinking should be thorough and so it's fine if it's very long."#, + repo_name, + )); + + let tool_use_agent_properties = ToolUseAgentProperties::new( + false, + "bash".to_owned(), + AgentThinkingMode::MiniCOTBeforeTool, + false, + false, + repo_name, + aide_rules, + ); + + // Run the agent + let _ = session_service + .tool_use_agentic( + session_id, + session_storage, + user_message, + exchange_id, + vec![], + vec![], + "bash".to_owned(), + vec![], + RepoRef::local(&working_dir).expect("repo_ref to work"), + working_dir, + tools, + tool_box, + llm_broker, + UserContext::default(), + false, + false, + None, + tool_use_agent_properties, + message_props, + None, + ) + .await; + }); + } + KeyCode::Escape => { + app.input_mode = InputMode::Normal; + } + KeyCode::Backspace => { + app.input.pop(); + } + KeyCode::Char(c) => { + app.input.push(c); + } + _ => {} + }, + } + } + } + } + + if last_tick.elapsed() >= tick_rate { + last_tick = Instant::now(); + } + } + + // Restore terminal + disable_raw_mode()?; + execute!( + terminal.backend_mut(), + LeaveAlternateScreen, + DisableMouseCapture + )?; + terminal.show_cursor()?; + + Ok(()) +} \ No newline at end of file From 120fe5eef108e394222b68166f0ba2c8d132b284 Mon Sep 17 00:00:00 2001 From: 0xrinegade <101195284+0xrinegade@users.noreply.github.com> Date: Fri, 21 Mar 2025 15:37:40 +0000 Subject: [PATCH 5/6] feat: add multiple new modules for improved functionality and organization --- .clinerules | 541 ++++++++++++++++++ .github/workflows/release.yaml | 16 +- CONTRIBUTING.md | 14 +- Cargo.toml | 4 +- HOW_TO_CONTRIBUTE.md | 12 +- KNOWLEDGE_GRAPH.md | 38 +- README.md | 108 ++-- ...7a1ce055297aa4c7e405b1a27710ca6ec9b47.json | 0 ...f33830eadc9e058d759c1375c2ed09f032d9d.json | 0 ...b2883b14f1a039e86ca17cdc128c754bcd798.json | 0 ...648b66c9ed54602a67213d7b2610ab024e5be.json | 0 ...f3540f8c35c139ac87b800436d6b2c8e13622.json | 0 ...d24e38f2a1d0e25ef50fa7cebf69ac9dd3ee1.json | 0 ...1556b9c67b0449c51a20480d45f3bce1c6bb4.json | 0 ...26d0409fcf15942eea73fda0c48dd328612bc.json | 0 ...3fa03e7df67f03ee55a364440cfdf1844028e.json | 0 ...f36a702400f0ba77fabdf255bdc87d4ce5db8.json | 0 ...588f455d1e83196274ac7af2fa81fc5815e47.json | 0 ...04c8a2c7ebc9d73bde890f3a2ff79b2ebf309.json | 0 ...513eabd30c50fd8293b0e11be374806745b87.json | 0 ...0057335b40225be0a8c8d29d9227de12ae364.json | 0 ...318ad6859a0efa42359ecbcaeb568684df4ce.json | 0 ...05e5d71b63fff588a556886fb19cb9401b1f3.json | 0 ...27f04d978b8296615aba7d87532f6fe4a093f.json | 0 ...4cfe29dade7112fdd4b68c6105b23168b1970.json | 0 ...899d74eb346533e3c9ab3814ba67b68d71f51.json | 0 {sidecar => larp}/Cargo.toml | 4 +- {sidecar => larp}/build.rs | 0 {sidecar => larp}/codestory.db | Bin {sidecar => larp}/languages.yml | 0 .../20231001175730_tantivy_cache.sql | 0 .../migrations/20231004205514_file_cache.sql | 0 .../20231008042845_agent_events.sql | 0 ...31009130619_agent_conversation_message.sql | 0 .../20231014173633_code_snippet_cache.sql | 0 .../20231016135924_git_log_statistics.sql | 0 .../migrations/20231117015452_llm_data.sql | 0 ...20174108_openai_llm_data_answer_column.sql | 0 {sidecar => larp}/src/agent/llm_funcs.rs | 0 {sidecar => larp}/src/agent/mod.rs | 0 {sidecar => larp}/src/agent/prompts.rs | 0 {sidecar => larp}/src/agent/search.rs | 0 {sidecar => larp}/src/agent/stopwords.txt | 0 {sidecar => larp}/src/agent/types.rs | 0 {sidecar => larp}/src/agent/user_context.rs | 0 {sidecar => larp}/src/agentic/memory/base.rs | 0 {sidecar => larp}/src/agentic/memory/mod.rs | 0 {sidecar => larp}/src/agentic/mod.rs | 0 .../src/agentic/swe_bench/mod.rs | 0 .../src/agentic/swe_bench/search_cache.rs | 0 .../src/agentic/symbol/anchored.rs | 0 .../src/agentic/symbol/errors.rs | 0 .../src/agentic/symbol/events/agent.rs | 0 .../agentic/symbol/events/context_event.rs | 0 .../src/agentic/symbol/events/edit.rs | 0 .../symbol/events/environment_event.rs | 0 .../src/agentic/symbol/events/human.rs | 0 .../agentic/symbol/events/initial_request.rs | 0 .../src/agentic/symbol/events/input.rs | 0 .../src/agentic/symbol/events/lsp.rs | 0 .../agentic/symbol/events/message_event.rs | 0 .../src/agentic/symbol/events/mod.rs | 0 .../src/agentic/symbol/events/probe.rs | 0 .../src/agentic/symbol/events/types.rs | 0 .../src/agentic/symbol/helpers.rs | 0 .../src/agentic/symbol/identifier.rs | 0 .../src/agentic/symbol/locker.rs | 0 .../src/agentic/symbol/manager.rs | 0 {sidecar => larp}/src/agentic/symbol/mod.rs | 0 .../src/agentic/symbol/scratch_pad.rs | 0 .../src/agentic/symbol/tool_box.rs | 0 .../src/agentic/symbol/tool_properties.rs | 0 .../src/agentic/symbol/toolbox/helpers.rs | 0 .../src/agentic/symbol/toolbox/mod.rs | 0 {sidecar => larp}/src/agentic/symbol/types.rs | 0 .../src/agentic/symbol/ui_event.rs | 0 {sidecar => larp}/src/agentic/tool/broker.rs | 0 .../src/agentic/tool/code_edit/code_editor.rs | 0 .../src/agentic/tool/code_edit/filter_edit.rs | 0 .../src/agentic/tool/code_edit/find.rs | 0 .../src/agentic/tool/code_edit/mod.rs | 0 .../tool/code_edit/models/anthropic.rs | 0 .../agentic/tool/code_edit/models/broker.rs | 0 .../src/agentic/tool/code_edit/models/mod.rs | 0 .../tool/code_edit/search_and_replace.rs | 0 .../agentic/tool/code_edit/test_correction.rs | 0 .../src/agentic/tool/code_edit/types.rs | 0 .../agentic/tool/code_edit/xml_processor.rs | 0 .../apply_outline_edit_to_range.rs | 0 .../agentic/tool/code_symbol/correctness.rs | 0 .../src/agentic/tool/code_symbol/error_fix.rs | 0 .../code_symbol/find_file_for_new_symbol.rs | 0 .../find_symbols_to_edit_in_context.rs | 0 .../src/agentic/tool/code_symbol/followup.rs | 0 .../src/agentic/tool/code_symbol/important.rs | 0 .../code_symbol/initial_request_follow.rs | 0 .../src/agentic/tool/code_symbol/mod.rs | 0 .../tool/code_symbol/models/anthropic.rs | 0 .../agentic/tool/code_symbol/models/mod.rs | 0 .../agentic/tool/code_symbol/new_location.rs | 0 .../tool/code_symbol/new_sub_symbol.rs | 0 .../code_symbol/planning_before_code_edit.rs | 0 .../src/agentic/tool/code_symbol/probe.rs | 0 .../code_symbol/probe_question_for_symbol.rs | 0 .../tool/code_symbol/probe_try_hard_answer.rs | 0 .../tool/code_symbol/repo_map_search.rs | 0 .../reranking_symbols_for_editing_context.rs | 0 .../agentic/tool/code_symbol/scratch_pad.rs | 0 .../agentic/tool/code_symbol/should_edit.rs | 0 .../src/agentic/tool/code_symbol/types.rs | 0 .../src/agentic/tool/devtools/mod.rs | 0 .../src/agentic/tool/devtools/screenshot.rs | 0 .../src/agentic/tool/editor/apply.rs | 0 .../src/agentic/tool/editor/mod.rs | 0 {sidecar => larp}/src/agentic/tool/errors.rs | 0 .../src/agentic/tool/feedback/feedback.rs | 0 .../src/agentic/tool/feedback/mod.rs | 0 .../src/agentic/tool/file/file_finder.rs | 0 .../src/agentic/tool/file/important.rs | 0 .../src/agentic/tool/file/mod.rs | 0 .../src/agentic/tool/file/models/anthropic.rs | 0 .../src/agentic/tool/file/models/mod.rs | 0 .../src/agentic/tool/file/semantic_search.rs | 0 .../src/agentic/tool/file/types.rs | 0 .../src/agentic/tool/filtering/broker.rs | 0 .../src/agentic/tool/filtering/errors.rs | 0 .../src/agentic/tool/filtering/mod.rs | 0 .../tool/filtering/models/anthropic.rs | 0 .../src/agentic/tool/filtering/models/mod.rs | 0 .../src/agentic/tool/git/diff_client.rs | 0 .../src/agentic/tool/git/edited_files.rs | 0 {sidecar => larp}/src/agentic/tool/git/mod.rs | 0 .../src/agentic/tool/git/operation_id.rs | 0 .../src/agentic/tool/grep/file.rs | 0 .../src/agentic/tool/grep/mod.rs | 0 .../tool/helpers/cancellation_future.rs | 0 .../tool/helpers/diff_recent_changes.rs | 0 .../src/agentic/tool/helpers/mod.rs | 0 .../src/agentic/tool/human/cli.rs | 0 .../src/agentic/tool/human/error.rs | 0 .../src/agentic/tool/human/human.rs | 0 .../src/agentic/tool/human/mod.rs | 0 .../src/agentic/tool/human/qa.rs | 0 {sidecar => larp}/src/agentic/tool/input.rs | 0 {sidecar => larp}/src/agentic/tool/jitter.rs | 0 .../agentic/tool/kw_search/google_studio.rs | 0 .../src/agentic/tool/kw_search/mod.rs | 0 .../src/agentic/tool/kw_search/tag_search.rs | 0 .../src/agentic/tool/kw_search/tool.rs | 0 .../src/agentic/tool/kw_search/types.rs | 0 .../src/agentic/tool/lsp/create_file.rs | 0 .../src/agentic/tool/lsp/diagnostics.rs | 0 .../src/agentic/tool/lsp/file_diagnostics.rs | 0 .../src/agentic/tool/lsp/find_files.rs | 0 .../src/agentic/tool/lsp/get_outline_nodes.rs | 0 .../agentic/tool/lsp/go_to_previous_word.rs | 0 .../src/agentic/tool/lsp/gotodefintion.rs | 0 .../agentic/tool/lsp/gotoimplementations.rs | 0 .../src/agentic/tool/lsp/gotoreferences.rs | 0 .../agentic/tool/lsp/gototypedefinition.rs | 0 .../src/agentic/tool/lsp/grep_symbol.rs | 0 .../src/agentic/tool/lsp/inlay_hints.rs | 0 .../src/agentic/tool/lsp/list_files.rs | 0 {sidecar => larp}/src/agentic/tool/lsp/mod.rs | 0 .../src/agentic/tool/lsp/open_file.rs | 0 .../src/agentic/tool/lsp/quick_fix.rs | 0 .../src/agentic/tool/lsp/search_file.rs | 0 .../tool/lsp/subprocess_spawned_output.rs | 0 .../src/agentic/tool/lsp/undo_changes.rs | 0 .../src/agentic/tool/mcp/config.json.example | 0 .../src/agentic/tool/mcp/init.rs | 0 .../src/agentic/tool/mcp/input.rs | 0 .../src/agentic/tool/mcp/integration_tool.rs | 0 {sidecar => larp}/src/agentic/tool/mcp/mod.rs | 0 {sidecar => larp}/src/agentic/tool/mod.rs | 0 {sidecar => larp}/src/agentic/tool/output.rs | 0 .../src/agentic/tool/plan/add_steps.rs | 0 .../src/agentic/tool/plan/generator.rs | 0 .../src/agentic/tool/plan/mod.rs | 0 .../src/agentic/tool/plan/plan.rs | 0 .../src/agentic/tool/plan/plan_step.rs | 0 .../src/agentic/tool/plan/reasoning.rs | 0 .../src/agentic/tool/plan/service.rs | 0 .../src/agentic/tool/plan/updater.rs | 0 .../src/agentic/tool/ref_filter/mod.rs | 0 .../src/agentic/tool/ref_filter/ref_filter.rs | 0 .../src/agentic/tool/repo_map/generator.rs | 0 .../src/agentic/tool/repo_map/mod.rs | 0 .../src/agentic/tool/rerank/base.rs | 0 .../agentic/tool/rerank/listwise/anthropic.rs | 0 .../src/agentic/tool/rerank/listwise/mod.rs | 0 .../src/agentic/tool/rerank/mod.rs | 0 .../src/agentic/tool/reward/client.rs | 0 .../src/agentic/tool/reward/mod.rs | 0 .../src/agentic/tool/search/big_search.rs | 0 .../src/agentic/tool/search/decide.rs | 0 .../src/agentic/tool/search/google_studio.rs | 0 .../src/agentic/tool/search/identify.rs | 0 .../src/agentic/tool/search/iterative.rs | 0 .../src/agentic/tool/search/mod.rs | 0 .../src/agentic/tool/search/relevant_files.rs | 0 .../src/agentic/tool/search/repository.rs | 0 .../tool/session/ask_followup_question.rs | 0 .../tool/session/attempt_completion.rs | 0 .../src/agentic/tool/session/chat.rs | 0 .../src/agentic/tool/session/exchange.rs | 0 .../src/agentic/tool/session/hot_streak.rs | 0 .../src/agentic/tool/session/mod.rs | 0 .../src/agentic/tool/session/service.rs | 0 .../src/agentic/tool/session/session.rs | 0 .../agentic/tool/session/tool_use_agent.rs | 0 .../src/agentic/tool/swe_bench/mod.rs | 0 .../src/agentic/tool/swe_bench/test_tool.rs | 0 .../src/agentic/tool/terminal/mod.rs | 0 .../src/agentic/tool/terminal/terminal.rs | 0 .../src/agentic/tool/test_runner/mod.rs | 0 .../src/agentic/tool/test_runner/runner.rs | 0 .../src/agentic/tool/thinking/mod.rs | 0 .../src/agentic/tool/thinking/thinking.rs | 0 {sidecar => larp}/src/agentic/tool/type.rs | 0 .../src/application/application.rs | 0 .../src/application/config/configuration.rs | 0 .../src/application/config/mod.rs | 0 .../src/application/logging/cleanup.rs | 0 .../src/application/logging/mod.rs | 0 .../src/application/logging/tracing.rs | 0 {sidecar => larp}/src/application/mod.rs | 0 {sidecar => larp}/src/bin/agent_bin.rs | 0 .../src/bin/agent_bin_reasoning.rs | 0 {sidecar => larp}/src/bin/axflow_ingest.rs | 0 .../src/bin/code_editing_flow.rs | 0 .../src/bin/code_selection_editing.rs | 0 {sidecar => larp}/src/bin/cohere_rerank.rs | 0 {sidecar => larp}/src/bin/db_loading.rs | 0 {sidecar => larp}/src/bin/diff_rendering.rs | 0 .../src/bin/find_code_section.rs | 0 {sidecar => larp}/src/bin/find_files_bin.rs | 0 {sidecar => larp}/src/bin/fireworks.rs | 0 {sidecar => larp}/src/bin/get_diagnostics.rs | 0 .../src/bin/git_diff_generator.rs | 0 {sidecar => larp}/src/bin/git_diff_trace.rs | 0 {sidecar => larp}/src/bin/git_ignore_walk.rs | 0 {sidecar => larp}/src/bin/git_log.rs | 0 {sidecar => larp}/src/bin/git_walking.rs | 0 {sidecar => larp}/src/bin/list_files.rs | 0 {sidecar => larp}/src/bin/midwit_tool_use.rs | 0 {sidecar => larp}/src/bin/parea.rs | 0 {sidecar => larp}/src/bin/print_mcts_tree.rs | 0 {sidecar => larp}/src/bin/read_folder.rs | 0 {sidecar => larp}/src/bin/rg_search_file.rs | 0 {sidecar => larp}/src/bin/serde_xml.rs | 0 {sidecar => larp}/src/bin/shared_future.rs | 0 {sidecar => larp}/src/bin/simd_page_rank.rs | 0 {sidecar => larp}/src/bin/state.rs | 0 {sidecar => larp}/src/bin/stream_thinking.rs | 0 .../src/bin/swe_bench_agent_bin.rs | 0 .../bin/swe_bench_agent_bin_test_run_based.rs | 0 .../src/bin/swe_bench_agent_bin_tool_based.rs | 0 {sidecar => larp}/src/bin/swe_bench_mcts.rs | 0 .../src/bin/swe_bench_submission.rs | 0 {sidecar => larp}/src/bin/sys_info.rs | 0 {sidecar => larp}/src/bin/terminal.rs | 0 .../src/bin/tool_box_git_diff.rs | 0 {sidecar => larp}/src/bin/try_repomap.rs | 0 {sidecar => larp}/src/bin/tui.rs | 0 {sidecar => larp}/src/bin/webserver.rs | 0 .../src/chunking/editor_parsing.rs | 0 .../src/chunking/file_content.rs | 0 {sidecar => larp}/src/chunking/go.rs | 0 {sidecar => larp}/src/chunking/helpers.rs | 0 {sidecar => larp}/src/chunking/javascript.rs | 0 {sidecar => larp}/src/chunking/languages.rs | 0 {sidecar => larp}/src/chunking/mod.rs | 0 {sidecar => larp}/src/chunking/python.rs | 0 {sidecar => larp}/src/chunking/rust.rs | 0 {sidecar => larp}/src/chunking/scope_graph.rs | 0 {sidecar => larp}/src/chunking/something.php | 0 .../src/chunking/text_document.rs | 0 {sidecar => larp}/src/chunking/types.rs | 0 {sidecar => larp}/src/chunking/typescript.rs | 0 {sidecar => larp}/src/db/mod.rs | 0 {sidecar => larp}/src/db/sqlite.rs | 0 {sidecar => larp}/src/file_analyser/mod.rs | 0 {sidecar => larp}/src/file_analyser/types.rs | 0 .../src/git/commit_statistics.rs | 0 {sidecar => larp}/src/git/mod.rs | 0 .../src/in_line_agent/context_parsing.rs | 0 {sidecar => larp}/src/in_line_agent/mod.rs | 0 .../src/in_line_agent/prompts.rs | 0 {sidecar => larp}/src/in_line_agent/types.rs | 0 .../context/clipboard_context.rs | 0 .../context/codebase_context.rs | 0 .../inline_completion/context/current_file.rs | 0 .../src/inline_completion/context/mod.rs | 0 .../context/tree_sitter_cache.rs | 0 .../src/inline_completion/context/types.rs | 0 .../src/inline_completion/document/content.rs | 0 .../src/inline_completion/document/mod.rs | 0 .../src/inline_completion/helpers.rs | 0 .../src/inline_completion/mod.rs | 0 .../multiline/detect_multiline.rs | 0 .../src/inline_completion/multiline/mod.rs | 0 .../src/inline_completion/state.rs | 0 .../src/inline_completion/symbols_tracker.rs | 0 .../src/inline_completion/types.rs | 0 {sidecar => larp}/src/lib.rs | 0 {sidecar => larp}/src/llm/clients/openai.rs | 0 {sidecar => larp}/src/mcts/action_node.rs | 0 .../src/mcts/agent_settings/mod.rs | 0 .../src/mcts/agent_settings/settings.rs | 0 {sidecar => larp}/src/mcts/decider/decider.rs | 0 {sidecar => larp}/src/mcts/decider/error.rs | 0 {sidecar => larp}/src/mcts/decider/mod.rs | 0 .../src/mcts/editor/anthropic_computer.rs | 0 {sidecar => larp}/src/mcts/editor/error.rs | 0 {sidecar => larp}/src/mcts/editor/mod.rs | 0 {sidecar => larp}/src/mcts/execution/error.rs | 0 .../src/mcts/execution/inference.rs | 0 {sidecar => larp}/src/mcts/execution/mod.rs | 0 {sidecar => larp}/src/mcts/feedback/error.rs | 0 .../src/mcts/feedback/feedback.rs | 0 {sidecar => larp}/src/mcts/feedback/mod.rs | 0 {sidecar => larp}/src/mcts/mod.rs | 0 {sidecar => larp}/src/mcts/selector/mod.rs | 0 .../src/mcts/selector/selector.rs | 0 .../src/mcts/selector/uct_score.rs | 0 .../src/mcts/value_function/error.rs | 0 .../src/mcts/value_function/mod.rs | 0 .../src/mcts/value_function/reward.rs | 0 {sidecar => larp}/src/repo/filesystem.rs | 0 {sidecar => larp}/src/repo/iterator.rs | 0 {sidecar => larp}/src/repo/mod.rs | 0 {sidecar => larp}/src/repo/state.rs | 0 {sidecar => larp}/src/repo/types.rs | 0 {sidecar => larp}/src/repomap/analyser.rs | 0 {sidecar => larp}/src/repomap/error.rs | 0 {sidecar => larp}/src/repomap/file/errors.rs | 0 {sidecar => larp}/src/repomap/file/git.rs | 0 {sidecar => larp}/src/repomap/file/mod.rs | 0 {sidecar => larp}/src/repomap/files.rs | 0 {sidecar => larp}/src/repomap/graph.rs | 0 {sidecar => larp}/src/repomap/helpers.rs | 0 {sidecar => larp}/src/repomap/mod.rs | 0 {sidecar => larp}/src/repomap/tag.rs | 0 {sidecar => larp}/src/repomap/tree_context.rs | 0 {sidecar => larp}/src/repomap/tree_walker.rs | 0 {sidecar => larp}/src/repomap/types.rs | 0 .../src/reporting/axflow/client.rs | 0 {sidecar => larp}/src/reporting/axflow/mod.rs | 0 {sidecar => larp}/src/reporting/mod.rs | 0 .../src/reporting/posthog/client.rs | 0 .../src/reporting/posthog/mod.rs | 0 {sidecar => larp}/src/reranking/mod.rs | 0 .../src/reranking/snippet_reranking.rs | 0 {sidecar => larp}/src/state/mod.rs | 0 {sidecar => larp}/src/state/schema_version.rs | 0 {sidecar => larp}/src/tree_printer/mod.rs | 0 {sidecar => larp}/src/tree_printer/tree.rs | 0 {sidecar => larp}/src/user_context/helpers.rs | 0 {sidecar => larp}/src/user_context/mod.rs | 0 {sidecar => larp}/src/user_context/types.rs | 0 {sidecar => larp}/src/webserver/agent.rs | 0 .../src/webserver/agent_stream.rs | 0 {sidecar => larp}/src/webserver/agentic.rs | 0 {sidecar => larp}/src/webserver/config.rs | 0 .../src/webserver/context_trimming.rs | 0 {sidecar => larp}/src/webserver/file_edit.rs | 0 {sidecar => larp}/src/webserver/health.rs | 0 .../src/webserver/in_line_agent.rs | 0 .../src/webserver/in_line_agent_stream.rs | 0 .../src/webserver/inline_completion.rs | 0 {sidecar => larp}/src/webserver/mod.rs | 0 .../src/webserver/model_selection.rs | 0 {sidecar => larp}/src/webserver/plan.rs | 0 .../src/webserver/tree_sitter.rs | 0 {sidecar => larp}/src/webserver/types.rs | 0 package_windows_bin.sh | 4 +- package_windows_zip.sh | 2 +- reproduce_error.py | 8 +- update_version.sh | 6 +- 380 files changed, 658 insertions(+), 99 deletions(-) create mode 100644 .clinerules rename {sidecar => larp}/.sqlx/query-0676ed471d90bb7a44ae5103ee27a1ce055297aa4c7e405b1a27710ca6ec9b47.json (100%) rename {sidecar => larp}/.sqlx/query-0c459e4ff404b1f3c750a333c83f33830eadc9e058d759c1375c2ed09f032d9d.json (100%) rename {sidecar => larp}/.sqlx/query-3e6c5db070ccc0ce144734375adb2883b14f1a039e86ca17cdc128c754bcd798.json (100%) rename {sidecar => larp}/.sqlx/query-444d3d341830d2001e5ec4f891c648b66c9ed54602a67213d7b2610ab024e5be.json (100%) rename {sidecar => larp}/.sqlx/query-44cffc24222af81e1f1840a4d4ff3540f8c35c139ac87b800436d6b2c8e13622.json (100%) rename {sidecar => larp}/.sqlx/query-4f6ba2705c2e2b4ace7276fddf2d24e38f2a1d0e25ef50fa7cebf69ac9dd3ee1.json (100%) rename {sidecar => larp}/.sqlx/query-6130131a3676914fdd208b8bd881556b9c67b0449c51a20480d45f3bce1c6bb4.json (100%) rename {sidecar => larp}/.sqlx/query-72547e044b212649ae39530386126d0409fcf15942eea73fda0c48dd328612bc.json (100%) rename {sidecar => larp}/.sqlx/query-7ad623e2dfdc2796c7ed26d71c53fa03e7df67f03ee55a364440cfdf1844028e.json (100%) rename {sidecar => larp}/.sqlx/query-7efe113a4a28d2f473d9ce4ad31f36a702400f0ba77fabdf255bdc87d4ce5db8.json (100%) rename {sidecar => larp}/.sqlx/query-7f63260645b3afdce1c5864bd1d588f455d1e83196274ac7af2fa81fc5815e47.json (100%) rename {sidecar => larp}/.sqlx/query-89e8a76436d3395071a2cf5608804c8a2c7ebc9d73bde890f3a2ff79b2ebf309.json (100%) rename {sidecar => larp}/.sqlx/query-97071b9b0962066b8c853f7915e513eabd30c50fd8293b0e11be374806745b87.json (100%) rename {sidecar => larp}/.sqlx/query-9f862a56e79cc9ae6e9b896064a0057335b40225be0a8c8d29d9227de12ae364.json (100%) rename {sidecar => larp}/.sqlx/query-c93e42c9c10c0b79ff7d376f3fd318ad6859a0efa42359ecbcaeb568684df4ce.json (100%) rename {sidecar => larp}/.sqlx/query-de4f91107148e44a1650f38f1d905e5d71b63fff588a556886fb19cb9401b1f3.json (100%) rename {sidecar => larp}/.sqlx/query-e192b80fb4fc47e4822f921270e27f04d978b8296615aba7d87532f6fe4a093f.json (100%) rename {sidecar => larp}/.sqlx/query-e38351a13cf68acb87afc8b5c244cfe29dade7112fdd4b68c6105b23168b1970.json (100%) rename {sidecar => larp}/.sqlx/query-ed6379e37c16064198f48dbfb91899d74eb346533e3c9ab3814ba67b68d71f51.json (100%) rename {sidecar => larp}/Cargo.toml (98%) rename {sidecar => larp}/build.rs (100%) rename {sidecar => larp}/codestory.db (100%) rename {sidecar => larp}/languages.yml (100%) rename {sidecar => larp}/migrations/20231001175730_tantivy_cache.sql (100%) rename {sidecar => larp}/migrations/20231004205514_file_cache.sql (100%) rename {sidecar => larp}/migrations/20231008042845_agent_events.sql (100%) rename {sidecar => larp}/migrations/20231009130619_agent_conversation_message.sql (100%) rename {sidecar => larp}/migrations/20231014173633_code_snippet_cache.sql (100%) rename {sidecar => larp}/migrations/20231016135924_git_log_statistics.sql (100%) rename {sidecar => larp}/migrations/20231117015452_llm_data.sql (100%) rename {sidecar => larp}/migrations/20231120174108_openai_llm_data_answer_column.sql (100%) rename {sidecar => larp}/src/agent/llm_funcs.rs (100%) rename {sidecar => larp}/src/agent/mod.rs (100%) rename {sidecar => larp}/src/agent/prompts.rs (100%) rename {sidecar => larp}/src/agent/search.rs (100%) rename {sidecar => larp}/src/agent/stopwords.txt (100%) rename {sidecar => larp}/src/agent/types.rs (100%) rename {sidecar => larp}/src/agent/user_context.rs (100%) rename {sidecar => larp}/src/agentic/memory/base.rs (100%) rename {sidecar => larp}/src/agentic/memory/mod.rs (100%) rename {sidecar => larp}/src/agentic/mod.rs (100%) rename {sidecar => larp}/src/agentic/swe_bench/mod.rs (100%) rename {sidecar => larp}/src/agentic/swe_bench/search_cache.rs (100%) rename {sidecar => larp}/src/agentic/symbol/anchored.rs (100%) rename {sidecar => larp}/src/agentic/symbol/errors.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/agent.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/context_event.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/edit.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/environment_event.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/human.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/initial_request.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/input.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/lsp.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/message_event.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/mod.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/probe.rs (100%) rename {sidecar => larp}/src/agentic/symbol/events/types.rs (100%) rename {sidecar => larp}/src/agentic/symbol/helpers.rs (100%) rename {sidecar => larp}/src/agentic/symbol/identifier.rs (100%) rename {sidecar => larp}/src/agentic/symbol/locker.rs (100%) rename {sidecar => larp}/src/agentic/symbol/manager.rs (100%) rename {sidecar => larp}/src/agentic/symbol/mod.rs (100%) rename {sidecar => larp}/src/agentic/symbol/scratch_pad.rs (100%) rename {sidecar => larp}/src/agentic/symbol/tool_box.rs (100%) rename {sidecar => larp}/src/agentic/symbol/tool_properties.rs (100%) rename {sidecar => larp}/src/agentic/symbol/toolbox/helpers.rs (100%) rename {sidecar => larp}/src/agentic/symbol/toolbox/mod.rs (100%) rename {sidecar => larp}/src/agentic/symbol/types.rs (100%) rename {sidecar => larp}/src/agentic/symbol/ui_event.rs (100%) rename {sidecar => larp}/src/agentic/tool/broker.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/code_editor.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/filter_edit.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/find.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/models/anthropic.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/models/broker.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/models/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/search_and_replace.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/test_correction.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/types.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_edit/xml_processor.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/apply_outline_edit_to_range.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/correctness.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/error_fix.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/find_file_for_new_symbol.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/find_symbols_to_edit_in_context.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/followup.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/important.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/initial_request_follow.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/models/anthropic.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/models/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/new_location.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/new_sub_symbol.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/planning_before_code_edit.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/probe.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/probe_question_for_symbol.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/probe_try_hard_answer.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/repo_map_search.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/reranking_symbols_for_editing_context.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/scratch_pad.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/should_edit.rs (100%) rename {sidecar => larp}/src/agentic/tool/code_symbol/types.rs (100%) rename {sidecar => larp}/src/agentic/tool/devtools/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/devtools/screenshot.rs (100%) rename {sidecar => larp}/src/agentic/tool/editor/apply.rs (100%) rename {sidecar => larp}/src/agentic/tool/editor/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/errors.rs (100%) rename {sidecar => larp}/src/agentic/tool/feedback/feedback.rs (100%) rename {sidecar => larp}/src/agentic/tool/feedback/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/file_finder.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/important.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/models/anthropic.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/models/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/semantic_search.rs (100%) rename {sidecar => larp}/src/agentic/tool/file/types.rs (100%) rename {sidecar => larp}/src/agentic/tool/filtering/broker.rs (100%) rename {sidecar => larp}/src/agentic/tool/filtering/errors.rs (100%) rename {sidecar => larp}/src/agentic/tool/filtering/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/filtering/models/anthropic.rs (100%) rename {sidecar => larp}/src/agentic/tool/filtering/models/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/git/diff_client.rs (100%) rename {sidecar => larp}/src/agentic/tool/git/edited_files.rs (100%) rename {sidecar => larp}/src/agentic/tool/git/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/git/operation_id.rs (100%) rename {sidecar => larp}/src/agentic/tool/grep/file.rs (100%) rename {sidecar => larp}/src/agentic/tool/grep/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/helpers/cancellation_future.rs (100%) rename {sidecar => larp}/src/agentic/tool/helpers/diff_recent_changes.rs (100%) rename {sidecar => larp}/src/agentic/tool/helpers/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/human/cli.rs (100%) rename {sidecar => larp}/src/agentic/tool/human/error.rs (100%) rename {sidecar => larp}/src/agentic/tool/human/human.rs (100%) rename {sidecar => larp}/src/agentic/tool/human/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/human/qa.rs (100%) rename {sidecar => larp}/src/agentic/tool/input.rs (100%) rename {sidecar => larp}/src/agentic/tool/jitter.rs (100%) rename {sidecar => larp}/src/agentic/tool/kw_search/google_studio.rs (100%) rename {sidecar => larp}/src/agentic/tool/kw_search/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/kw_search/tag_search.rs (100%) rename {sidecar => larp}/src/agentic/tool/kw_search/tool.rs (100%) rename {sidecar => larp}/src/agentic/tool/kw_search/types.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/create_file.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/diagnostics.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/file_diagnostics.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/find_files.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/get_outline_nodes.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/go_to_previous_word.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/gotodefintion.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/gotoimplementations.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/gotoreferences.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/gototypedefinition.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/grep_symbol.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/inlay_hints.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/list_files.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/open_file.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/quick_fix.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/search_file.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/subprocess_spawned_output.rs (100%) rename {sidecar => larp}/src/agentic/tool/lsp/undo_changes.rs (100%) rename {sidecar => larp}/src/agentic/tool/mcp/config.json.example (100%) rename {sidecar => larp}/src/agentic/tool/mcp/init.rs (100%) rename {sidecar => larp}/src/agentic/tool/mcp/input.rs (100%) rename {sidecar => larp}/src/agentic/tool/mcp/integration_tool.rs (100%) rename {sidecar => larp}/src/agentic/tool/mcp/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/output.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/add_steps.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/generator.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/plan.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/plan_step.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/reasoning.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/service.rs (100%) rename {sidecar => larp}/src/agentic/tool/plan/updater.rs (100%) rename {sidecar => larp}/src/agentic/tool/ref_filter/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/ref_filter/ref_filter.rs (100%) rename {sidecar => larp}/src/agentic/tool/repo_map/generator.rs (100%) rename {sidecar => larp}/src/agentic/tool/repo_map/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/rerank/base.rs (100%) rename {sidecar => larp}/src/agentic/tool/rerank/listwise/anthropic.rs (100%) rename {sidecar => larp}/src/agentic/tool/rerank/listwise/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/rerank/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/reward/client.rs (100%) rename {sidecar => larp}/src/agentic/tool/reward/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/big_search.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/decide.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/google_studio.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/identify.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/iterative.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/relevant_files.rs (100%) rename {sidecar => larp}/src/agentic/tool/search/repository.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/ask_followup_question.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/attempt_completion.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/chat.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/exchange.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/hot_streak.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/service.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/session.rs (100%) rename {sidecar => larp}/src/agentic/tool/session/tool_use_agent.rs (100%) rename {sidecar => larp}/src/agentic/tool/swe_bench/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/swe_bench/test_tool.rs (100%) rename {sidecar => larp}/src/agentic/tool/terminal/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/terminal/terminal.rs (100%) rename {sidecar => larp}/src/agentic/tool/test_runner/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/test_runner/runner.rs (100%) rename {sidecar => larp}/src/agentic/tool/thinking/mod.rs (100%) rename {sidecar => larp}/src/agentic/tool/thinking/thinking.rs (100%) rename {sidecar => larp}/src/agentic/tool/type.rs (100%) rename {sidecar => larp}/src/application/application.rs (100%) rename {sidecar => larp}/src/application/config/configuration.rs (100%) rename {sidecar => larp}/src/application/config/mod.rs (100%) rename {sidecar => larp}/src/application/logging/cleanup.rs (100%) rename {sidecar => larp}/src/application/logging/mod.rs (100%) rename {sidecar => larp}/src/application/logging/tracing.rs (100%) rename {sidecar => larp}/src/application/mod.rs (100%) rename {sidecar => larp}/src/bin/agent_bin.rs (100%) rename {sidecar => larp}/src/bin/agent_bin_reasoning.rs (100%) rename {sidecar => larp}/src/bin/axflow_ingest.rs (100%) rename {sidecar => larp}/src/bin/code_editing_flow.rs (100%) rename {sidecar => larp}/src/bin/code_selection_editing.rs (100%) rename {sidecar => larp}/src/bin/cohere_rerank.rs (100%) rename {sidecar => larp}/src/bin/db_loading.rs (100%) rename {sidecar => larp}/src/bin/diff_rendering.rs (100%) rename {sidecar => larp}/src/bin/find_code_section.rs (100%) rename {sidecar => larp}/src/bin/find_files_bin.rs (100%) rename {sidecar => larp}/src/bin/fireworks.rs (100%) rename {sidecar => larp}/src/bin/get_diagnostics.rs (100%) rename {sidecar => larp}/src/bin/git_diff_generator.rs (100%) rename {sidecar => larp}/src/bin/git_diff_trace.rs (100%) rename {sidecar => larp}/src/bin/git_ignore_walk.rs (100%) rename {sidecar => larp}/src/bin/git_log.rs (100%) rename {sidecar => larp}/src/bin/git_walking.rs (100%) rename {sidecar => larp}/src/bin/list_files.rs (100%) rename {sidecar => larp}/src/bin/midwit_tool_use.rs (100%) rename {sidecar => larp}/src/bin/parea.rs (100%) rename {sidecar => larp}/src/bin/print_mcts_tree.rs (100%) rename {sidecar => larp}/src/bin/read_folder.rs (100%) rename {sidecar => larp}/src/bin/rg_search_file.rs (100%) rename {sidecar => larp}/src/bin/serde_xml.rs (100%) rename {sidecar => larp}/src/bin/shared_future.rs (100%) rename {sidecar => larp}/src/bin/simd_page_rank.rs (100%) rename {sidecar => larp}/src/bin/state.rs (100%) rename {sidecar => larp}/src/bin/stream_thinking.rs (100%) rename {sidecar => larp}/src/bin/swe_bench_agent_bin.rs (100%) rename {sidecar => larp}/src/bin/swe_bench_agent_bin_test_run_based.rs (100%) rename {sidecar => larp}/src/bin/swe_bench_agent_bin_tool_based.rs (100%) rename {sidecar => larp}/src/bin/swe_bench_mcts.rs (100%) rename {sidecar => larp}/src/bin/swe_bench_submission.rs (100%) rename {sidecar => larp}/src/bin/sys_info.rs (100%) rename {sidecar => larp}/src/bin/terminal.rs (100%) rename {sidecar => larp}/src/bin/tool_box_git_diff.rs (100%) rename {sidecar => larp}/src/bin/try_repomap.rs (100%) rename {sidecar => larp}/src/bin/tui.rs (100%) rename {sidecar => larp}/src/bin/webserver.rs (100%) rename {sidecar => larp}/src/chunking/editor_parsing.rs (100%) rename {sidecar => larp}/src/chunking/file_content.rs (100%) rename {sidecar => larp}/src/chunking/go.rs (100%) rename {sidecar => larp}/src/chunking/helpers.rs (100%) rename {sidecar => larp}/src/chunking/javascript.rs (100%) rename {sidecar => larp}/src/chunking/languages.rs (100%) rename {sidecar => larp}/src/chunking/mod.rs (100%) rename {sidecar => larp}/src/chunking/python.rs (100%) rename {sidecar => larp}/src/chunking/rust.rs (100%) rename {sidecar => larp}/src/chunking/scope_graph.rs (100%) rename {sidecar => larp}/src/chunking/something.php (100%) rename {sidecar => larp}/src/chunking/text_document.rs (100%) rename {sidecar => larp}/src/chunking/types.rs (100%) rename {sidecar => larp}/src/chunking/typescript.rs (100%) rename {sidecar => larp}/src/db/mod.rs (100%) rename {sidecar => larp}/src/db/sqlite.rs (100%) rename {sidecar => larp}/src/file_analyser/mod.rs (100%) rename {sidecar => larp}/src/file_analyser/types.rs (100%) rename {sidecar => larp}/src/git/commit_statistics.rs (100%) rename {sidecar => larp}/src/git/mod.rs (100%) rename {sidecar => larp}/src/in_line_agent/context_parsing.rs (100%) rename {sidecar => larp}/src/in_line_agent/mod.rs (100%) rename {sidecar => larp}/src/in_line_agent/prompts.rs (100%) rename {sidecar => larp}/src/in_line_agent/types.rs (100%) rename {sidecar => larp}/src/inline_completion/context/clipboard_context.rs (100%) rename {sidecar => larp}/src/inline_completion/context/codebase_context.rs (100%) rename {sidecar => larp}/src/inline_completion/context/current_file.rs (100%) rename {sidecar => larp}/src/inline_completion/context/mod.rs (100%) rename {sidecar => larp}/src/inline_completion/context/tree_sitter_cache.rs (100%) rename {sidecar => larp}/src/inline_completion/context/types.rs (100%) rename {sidecar => larp}/src/inline_completion/document/content.rs (100%) rename {sidecar => larp}/src/inline_completion/document/mod.rs (100%) rename {sidecar => larp}/src/inline_completion/helpers.rs (100%) rename {sidecar => larp}/src/inline_completion/mod.rs (100%) rename {sidecar => larp}/src/inline_completion/multiline/detect_multiline.rs (100%) rename {sidecar => larp}/src/inline_completion/multiline/mod.rs (100%) rename {sidecar => larp}/src/inline_completion/state.rs (100%) rename {sidecar => larp}/src/inline_completion/symbols_tracker.rs (100%) rename {sidecar => larp}/src/inline_completion/types.rs (100%) rename {sidecar => larp}/src/lib.rs (100%) rename {sidecar => larp}/src/llm/clients/openai.rs (100%) rename {sidecar => larp}/src/mcts/action_node.rs (100%) rename {sidecar => larp}/src/mcts/agent_settings/mod.rs (100%) rename {sidecar => larp}/src/mcts/agent_settings/settings.rs (100%) rename {sidecar => larp}/src/mcts/decider/decider.rs (100%) rename {sidecar => larp}/src/mcts/decider/error.rs (100%) rename {sidecar => larp}/src/mcts/decider/mod.rs (100%) rename {sidecar => larp}/src/mcts/editor/anthropic_computer.rs (100%) rename {sidecar => larp}/src/mcts/editor/error.rs (100%) rename {sidecar => larp}/src/mcts/editor/mod.rs (100%) rename {sidecar => larp}/src/mcts/execution/error.rs (100%) rename {sidecar => larp}/src/mcts/execution/inference.rs (100%) rename {sidecar => larp}/src/mcts/execution/mod.rs (100%) rename {sidecar => larp}/src/mcts/feedback/error.rs (100%) rename {sidecar => larp}/src/mcts/feedback/feedback.rs (100%) rename {sidecar => larp}/src/mcts/feedback/mod.rs (100%) rename {sidecar => larp}/src/mcts/mod.rs (100%) rename {sidecar => larp}/src/mcts/selector/mod.rs (100%) rename {sidecar => larp}/src/mcts/selector/selector.rs (100%) rename {sidecar => larp}/src/mcts/selector/uct_score.rs (100%) rename {sidecar => larp}/src/mcts/value_function/error.rs (100%) rename {sidecar => larp}/src/mcts/value_function/mod.rs (100%) rename {sidecar => larp}/src/mcts/value_function/reward.rs (100%) rename {sidecar => larp}/src/repo/filesystem.rs (100%) rename {sidecar => larp}/src/repo/iterator.rs (100%) rename {sidecar => larp}/src/repo/mod.rs (100%) rename {sidecar => larp}/src/repo/state.rs (100%) rename {sidecar => larp}/src/repo/types.rs (100%) rename {sidecar => larp}/src/repomap/analyser.rs (100%) rename {sidecar => larp}/src/repomap/error.rs (100%) rename {sidecar => larp}/src/repomap/file/errors.rs (100%) rename {sidecar => larp}/src/repomap/file/git.rs (100%) rename {sidecar => larp}/src/repomap/file/mod.rs (100%) rename {sidecar => larp}/src/repomap/files.rs (100%) rename {sidecar => larp}/src/repomap/graph.rs (100%) rename {sidecar => larp}/src/repomap/helpers.rs (100%) rename {sidecar => larp}/src/repomap/mod.rs (100%) rename {sidecar => larp}/src/repomap/tag.rs (100%) rename {sidecar => larp}/src/repomap/tree_context.rs (100%) rename {sidecar => larp}/src/repomap/tree_walker.rs (100%) rename {sidecar => larp}/src/repomap/types.rs (100%) rename {sidecar => larp}/src/reporting/axflow/client.rs (100%) rename {sidecar => larp}/src/reporting/axflow/mod.rs (100%) rename {sidecar => larp}/src/reporting/mod.rs (100%) rename {sidecar => larp}/src/reporting/posthog/client.rs (100%) rename {sidecar => larp}/src/reporting/posthog/mod.rs (100%) rename {sidecar => larp}/src/reranking/mod.rs (100%) rename {sidecar => larp}/src/reranking/snippet_reranking.rs (100%) rename {sidecar => larp}/src/state/mod.rs (100%) rename {sidecar => larp}/src/state/schema_version.rs (100%) rename {sidecar => larp}/src/tree_printer/mod.rs (100%) rename {sidecar => larp}/src/tree_printer/tree.rs (100%) rename {sidecar => larp}/src/user_context/helpers.rs (100%) rename {sidecar => larp}/src/user_context/mod.rs (100%) rename {sidecar => larp}/src/user_context/types.rs (100%) rename {sidecar => larp}/src/webserver/agent.rs (100%) rename {sidecar => larp}/src/webserver/agent_stream.rs (100%) rename {sidecar => larp}/src/webserver/agentic.rs (100%) rename {sidecar => larp}/src/webserver/config.rs (100%) rename {sidecar => larp}/src/webserver/context_trimming.rs (100%) rename {sidecar => larp}/src/webserver/file_edit.rs (100%) rename {sidecar => larp}/src/webserver/health.rs (100%) rename {sidecar => larp}/src/webserver/in_line_agent.rs (100%) rename {sidecar => larp}/src/webserver/in_line_agent_stream.rs (100%) rename {sidecar => larp}/src/webserver/inline_completion.rs (100%) rename {sidecar => larp}/src/webserver/mod.rs (100%) rename {sidecar => larp}/src/webserver/model_selection.rs (100%) rename {sidecar => larp}/src/webserver/plan.rs (100%) rename {sidecar => larp}/src/webserver/tree_sitter.rs (100%) rename {sidecar => larp}/src/webserver/types.rs (100%) diff --git a/.clinerules b/.clinerules new file mode 100644 index 000000000..c93aeb944 --- /dev/null +++ b/.clinerules @@ -0,0 +1,541 @@ +# LARP .clinerules + +This file provides guidance for AI assistants working with the LARP codebase. It contains repository-specific patterns, conventions, and development processes to ensure generated code integrates seamlessly with the existing codebase. + +## Repository Structure + +LARP is organized as a Rust workspace with multiple crates, each with a specific responsibility: + +``` +larp/ # Main crate with core functionality +llm_client/ # LLM communication and provider integration +llm_prompts/ # Prompt generation and formatting +logging/ # Logging utilities +``` + +When working with this repository: +- Keep functionality in its appropriate crate +- Maintain the existing module structure +- Follow the established dependency hierarchy + +## Module Architecture + +### larp (Main Crate) + +The main crate contains these key modules: + +``` +larp/src/ +├── agent/ # Base agent functionality +├── agentic/ # Advanced agentic system +│ ├── memory/ # Memory management for agents +│ ├── symbol/ # Symbol management and tracking +│ └── tool/ # Tool implementations +├── application/ # Application core and configuration +├── chunking/ # Code parsing and chunking +├── git/ # Git integration +├── mcts/ # Monte Carlo Tree Search decision engine +├── repo/ # Repository management +├── repomap/ # Repository mapping and analysis +├── webserver/ # API endpoints +``` + +### llm_client (LLM Communication) + +``` +llm_client/src/ +├── clients/ # Provider-specific clients +├── format/ # Request/response formatting +├── tokenizer/ # Token counting and management +``` + +### llm_prompts (Prompt Generation) + +``` +llm_prompts/src/ +├── chat/ # Chat prompt generation +├── fim/ # Fill-in-middle prompt generation +├── in_line_edit/ # Inline editing prompt generation +├── reranking/ # Result reranking prompts +``` + +## Coding Patterns + +### 1. Broker Pattern + +The codebase uses a broker pattern extensively for managing multiple implementations: + +```rust +// Example broker pattern +pub struct LLMBroker { + clients: Arc>>, +} + +impl LLMBroker { + pub async fn new() -> anyhow::Result { + let clients = Arc::new(DashMap::new()); + // Register clients + Ok(Self { clients }) + } + + pub fn get_client(&self, llm_type: LLMType) -> Option { + // Get appropriate client + } +} +``` + +When adding new functionality that requires multiple implementations: +- Create a trait defining the interface +- Implement the trait for each specific case +- Create a broker that manages instances and routes requests + +### 2. Error Handling + +The project uses a combination of `anyhow` for general error handling and `thiserror` for defining specific error types: + +```rust +// For library functions that need to define error types: +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum MyError { + #[error("IO error: {0}")] + Io(#[from] std::io::Error), + + #[error("Invalid value: {0}")] + InvalidValue(String), +} + +// For application code, use anyhow: +use anyhow::{Result, Context}; + +fn do_something() -> Result<()> { + let file = std::fs::File::open("file.txt") + .context("Failed to open file.txt")?; + // More code... + Ok(()) +} +``` + +### 3. Asynchronous Programming + +The codebase uses Tokio for asynchronous operations: + +```rust +// Async function pattern +pub async fn process_request(&self, request: Request) -> Result { + // Asynchronous operations + let result = self.llm_client.generate_text(request.prompt).await?; + // Process result + Ok(Response { result }) +} +``` + +When implementing new functionality: +- Use `async`/`await` for I/O operations +- Leverage Tokio's utilities for concurrent processing +- Consider using `tokio::spawn` for background tasks + +### 4. Arc/Clone Pattern + +The codebase extensively uses `Arc` for shared ownership: + +```rust +// Arc pattern for shared components +pub struct Application { + config: Arc, + llm_broker: Arc, + // Other fields +} + +impl Application { + pub fn new() -> Self { + let config = Arc::new(Configuration::default()); + let llm_broker = Arc::new(LLMBroker::new().await?); + Self { config, llm_broker } + } +} +``` + +When designing new components: +- Use `Arc` for shared ownership across threads +- Implement `Clone` for types that need to be shared +- Consider using interior mutability patterns like `Mutex` or `RwLock` when shared mutable access is needed + +## LLM Integration + +### Adding a New LLM Provider + +1. Create a new client file in `llm_client/src/clients/` +2. Implement the `LLMClient` trait +3. Add the provider to the `LLMType` enum in `llm_client/src/clients/types.rs` +4. Register the provider in `LLMBroker::new()` + +Example pattern: + +```rust +// In llm_client/src/clients/new_provider.rs +pub struct NewProviderClient { + api_key: String, + client: reqwest::Client, +} + +impl NewProviderClient { + pub fn new(api_key: String) -> Self { + Self { + api_key, + client: reqwest::Client::new(), + } + } +} + +#[async_trait] +impl LLMClient for NewProviderClient { + async fn generate_text(&self, prompt: &str) -> Result { + // Implementation + } + + async fn generate_chat_completion(&self, messages: &[ChatMessage]) -> Result { + // Implementation + } +} + +// In llm_client/src/clients/types.rs +pub enum LLMType { + // Existing types + NewProvider, +} + +// In llm_client/src/broker.rs +impl LLMBroker { + pub async fn new() -> Result { + let clients = Arc::new(DashMap::new()); + + // Register existing clients + + // Register new client + clients.insert( + LLMType::NewProvider, + Box::new(NewProviderClient::new(get_api_key()?)) as Box, + ); + + Ok(Self { clients }) + } +} +``` + +## Tree-sitter Integration + +### Adding a New Language Parser + +1. Add the tree-sitter grammar dependency to `larp/Cargo.toml` +2. Create a new file in `larp/src/chunking/` for your language +3. Implement the parsing logic for your language +4. Register your language in `larp/src/chunking/languages.rs` + +Example pattern: + +```rust +// In larp/src/chunking/new_language.rs +pub fn parse_new_language(source: &str) -> Result> { + let mut parser = Parser::new(); + let language = tree_sitter_new_language(); + parser.set_language(language)?; + + let tree = parser.parse(source, None)?; + let root_node = tree.root_node(); + + let mut chunks = Vec::new(); + extract_chunks(root_node, source, &mut chunks)?; + + Ok(chunks) +} + +// In larp/src/chunking/languages.rs +pub fn get_parser_for_language(language: &str) -> Option { + match language { + // Existing languages + "new_language" => Some(parse_new_language), + _ => None, + } +} +``` + +## Agentic System + +### Adding a New Tool + +1. Create a new file in `larp/src/agentic/tool/` for your tool +2. Implement the `Tool` trait for your tool +3. Register your tool in the `ToolBox::new()` method + +Example pattern: + +```rust +// In larp/src/agentic/tool/new_tool.rs +pub struct NewTool { + // Tool state +} + +impl NewTool { + pub fn new() -> Self { + Self { /* initialize state */ } + } +} + +#[async_trait] +impl Tool for NewTool { + async fn execute(&self, params: ToolParams) -> Result { + // Tool implementation + Ok(ToolResult::new(/* result data */)) + } + + fn name(&self) -> &'static str { + "new_tool" + } + + fn description(&self) -> &'static str { + "Description of the new tool" + } +} + +// In larp/src/agentic/tool_box.rs +impl ToolBox { + pub fn new( + tool_broker: Arc, + symbol_tracker: Arc, + editor_parsing: Arc, + ) -> Self { + let mut tools = HashMap::new(); + + // Register existing tools + + // Register new tool + tools.insert( + "new_tool".to_string(), + Box::new(NewTool::new()) as Box, + ); + + Self { tools, tool_broker, symbol_tracker, editor_parsing } + } +} +``` + +## Testing Guidelines + +### Unit Tests + +Write unit tests in the same file as the code they're testing: + +```rust +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_functionality() { + // Test code + assert_eq!(function_under_test(input), expected_output); + } +} +``` + +### Integration Tests + +For integration tests, create files in the `tests/` directory: + +```rust +// In tests/integration_test.rs +use larp::{Component, AnotherComponent}; + +#[tokio::test] +async fn test_component_interaction() { + let component = Component::new(); + let another = AnotherComponent::new(); + + let result = component.interact_with(another).await; + assert!(result.is_ok()); +} +``` + +## Documentation + +### Function Documentation + +Document public functions with rustdoc comments: + +```rust +/// This function processes a request and returns a response. +/// +/// # Arguments +/// +/// * `request` - The request to process +/// +/// # Returns +/// +/// A result containing the response or an error +/// +/// # Errors +/// +/// Returns an error if the request is invalid or processing fails +/// +/// # Examples +/// +/// ``` +/// let response = process_request(request).await?; +/// ``` +pub async fn process_request(request: Request) -> Result { + // Implementation +} +``` + +### Module Documentation + +Document modules with module-level comments: + +```rust +//! This module provides functionality for processing requests. +//! +//! It includes functions for validating, transforming, and responding to requests. + +pub mod validation; +pub mod transformation; +pub mod response; +``` + +## Common Development Tasks + +### Adding a New Feature + +1. Create a new branch: `git checkout -b feature/feature-name` +2. Implement the feature +3. Add tests +4. Update documentation +5. Submit a pull request + +### Debugging + +Use the tracing macros for debugging: + +```rust +use tracing::{trace, debug, info, warn, error}; + +// Levels from most to least verbose +trace!("Very detailed information"); +debug!("Useful for debugging"); +info!("General information"); +warn!("Warning that might need attention"); +error!("Error that needs immediate attention"); +``` + +Set the log level using the `RUST_LOG` environment variable: + +```bash +RUST_LOG=debug cargo run --bin webserver +``` + +## Performance Considerations + +### Token Optimization + +When working with LLMs, optimize token usage: + +- Remove unnecessary whitespace and formatting +- Use targeted context pruning +- Cache frequently used prompts and responses + +### Caching + +Use caching where appropriate: + +```rust +// Example of a simple cache +struct Cache { + data: Arc>, + ttl: Duration, +} + +impl Cache { + fn new(ttl: Duration) -> Self { + Self { + data: Arc::new(DashMap::new()), + ttl, + } + } + + fn get(&self, key: &K) -> Option { + if let Some(entry) = self.data.get(key) { + let (value, timestamp) = entry.value(); + if timestamp.elapsed() < self.ttl { + return Some(value.clone()); + } + } + None + } + + fn insert(&self, key: K, value: V) { + self.data.insert(key, (value, Instant::now())); + } +} +``` + +### Parallel Processing + +Use Rayon for CPU-bound parallel processing: + +```rust +use rayon::prelude::*; + +// Sequential processing +let results: Vec<_> = items.iter().map(|item| process_item(item)).collect(); + +// Parallel processing +let results: Vec<_> = items.par_iter().map(|item| process_item(item)).collect(); +``` + +## Git Workflow + +### Commit Messages + +Format commit messages with a clear title and detailed description: + +``` +feat: Add support for new LLM provider + +- Implement client for new provider +- Add provider to LLMType enum +- Register provider in LLMBroker +- Add tests for the new provider +``` + +Use prefixes like: +- `feat:` for new features +- `fix:` for bug fixes +- `docs:` for documentation changes +- `refactor:` for code refactoring +- `test:` for adding or updating tests +- `chore:` for maintenance tasks + +### Branch Naming + +Name branches according to their purpose: +- `feature/feature-name` for new features +- `bugfix/issue-description` for bug fixes +- `refactor/component-name` for code refactoring +- `docs/documentation-description` for documentation updates + +## Security Considerations + +### API Key Management + +Handle API keys securely: +- Never hardcode API keys +- Use environment variables or secure configuration files +- Log errors without exposing sensitive information + +### Input Validation + +Validate all inputs, especially those from external sources: +- Check for malicious input patterns +- Validate file paths to prevent path traversal +- Sanitize inputs before using them in commands or queries diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a4d6e1f87..2dc2c7c6b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Build & release sidecar +name: Build & release larp on: workflow_dispatch: @@ -166,9 +166,9 @@ jobs: # Create zip file Push-Location staging if ($env:RUNNER_OS -eq "Windows") { - Compress-Archive -Path * -DestinationPath ../sidecar.zip -Force + Compress-Archive -Path * -DestinationPath ../larp.zip -Force } else { - zip -r ../sidecar.zip . + zip -r ../larp.zip . } Pop-Location @@ -211,16 +211,16 @@ jobs: echo "ARCH: ${ARCH}" echo "CARGO_PKG_VERSION: ${CARGO_PKG_VERSION}" - SPECIFIC_VERSION_PATH="${CARGO_PKG_VERSION}/${OS_NAME}/${ARCH}/sidecar.zip" - LATEST_VERSION_PATH="latest/${OS_NAME}/${ARCH}/sidecar.zip" + SPECIFIC_VERSION_PATH="${CARGO_PKG_VERSION}/${OS_NAME}/${ARCH}/larp.zip" + LATEST_VERSION_PATH="latest/${OS_NAME}/${ARCH}/larp.zip" echo "Paths:" echo "SPECIFIC_VERSION_PATH: ${SPECIFIC_VERSION_PATH}" echo "LATEST_VERSION_PATH: ${LATEST_VERSION_PATH}" # Verify file exists - ls -l "./sidecar.zip" + ls -l "./larp.zip" # Copy with verbose flag - gsutil cp "./sidecar.zip" "gs://sidecar-bin/${SPECIFIC_VERSION_PATH}" - gsutil cp "./sidecar.zip" "gs://sidecar-bin/${LATEST_VERSION_PATH}" + gsutil cp "./larp.zip" "gs://larp-bin/${SPECIFIC_VERSION_PATH}" + gsutil cp "./larp.zip" "gs://larp-bin/${LATEST_VERSION_PATH}" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef5592049..2ebbffbd4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ -# Contributing to Sidecar +# Contributing to LARP -Welcome, and thank you for your interest in contributing to Sidecar! +Welcome, and thank you for your interest in contributing to LARP! There are several ways in which you can contribute, beyond writing code. The goal of this document is to provide a high-level overview of how you can get involved. ## Contributing Fixes -If you are interested in writing code to fix issues, please see [How to Contribute](https://github.com/codestoryai/sidecar/blob/main/HOW_TO_CONTRIBUTE.md.md). +If you are interested in writing code to fix issues, please see [How to Contribute](https://github.com/codestoryai/larp/blob/main/HOW_TO_CONTRIBUTE.md.md). ## Asking Questions @@ -17,7 +17,7 @@ Have a question? The [Aide Discord](https://discord.gg/mtgrhXM5Xf) is a communit Your comments and feedback are welcome, and the development team is available via a handful of different channels. ### GitHub issues -[GitHub issues](https://github.com/codestoryai/sidecar/issues) should be used for bugs and feature requests. How to submit good bugs and feature requests is described in [How to Contribute](https://github.com/codestoryai/sidecar/blob/main/HOW_TO_CONTRIBUTE.md) and how we track issues is described in [[Issue Tracking]]. +[GitHub issues](https://github.com/codestoryai/larp/issues) should be used for bugs and feature requests. How to submit good bugs and feature requests is described in [How to Contribute](https://github.com/codestoryai/larp/blob/main/HOW_TO_CONTRIBUTE.md) and how we track issues is described in [[Issue Tracking]]. ### Discord As mentioned above, the [Aide Discord](https://discord.gg/mtgrhXM5Xf) has the development team available to look at your feedback. If there is an action to be tracked, an issue will be created on GitHub for providing visibility into the status of the feedback. @@ -39,7 +39,7 @@ The Aide project is distributed across multiple repositories. Try to file the is |Component|Repository| |---|---| |The Aide code editor|[aide](https://github.com/codestoryai/aide)| -|AI sidecar|[sidecar](https://github.com/codestoryai/sidecar)| +|AI LARP|[larp](https://github.com/codestoryai/larp)| #### Maintained by the VSCode team We regularly pull changes from the VSCode project into Aide, so issues reported here when fixed will automatically be included in Aide. But if the fix is urgent and important, just file them under the [aide](https://github.com/codestoryai/aide) repository and we will follow up as required. @@ -99,7 +99,7 @@ Please include the following with each issue: ### Creating Pull Requests -* Please refer to the article on [creating pull requests](https://github.com/codestoryai/sidecar/blob/main/HOW_TO_CONTRIBUTE.md.md#pull-requests) and contributing to this project. +* Please refer to the article on [creating pull requests](https://github.com/codestoryai/larp/blob/main/HOW_TO_CONTRIBUTE.md.md#pull-requests) and contributing to this project. ### Final Checklist @@ -113,4 +113,4 @@ Don't feel bad if the developers can't reproduce the issue right away. They will ## Thank You -Your contributions to open source, large or small, make projects like this possible. Thank you for taking the time to contribute. \ No newline at end of file +Your contributions to open source, large or small, make projects like this possible. Thank you for taking the time to contribute. diff --git a/Cargo.toml b/Cargo.toml index b508edef5..85349705a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "sidecar", + "larp", "llm_client", "llm_prompts", "logging", @@ -8,4 +8,4 @@ members = [ resolver = "2" [profile.release] -lto = "thin" \ No newline at end of file +lto = "thin" diff --git a/HOW_TO_CONTRIBUTE.md b/HOW_TO_CONTRIBUTE.md index 0576ec859..d363db2fb 100644 --- a/HOW_TO_CONTRIBUTE.md +++ b/HOW_TO_CONTRIBUTE.md @@ -1,12 +1,12 @@ -# Contributing to Sidecar -There are many ways to contribute to Sidecar: logging bugs, submitting pull requests, reporting issues, and creating suggestions. +# Contributing to LARP +There are many ways to contribute to LARP: logging bugs, submitting pull requests, reporting issues, and creating suggestions. -After cloning and building the repo, check out the [issues list](https://github.com/codestoryai/sidecar/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue). Issues labeled [`help wanted`](https://github.com/codestoryai/sidecar/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are good issues to submit a PR for. Issues labeled [`good first issue`](https://github.com/codestoryai/sidecar/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) are great candidates to pick up if you are in the code for the first time. If you are contributing significant changes, or if the issue is already assigned to a specific month milestone, please discuss with the assignee of the issue first before starting to work on the issue. +After cloning and building the repo, check out the [issues list](https://github.com/codestoryai/larp/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue). Issues labeled [`help wanted`](https://github.com/codestoryai/larp/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are good issues to submit a PR for. Issues labeled [`good first issue`](https://github.com/codestoryai/larp/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) are great candidates to pick up if you are in the code for the first time. If you are contributing significant changes, or if the issue is already assigned to a specific month milestone, please discuss with the assignee of the issue first before starting to work on the issue. ## How to build locally 1. Ensure you are using Rust 1.73 2. Build the binary: `cargo build --bin webserver` -3. Run the binary: `./target/debug/webserver --qdrant-binary-directory ./sidecar/qdrant --dylib-directory ./sidecar/onnxruntime/ --model-dir ./sidecar/models/all-MiniLM-L6-v2/ --qdrant-url http://127.0.0.1:6334` +3. Run the binary: `./target/debug/webserver --qdrant-binary-directory ./larp/qdrant --dylib-directory ./larp/onnxruntime/ --model-dir ./larp/models/all-MiniLM-L6-v2/ --qdrant-url http://127.0.0.1:6334` 4. Profit! ## Your own ideas @@ -15,7 +15,7 @@ If you want a new feature or want to change something, please reach out to us on ## Debugging The best way to debug is cowboy style, put print statments and check if your code is hitting the right branch and doing the right things. -Since you will be working on the debug build of the sidecar, iteration cycles are fast, just run `cargo buid --bin webserver` and you should see the log spam on stdout. +Since you will be working on the debug build of the larp, iteration cycles are fast, just run `cargo buid --bin webserver` and you should see the log spam on stdout. ## Pull Requests -We use the [GitHub flow](https://guides.github.com/introduction/flow/) for pull requests. This means that you should fork the repo, create a branch, make your changes, and then create a pull request. We will review your PR and provide feedback. Once the PR is approved, we will merge it into the main branch. \ No newline at end of file +We use the [GitHub flow](https://guides.github.com/introduction/flow/) for pull requests. This means that you should fork the repo, create a branch, make your changes, and then create a pull request. We will review your PR and provide feedback. Once the PR is approved, we will merge it into the main branch. diff --git a/KNOWLEDGE_GRAPH.md b/KNOWLEDGE_GRAPH.md index e8d8fad5d..3f3fbc097 100644 --- a/KNOWLEDGE_GRAPH.md +++ b/KNOWLEDGE_GRAPH.md @@ -1,27 +1,27 @@ -# Sidecar Knowledge Graph +# LARP Knowledge Graph -This document provides a comprehensive knowledge graph of the Sidecar codebase, showing the relationships between different components and modules. +This document provides a comprehensive knowledge graph of the LARP codebase, showing the relationships between different components and modules. ## Repository Structure ```mermaid graph TD - Root["/ (Root)"] --> Sidecar["sidecar/"] + Root["/ (Root)"] --> LARP["larp/"] Root --> LLMClient["llm_client/"] Root --> LLMPrompts["llm_prompts/"] Root --> Logging["logging/"] - Sidecar --> SrcSidecar["src/"] - SrcSidecar --> Webserver["webserver/"] - SrcSidecar --> MCTS["mcts/"] - SrcSidecar --> Agentic["agentic/"] - SrcSidecar --> Repomap["repomap/"] - SrcSidecar --> LLM["llm/"] - SrcSidecar --> Repo["repo/"] - SrcSidecar --> Chunking["chunking/"] - SrcSidecar --> Agent["agent/"] - SrcSidecar --> Git["git/"] - SrcSidecar --> Bin["bin/"] + LARP --> SrcLARP["src/"] + SrcLARP --> Webserver["webserver/"] + SrcLARP --> MCTS["mcts/"] + SrcLARP --> Agentic["agentic/"] + SrcLARP --> Repomap["repomap/"] + SrcLARP --> LLM["llm/"] + SrcLARP --> Repo["repo/"] + SrcLARP --> Chunking["chunking/"] + SrcLARP --> Agent["agent/"] + SrcLARP --> Git["git/"] + SrcLARP --> Bin["bin/"] LLMClient --> SrcLLM["src/"] SrcLLM --> Clients["clients/"] @@ -40,9 +40,9 @@ graph TD ```mermaid graph TD - Sidecar["sidecar"] --> LLMClient["llm_client"] - Sidecar --> LLMPrompts["llm_prompts"] - Sidecar --> Logging["logging"] + LARP["larp"] --> LLMClient["llm_client"] + LARP --> LLMPrompts["llm_prompts"] + LARP --> Logging["logging"] LLMPrompts --> LLMClient Logging --> LLMClient ``` @@ -402,7 +402,7 @@ sequenceDiagram ```mermaid mindmap - root((Sidecar)) + root((LARP)) Application Configuration Repository Pool @@ -466,4 +466,4 @@ graph TD ## Conclusion -This knowledge graph provides a comprehensive view of the Sidecar codebase structure and relationships between different components. It should help developers understand how the various parts of the system interact and how data flows through the application. \ No newline at end of file +This knowledge graph provides a comprehensive view of the LARP codebase structure and relationships between different components. It should help developers understand how the various parts of the system interact and how data flows through the application. diff --git a/README.md b/README.md index e195a7e07..6d6e4da91 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,45 @@ ``` - - ██████╗ ██████╗ ██████╗ ███████╗███████╗████████╗ ██████╗ ██████╗ ██╗ ██╗ -██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝ -██║ ██║ ██║██║ ██║█████╗ ███████╗ ██║ ██║ ██║██████╔╝ ╚████╔╝ -██║ ██║ ██║██║ ██║██╔══╝ ╚════██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝ -╚██████╗╚██████╔╝██████╔╝███████╗███████║ ██║ ╚██████╔╝██║ ██║ ██║ - ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ - +▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▓▓▓▓▒▒▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ +▓▓▓▓▓▒▓▒▓▒▒▓▓▓▓█████▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▓ +▓▓▓▒▒▒▒▒▒▓▓███████████▓▓██▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒ +▓▒▒▓▒▒▒▓██████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒ +▓▒▒▒▒▒▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒ +▓▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒ +▓▒▒▒▓▓▓▓▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒ +▓▒▒▒▓▓▓▒▓▓▓▓▓▓▓▓▓▓▓███▓▓▓▒▒▓▓▓███▓▓▓▓▓▒▒▒▒ +▓▒▒▒▓▓▒▒▓▓▓▓▓▓▓▓▓█▒▒░░░░░░░░░░░░░▒█▒▓▓▒▒▒▒ +▓▒▒▒▓▓▒▒▓██▓▓▓▓█▒░░░░░░░░░░░░░▓██▓░░░▒▒▒▒▒ +▓▒▒▓▓▓▒▓▓▓▓▓░░░░░▓▓█▓░░░░░░░░▒█░██▓░░░▒░▒▒ +▓▒▒▓▓▒▓▓▓▒▒░░░░░██▓███▓░░░░░░█████░░░░░░░▒ +▓▒▒▓▓░░░░░░░░░░▓▒█████▓░░░░░░▒███▒░░░░░░░▒ +██▓▓▓▒░░░░░░░░░░░▓███▓▒░░░░░░░░░▒░░░▒▒▒▒▒▒ +███▓▓▓▓▒░░░░░░░░░░▒█▒░░░░░░░░░░░░░▒▓▒▓▓▓▒▒ +████▓▓▓▓██▓▒░░░░░░░░░░░░░░░▒░░░░░▒▓▒▓▓▓▓▓▓ +███████▓▓██████▓▒░░░░░░░░░░░░░░▒▓▓████████ +████████▓▓▓████████▓▒░░░░░░▒▓▓▓▓▓▓████████ +███████████▓▓██████▓▓▓▓▓▓▓▓███████████████ +███████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████ +██████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████ +█████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████ +█████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███████ + + + ``` ![Latest release](https://img.shields.io/github/v/release/codestoryai/binaries?label=version) ![Discord Shield](https://discord.com/api/guilds/1138070673756004464/widget.png?style=shield) -# Sidecar: The AI Brain for Aide Editor +# LARP: The AI Brain for Aide Editor ## Overview -Sidecar is the AI intelligence engine that powers the Aide code editor. It handles everything from prompt creation and LLM communication to code analysis and intelligent editing assistance. This repository contains the core AI functionality that enables Aide to understand and interact with your codebase at a deep level. +LARP is the AI intelligence engine that powers the Aide code editor. It handles everything from prompt creation and LLM communication to code analysis and intelligent editing assistance. This repository contains the core AI functionality that enables Aide to understand and interact with your codebase at a deep level. ## Table of Contents @@ -40,7 +58,7 @@ Sidecar is the AI intelligence engine that powers the Aide code editor. It handl ## Architecture -Sidecar is built as a Rust workspace with multiple crates that work together to provide AI-powered code assistance. The architecture follows a modular design with clear separation of concerns. +LARP is built as a Rust workspace with multiple crates that work together to provide AI-powered code assistance. The architecture follows a modular design with clear separation of concerns. ```mermaid flowchart TD @@ -82,15 +100,15 @@ sequenceDiagram ## Core Components -Sidecar consists of several key components that work together: +LARP consists of several key components that work together: ### 1. Webserver The entry point for the application, handling HTTP requests from the Aide editor. It provides API endpoints for various AI-assisted operations. **Key Files:** -- `sidecar/src/bin/webserver.rs`: Main entry point -- `sidecar/src/webserver/mod.rs`: API route definitions +- `larp/src/bin/webserver.rs`: Main entry point +- `larp/src/webserver/mod.rs`: API route definitions ### 2. LLM Client @@ -147,12 +165,12 @@ Parses and chunks code into meaningful segments for better understanding by LLMs ```mermaid graph TD subgraph Workspace - Sidecar["sidecar (Main Crate)"] --- LLMClient["llm_client"] - Sidecar --- LLMPrompts["llm_prompts"] - Sidecar --- Logging["logging"] + LARP["larp (Main Crate)"] --- LLMClient["llm_client"] + LARP --- LLMPrompts["llm_prompts"] + LARP --- Logging["logging"] end - subgraph SidecarComponents + subgraph LARPComponents Webserver["webserver"] --- Application["application"] Application --- Agentic["agentic"] Application --- MCTS["mcts"] @@ -175,7 +193,7 @@ graph TD Broker --- Tokenizer["tokenizer"] end - Sidecar --- SidecarComponents + LARP --- LARPComponents Agentic --- AgenticComponents LLMClient --- LLMComponents ``` @@ -241,8 +259,8 @@ classDiagram 1. Clone the repository: ```bash - git clone https://github.com/codestoryai/sidecar.git - cd sidecar + git clone https://github.com/codestoryai/larp.git + cd larp ``` 2. Build the project: @@ -257,7 +275,7 @@ classDiagram ### Configuration -Sidecar can be configured through command-line arguments or environment variables. Key configuration options include: +LARP can be configured through command-line arguments or environment variables. Key configuration options include: - LLM provider API keys - Port and host settings @@ -268,22 +286,22 @@ Sidecar can be configured through command-line arguments or environment variable ```mermaid graph TD - Root["/ (Root)"] --> Sidecar["sidecar/"] + Root["/ (Root)"] --> LARP["larp/"] Root --> LLMClient["llm_client/"] Root --> LLMPrompts["llm_prompts/"] Root --> Logging["logging/"] - Sidecar --> SrcSidecar["src/"] - SrcSidecar --> Webserver["webserver/"] - SrcSidecar --> MCTS["mcts/"] - SrcSidecar --> Agentic["agentic/"] - SrcSidecar --> Repomap["repomap/"] - SrcSidecar --> LLM["llm/"] - SrcSidecar --> Repo["repo/"] - SrcSidecar --> Chunking["chunking/"] - SrcSidecar --> Agent["agent/"] - SrcSidecar --> Git["git/"] - SrcSidecar --> Bin["bin/"] + LARP --> SrcLARP["src/"] + SrcLARP --> Webserver["webserver/"] + SrcLARP --> MCTS["mcts/"] + SrcLARP --> Agentic["agentic/"] + SrcLARP --> Repomap["repomap/"] + SrcLARP --> LLM["llm/"] + SrcLARP --> Repo["repo/"] + SrcLARP --> Chunking["chunking/"] + SrcLARP --> Agent["agent/"] + SrcLARP --> Git["git/"] + SrcLARP --> Bin["bin/"] LLMClient --> SrcLLM["src/"] SrcLLM --> Clients["clients/"] @@ -302,7 +320,7 @@ graph TD ### Symbol-Level Intelligence -Sidecar can understand and operate on individual code symbols (functions, classes, variables) with context awareness. +LARP can understand and operate on individual code symbols (functions, classes, variables) with context awareness. ### Repository Mapping @@ -330,16 +348,16 @@ Uses MCTS to explore possible code changes and select the most promising ones fo ## Integration with Aide -Sidecar is designed to work seamlessly with the Aide editor. To connect your local Sidecar instance with Aide: +LARP is designed to work seamlessly with the Aide editor. To connect your local LARP instance with Aide: 1. Run the Aide production build or build from source using [this repository](https://github.com/codestoryai/ide) -2. Run the sidecar binary -3. Since you have a sidecar binary already running, the editor will prefer to use this over starting its own process -4. Congratulations! You are now running sidecar for Aide locally with your own built binary +2. Run the larp binary +3. Since you have a larp binary already running, the editor will prefer to use this over starting its own process +4. Congratulations! You are now running larp for Aide locally with your own built binary ## Feature Ideas -Here are 10 creative and easy-to-implement ideas for enhancing Sidecar: +Here are 10 creative and easy-to-implement ideas for enhancing LARP: 1. **Language-Specific Documentation Generator**: Automatically generate documentation comments based on code analysis and best practices for each language. @@ -365,8 +383,8 @@ Here are 10 creative and easy-to-implement ideas for enhancing Sidecar: There are many ways in which you can participate in this project, for example: -- [Submit bugs and feature requests](https://github.com/codestoryai/sidecar/issues), and help us verify as they are checked in -- Review [source code changes](https://github.com/codestoryai/sidecar/pulls) +- [Submit bugs and feature requests](https://github.com/codestoryai/larp/issues), and help us verify as they are checked in +- Review [source code changes](https://github.com/codestoryai/larp/pulls) If you are interested in fixing issues and contributing directly to the code base, please see the document [How to Contribute](HOW_TO_CONTRIBUTE.md), which covers the following: @@ -377,9 +395,9 @@ please see the document [How to Contribute](HOW_TO_CONTRIBUTE.md), which covers ## Feedback -- [File an issue](https://github.com/codestoryai/sidecar/issues) +- [File an issue](https://github.com/codestoryai/larp/issues) - [Request a new feature](CONTRIBUTING.md) -- Upvote [popular feature requests](https://github.com/codestoryai/sidecar/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) +- Upvote [popular feature requests](https://github.com/codestoryai/larp/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) - Join our community: [Discord](https://discord.gg/mtgrhXM5Xf) ## Code of Conduct diff --git a/sidecar/.sqlx/query-0676ed471d90bb7a44ae5103ee27a1ce055297aa4c7e405b1a27710ca6ec9b47.json b/larp/.sqlx/query-0676ed471d90bb7a44ae5103ee27a1ce055297aa4c7e405b1a27710ca6ec9b47.json similarity index 100% rename from sidecar/.sqlx/query-0676ed471d90bb7a44ae5103ee27a1ce055297aa4c7e405b1a27710ca6ec9b47.json rename to larp/.sqlx/query-0676ed471d90bb7a44ae5103ee27a1ce055297aa4c7e405b1a27710ca6ec9b47.json diff --git a/sidecar/.sqlx/query-0c459e4ff404b1f3c750a333c83f33830eadc9e058d759c1375c2ed09f032d9d.json b/larp/.sqlx/query-0c459e4ff404b1f3c750a333c83f33830eadc9e058d759c1375c2ed09f032d9d.json similarity index 100% rename from sidecar/.sqlx/query-0c459e4ff404b1f3c750a333c83f33830eadc9e058d759c1375c2ed09f032d9d.json rename to larp/.sqlx/query-0c459e4ff404b1f3c750a333c83f33830eadc9e058d759c1375c2ed09f032d9d.json diff --git a/sidecar/.sqlx/query-3e6c5db070ccc0ce144734375adb2883b14f1a039e86ca17cdc128c754bcd798.json b/larp/.sqlx/query-3e6c5db070ccc0ce144734375adb2883b14f1a039e86ca17cdc128c754bcd798.json similarity index 100% rename from sidecar/.sqlx/query-3e6c5db070ccc0ce144734375adb2883b14f1a039e86ca17cdc128c754bcd798.json rename to larp/.sqlx/query-3e6c5db070ccc0ce144734375adb2883b14f1a039e86ca17cdc128c754bcd798.json diff --git a/sidecar/.sqlx/query-444d3d341830d2001e5ec4f891c648b66c9ed54602a67213d7b2610ab024e5be.json b/larp/.sqlx/query-444d3d341830d2001e5ec4f891c648b66c9ed54602a67213d7b2610ab024e5be.json similarity index 100% rename from sidecar/.sqlx/query-444d3d341830d2001e5ec4f891c648b66c9ed54602a67213d7b2610ab024e5be.json rename to larp/.sqlx/query-444d3d341830d2001e5ec4f891c648b66c9ed54602a67213d7b2610ab024e5be.json diff --git a/sidecar/.sqlx/query-44cffc24222af81e1f1840a4d4ff3540f8c35c139ac87b800436d6b2c8e13622.json b/larp/.sqlx/query-44cffc24222af81e1f1840a4d4ff3540f8c35c139ac87b800436d6b2c8e13622.json similarity index 100% rename from sidecar/.sqlx/query-44cffc24222af81e1f1840a4d4ff3540f8c35c139ac87b800436d6b2c8e13622.json rename to larp/.sqlx/query-44cffc24222af81e1f1840a4d4ff3540f8c35c139ac87b800436d6b2c8e13622.json diff --git a/sidecar/.sqlx/query-4f6ba2705c2e2b4ace7276fddf2d24e38f2a1d0e25ef50fa7cebf69ac9dd3ee1.json b/larp/.sqlx/query-4f6ba2705c2e2b4ace7276fddf2d24e38f2a1d0e25ef50fa7cebf69ac9dd3ee1.json similarity index 100% rename from sidecar/.sqlx/query-4f6ba2705c2e2b4ace7276fddf2d24e38f2a1d0e25ef50fa7cebf69ac9dd3ee1.json rename to larp/.sqlx/query-4f6ba2705c2e2b4ace7276fddf2d24e38f2a1d0e25ef50fa7cebf69ac9dd3ee1.json diff --git a/sidecar/.sqlx/query-6130131a3676914fdd208b8bd881556b9c67b0449c51a20480d45f3bce1c6bb4.json b/larp/.sqlx/query-6130131a3676914fdd208b8bd881556b9c67b0449c51a20480d45f3bce1c6bb4.json similarity index 100% rename from sidecar/.sqlx/query-6130131a3676914fdd208b8bd881556b9c67b0449c51a20480d45f3bce1c6bb4.json rename to larp/.sqlx/query-6130131a3676914fdd208b8bd881556b9c67b0449c51a20480d45f3bce1c6bb4.json diff --git a/sidecar/.sqlx/query-72547e044b212649ae39530386126d0409fcf15942eea73fda0c48dd328612bc.json b/larp/.sqlx/query-72547e044b212649ae39530386126d0409fcf15942eea73fda0c48dd328612bc.json similarity index 100% rename from sidecar/.sqlx/query-72547e044b212649ae39530386126d0409fcf15942eea73fda0c48dd328612bc.json rename to larp/.sqlx/query-72547e044b212649ae39530386126d0409fcf15942eea73fda0c48dd328612bc.json diff --git a/sidecar/.sqlx/query-7ad623e2dfdc2796c7ed26d71c53fa03e7df67f03ee55a364440cfdf1844028e.json b/larp/.sqlx/query-7ad623e2dfdc2796c7ed26d71c53fa03e7df67f03ee55a364440cfdf1844028e.json similarity index 100% rename from sidecar/.sqlx/query-7ad623e2dfdc2796c7ed26d71c53fa03e7df67f03ee55a364440cfdf1844028e.json rename to larp/.sqlx/query-7ad623e2dfdc2796c7ed26d71c53fa03e7df67f03ee55a364440cfdf1844028e.json diff --git a/sidecar/.sqlx/query-7efe113a4a28d2f473d9ce4ad31f36a702400f0ba77fabdf255bdc87d4ce5db8.json b/larp/.sqlx/query-7efe113a4a28d2f473d9ce4ad31f36a702400f0ba77fabdf255bdc87d4ce5db8.json similarity index 100% rename from sidecar/.sqlx/query-7efe113a4a28d2f473d9ce4ad31f36a702400f0ba77fabdf255bdc87d4ce5db8.json rename to larp/.sqlx/query-7efe113a4a28d2f473d9ce4ad31f36a702400f0ba77fabdf255bdc87d4ce5db8.json diff --git a/sidecar/.sqlx/query-7f63260645b3afdce1c5864bd1d588f455d1e83196274ac7af2fa81fc5815e47.json b/larp/.sqlx/query-7f63260645b3afdce1c5864bd1d588f455d1e83196274ac7af2fa81fc5815e47.json similarity index 100% rename from sidecar/.sqlx/query-7f63260645b3afdce1c5864bd1d588f455d1e83196274ac7af2fa81fc5815e47.json rename to larp/.sqlx/query-7f63260645b3afdce1c5864bd1d588f455d1e83196274ac7af2fa81fc5815e47.json diff --git a/sidecar/.sqlx/query-89e8a76436d3395071a2cf5608804c8a2c7ebc9d73bde890f3a2ff79b2ebf309.json b/larp/.sqlx/query-89e8a76436d3395071a2cf5608804c8a2c7ebc9d73bde890f3a2ff79b2ebf309.json similarity index 100% rename from sidecar/.sqlx/query-89e8a76436d3395071a2cf5608804c8a2c7ebc9d73bde890f3a2ff79b2ebf309.json rename to larp/.sqlx/query-89e8a76436d3395071a2cf5608804c8a2c7ebc9d73bde890f3a2ff79b2ebf309.json diff --git a/sidecar/.sqlx/query-97071b9b0962066b8c853f7915e513eabd30c50fd8293b0e11be374806745b87.json b/larp/.sqlx/query-97071b9b0962066b8c853f7915e513eabd30c50fd8293b0e11be374806745b87.json similarity index 100% rename from sidecar/.sqlx/query-97071b9b0962066b8c853f7915e513eabd30c50fd8293b0e11be374806745b87.json rename to larp/.sqlx/query-97071b9b0962066b8c853f7915e513eabd30c50fd8293b0e11be374806745b87.json diff --git a/sidecar/.sqlx/query-9f862a56e79cc9ae6e9b896064a0057335b40225be0a8c8d29d9227de12ae364.json b/larp/.sqlx/query-9f862a56e79cc9ae6e9b896064a0057335b40225be0a8c8d29d9227de12ae364.json similarity index 100% rename from sidecar/.sqlx/query-9f862a56e79cc9ae6e9b896064a0057335b40225be0a8c8d29d9227de12ae364.json rename to larp/.sqlx/query-9f862a56e79cc9ae6e9b896064a0057335b40225be0a8c8d29d9227de12ae364.json diff --git a/sidecar/.sqlx/query-c93e42c9c10c0b79ff7d376f3fd318ad6859a0efa42359ecbcaeb568684df4ce.json b/larp/.sqlx/query-c93e42c9c10c0b79ff7d376f3fd318ad6859a0efa42359ecbcaeb568684df4ce.json similarity index 100% rename from sidecar/.sqlx/query-c93e42c9c10c0b79ff7d376f3fd318ad6859a0efa42359ecbcaeb568684df4ce.json rename to larp/.sqlx/query-c93e42c9c10c0b79ff7d376f3fd318ad6859a0efa42359ecbcaeb568684df4ce.json diff --git a/sidecar/.sqlx/query-de4f91107148e44a1650f38f1d905e5d71b63fff588a556886fb19cb9401b1f3.json b/larp/.sqlx/query-de4f91107148e44a1650f38f1d905e5d71b63fff588a556886fb19cb9401b1f3.json similarity index 100% rename from sidecar/.sqlx/query-de4f91107148e44a1650f38f1d905e5d71b63fff588a556886fb19cb9401b1f3.json rename to larp/.sqlx/query-de4f91107148e44a1650f38f1d905e5d71b63fff588a556886fb19cb9401b1f3.json diff --git a/sidecar/.sqlx/query-e192b80fb4fc47e4822f921270e27f04d978b8296615aba7d87532f6fe4a093f.json b/larp/.sqlx/query-e192b80fb4fc47e4822f921270e27f04d978b8296615aba7d87532f6fe4a093f.json similarity index 100% rename from sidecar/.sqlx/query-e192b80fb4fc47e4822f921270e27f04d978b8296615aba7d87532f6fe4a093f.json rename to larp/.sqlx/query-e192b80fb4fc47e4822f921270e27f04d978b8296615aba7d87532f6fe4a093f.json diff --git a/sidecar/.sqlx/query-e38351a13cf68acb87afc8b5c244cfe29dade7112fdd4b68c6105b23168b1970.json b/larp/.sqlx/query-e38351a13cf68acb87afc8b5c244cfe29dade7112fdd4b68c6105b23168b1970.json similarity index 100% rename from sidecar/.sqlx/query-e38351a13cf68acb87afc8b5c244cfe29dade7112fdd4b68c6105b23168b1970.json rename to larp/.sqlx/query-e38351a13cf68acb87afc8b5c244cfe29dade7112fdd4b68c6105b23168b1970.json diff --git a/sidecar/.sqlx/query-ed6379e37c16064198f48dbfb91899d74eb346533e3c9ab3814ba67b68d71f51.json b/larp/.sqlx/query-ed6379e37c16064198f48dbfb91899d74eb346533e3c9ab3814ba67b68d71f51.json similarity index 100% rename from sidecar/.sqlx/query-ed6379e37c16064198f48dbfb91899d74eb346533e3c9ab3814ba67b68d71f51.json rename to larp/.sqlx/query-ed6379e37c16064198f48dbfb91899d74eb346533e3c9ab3814ba67b68d71f51.json diff --git a/sidecar/Cargo.toml b/larp/Cargo.toml similarity index 98% rename from sidecar/Cargo.toml rename to larp/Cargo.toml index 2fa6bc7c2..346c01d15 100644 --- a/sidecar/Cargo.toml +++ b/larp/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "sidecar" +name = "larp" version = "0.1.35" edition = "2021" build = "build.rs" @@ -97,4 +97,4 @@ fs_extra = "1.3.0" blake3 = "1.4.0" phf_codegen = "0.11.2" serde = {version = "1.0.188", features = ["derive"]} -serde_yaml = "0.9.25" \ No newline at end of file +serde_yaml = "0.9.25" diff --git a/sidecar/build.rs b/larp/build.rs similarity index 100% rename from sidecar/build.rs rename to larp/build.rs diff --git a/sidecar/codestory.db b/larp/codestory.db similarity index 100% rename from sidecar/codestory.db rename to larp/codestory.db diff --git a/sidecar/languages.yml b/larp/languages.yml similarity index 100% rename from sidecar/languages.yml rename to larp/languages.yml diff --git a/sidecar/migrations/20231001175730_tantivy_cache.sql b/larp/migrations/20231001175730_tantivy_cache.sql similarity index 100% rename from sidecar/migrations/20231001175730_tantivy_cache.sql rename to larp/migrations/20231001175730_tantivy_cache.sql diff --git a/sidecar/migrations/20231004205514_file_cache.sql b/larp/migrations/20231004205514_file_cache.sql similarity index 100% rename from sidecar/migrations/20231004205514_file_cache.sql rename to larp/migrations/20231004205514_file_cache.sql diff --git a/sidecar/migrations/20231008042845_agent_events.sql b/larp/migrations/20231008042845_agent_events.sql similarity index 100% rename from sidecar/migrations/20231008042845_agent_events.sql rename to larp/migrations/20231008042845_agent_events.sql diff --git a/sidecar/migrations/20231009130619_agent_conversation_message.sql b/larp/migrations/20231009130619_agent_conversation_message.sql similarity index 100% rename from sidecar/migrations/20231009130619_agent_conversation_message.sql rename to larp/migrations/20231009130619_agent_conversation_message.sql diff --git a/sidecar/migrations/20231014173633_code_snippet_cache.sql b/larp/migrations/20231014173633_code_snippet_cache.sql similarity index 100% rename from sidecar/migrations/20231014173633_code_snippet_cache.sql rename to larp/migrations/20231014173633_code_snippet_cache.sql diff --git a/sidecar/migrations/20231016135924_git_log_statistics.sql b/larp/migrations/20231016135924_git_log_statistics.sql similarity index 100% rename from sidecar/migrations/20231016135924_git_log_statistics.sql rename to larp/migrations/20231016135924_git_log_statistics.sql diff --git a/sidecar/migrations/20231117015452_llm_data.sql b/larp/migrations/20231117015452_llm_data.sql similarity index 100% rename from sidecar/migrations/20231117015452_llm_data.sql rename to larp/migrations/20231117015452_llm_data.sql diff --git a/sidecar/migrations/20231120174108_openai_llm_data_answer_column.sql b/larp/migrations/20231120174108_openai_llm_data_answer_column.sql similarity index 100% rename from sidecar/migrations/20231120174108_openai_llm_data_answer_column.sql rename to larp/migrations/20231120174108_openai_llm_data_answer_column.sql diff --git a/sidecar/src/agent/llm_funcs.rs b/larp/src/agent/llm_funcs.rs similarity index 100% rename from sidecar/src/agent/llm_funcs.rs rename to larp/src/agent/llm_funcs.rs diff --git a/sidecar/src/agent/mod.rs b/larp/src/agent/mod.rs similarity index 100% rename from sidecar/src/agent/mod.rs rename to larp/src/agent/mod.rs diff --git a/sidecar/src/agent/prompts.rs b/larp/src/agent/prompts.rs similarity index 100% rename from sidecar/src/agent/prompts.rs rename to larp/src/agent/prompts.rs diff --git a/sidecar/src/agent/search.rs b/larp/src/agent/search.rs similarity index 100% rename from sidecar/src/agent/search.rs rename to larp/src/agent/search.rs diff --git a/sidecar/src/agent/stopwords.txt b/larp/src/agent/stopwords.txt similarity index 100% rename from sidecar/src/agent/stopwords.txt rename to larp/src/agent/stopwords.txt diff --git a/sidecar/src/agent/types.rs b/larp/src/agent/types.rs similarity index 100% rename from sidecar/src/agent/types.rs rename to larp/src/agent/types.rs diff --git a/sidecar/src/agent/user_context.rs b/larp/src/agent/user_context.rs similarity index 100% rename from sidecar/src/agent/user_context.rs rename to larp/src/agent/user_context.rs diff --git a/sidecar/src/agentic/memory/base.rs b/larp/src/agentic/memory/base.rs similarity index 100% rename from sidecar/src/agentic/memory/base.rs rename to larp/src/agentic/memory/base.rs diff --git a/sidecar/src/agentic/memory/mod.rs b/larp/src/agentic/memory/mod.rs similarity index 100% rename from sidecar/src/agentic/memory/mod.rs rename to larp/src/agentic/memory/mod.rs diff --git a/sidecar/src/agentic/mod.rs b/larp/src/agentic/mod.rs similarity index 100% rename from sidecar/src/agentic/mod.rs rename to larp/src/agentic/mod.rs diff --git a/sidecar/src/agentic/swe_bench/mod.rs b/larp/src/agentic/swe_bench/mod.rs similarity index 100% rename from sidecar/src/agentic/swe_bench/mod.rs rename to larp/src/agentic/swe_bench/mod.rs diff --git a/sidecar/src/agentic/swe_bench/search_cache.rs b/larp/src/agentic/swe_bench/search_cache.rs similarity index 100% rename from sidecar/src/agentic/swe_bench/search_cache.rs rename to larp/src/agentic/swe_bench/search_cache.rs diff --git a/sidecar/src/agentic/symbol/anchored.rs b/larp/src/agentic/symbol/anchored.rs similarity index 100% rename from sidecar/src/agentic/symbol/anchored.rs rename to larp/src/agentic/symbol/anchored.rs diff --git a/sidecar/src/agentic/symbol/errors.rs b/larp/src/agentic/symbol/errors.rs similarity index 100% rename from sidecar/src/agentic/symbol/errors.rs rename to larp/src/agentic/symbol/errors.rs diff --git a/sidecar/src/agentic/symbol/events/agent.rs b/larp/src/agentic/symbol/events/agent.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/agent.rs rename to larp/src/agentic/symbol/events/agent.rs diff --git a/sidecar/src/agentic/symbol/events/context_event.rs b/larp/src/agentic/symbol/events/context_event.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/context_event.rs rename to larp/src/agentic/symbol/events/context_event.rs diff --git a/sidecar/src/agentic/symbol/events/edit.rs b/larp/src/agentic/symbol/events/edit.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/edit.rs rename to larp/src/agentic/symbol/events/edit.rs diff --git a/sidecar/src/agentic/symbol/events/environment_event.rs b/larp/src/agentic/symbol/events/environment_event.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/environment_event.rs rename to larp/src/agentic/symbol/events/environment_event.rs diff --git a/sidecar/src/agentic/symbol/events/human.rs b/larp/src/agentic/symbol/events/human.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/human.rs rename to larp/src/agentic/symbol/events/human.rs diff --git a/sidecar/src/agentic/symbol/events/initial_request.rs b/larp/src/agentic/symbol/events/initial_request.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/initial_request.rs rename to larp/src/agentic/symbol/events/initial_request.rs diff --git a/sidecar/src/agentic/symbol/events/input.rs b/larp/src/agentic/symbol/events/input.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/input.rs rename to larp/src/agentic/symbol/events/input.rs diff --git a/sidecar/src/agentic/symbol/events/lsp.rs b/larp/src/agentic/symbol/events/lsp.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/lsp.rs rename to larp/src/agentic/symbol/events/lsp.rs diff --git a/sidecar/src/agentic/symbol/events/message_event.rs b/larp/src/agentic/symbol/events/message_event.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/message_event.rs rename to larp/src/agentic/symbol/events/message_event.rs diff --git a/sidecar/src/agentic/symbol/events/mod.rs b/larp/src/agentic/symbol/events/mod.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/mod.rs rename to larp/src/agentic/symbol/events/mod.rs diff --git a/sidecar/src/agentic/symbol/events/probe.rs b/larp/src/agentic/symbol/events/probe.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/probe.rs rename to larp/src/agentic/symbol/events/probe.rs diff --git a/sidecar/src/agentic/symbol/events/types.rs b/larp/src/agentic/symbol/events/types.rs similarity index 100% rename from sidecar/src/agentic/symbol/events/types.rs rename to larp/src/agentic/symbol/events/types.rs diff --git a/sidecar/src/agentic/symbol/helpers.rs b/larp/src/agentic/symbol/helpers.rs similarity index 100% rename from sidecar/src/agentic/symbol/helpers.rs rename to larp/src/agentic/symbol/helpers.rs diff --git a/sidecar/src/agentic/symbol/identifier.rs b/larp/src/agentic/symbol/identifier.rs similarity index 100% rename from sidecar/src/agentic/symbol/identifier.rs rename to larp/src/agentic/symbol/identifier.rs diff --git a/sidecar/src/agentic/symbol/locker.rs b/larp/src/agentic/symbol/locker.rs similarity index 100% rename from sidecar/src/agentic/symbol/locker.rs rename to larp/src/agentic/symbol/locker.rs diff --git a/sidecar/src/agentic/symbol/manager.rs b/larp/src/agentic/symbol/manager.rs similarity index 100% rename from sidecar/src/agentic/symbol/manager.rs rename to larp/src/agentic/symbol/manager.rs diff --git a/sidecar/src/agentic/symbol/mod.rs b/larp/src/agentic/symbol/mod.rs similarity index 100% rename from sidecar/src/agentic/symbol/mod.rs rename to larp/src/agentic/symbol/mod.rs diff --git a/sidecar/src/agentic/symbol/scratch_pad.rs b/larp/src/agentic/symbol/scratch_pad.rs similarity index 100% rename from sidecar/src/agentic/symbol/scratch_pad.rs rename to larp/src/agentic/symbol/scratch_pad.rs diff --git a/sidecar/src/agentic/symbol/tool_box.rs b/larp/src/agentic/symbol/tool_box.rs similarity index 100% rename from sidecar/src/agentic/symbol/tool_box.rs rename to larp/src/agentic/symbol/tool_box.rs diff --git a/sidecar/src/agentic/symbol/tool_properties.rs b/larp/src/agentic/symbol/tool_properties.rs similarity index 100% rename from sidecar/src/agentic/symbol/tool_properties.rs rename to larp/src/agentic/symbol/tool_properties.rs diff --git a/sidecar/src/agentic/symbol/toolbox/helpers.rs b/larp/src/agentic/symbol/toolbox/helpers.rs similarity index 100% rename from sidecar/src/agentic/symbol/toolbox/helpers.rs rename to larp/src/agentic/symbol/toolbox/helpers.rs diff --git a/sidecar/src/agentic/symbol/toolbox/mod.rs b/larp/src/agentic/symbol/toolbox/mod.rs similarity index 100% rename from sidecar/src/agentic/symbol/toolbox/mod.rs rename to larp/src/agentic/symbol/toolbox/mod.rs diff --git a/sidecar/src/agentic/symbol/types.rs b/larp/src/agentic/symbol/types.rs similarity index 100% rename from sidecar/src/agentic/symbol/types.rs rename to larp/src/agentic/symbol/types.rs diff --git a/sidecar/src/agentic/symbol/ui_event.rs b/larp/src/agentic/symbol/ui_event.rs similarity index 100% rename from sidecar/src/agentic/symbol/ui_event.rs rename to larp/src/agentic/symbol/ui_event.rs diff --git a/sidecar/src/agentic/tool/broker.rs b/larp/src/agentic/tool/broker.rs similarity index 100% rename from sidecar/src/agentic/tool/broker.rs rename to larp/src/agentic/tool/broker.rs diff --git a/sidecar/src/agentic/tool/code_edit/code_editor.rs b/larp/src/agentic/tool/code_edit/code_editor.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/code_editor.rs rename to larp/src/agentic/tool/code_edit/code_editor.rs diff --git a/sidecar/src/agentic/tool/code_edit/filter_edit.rs b/larp/src/agentic/tool/code_edit/filter_edit.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/filter_edit.rs rename to larp/src/agentic/tool/code_edit/filter_edit.rs diff --git a/sidecar/src/agentic/tool/code_edit/find.rs b/larp/src/agentic/tool/code_edit/find.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/find.rs rename to larp/src/agentic/tool/code_edit/find.rs diff --git a/sidecar/src/agentic/tool/code_edit/mod.rs b/larp/src/agentic/tool/code_edit/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/mod.rs rename to larp/src/agentic/tool/code_edit/mod.rs diff --git a/sidecar/src/agentic/tool/code_edit/models/anthropic.rs b/larp/src/agentic/tool/code_edit/models/anthropic.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/models/anthropic.rs rename to larp/src/agentic/tool/code_edit/models/anthropic.rs diff --git a/sidecar/src/agentic/tool/code_edit/models/broker.rs b/larp/src/agentic/tool/code_edit/models/broker.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/models/broker.rs rename to larp/src/agentic/tool/code_edit/models/broker.rs diff --git a/sidecar/src/agentic/tool/code_edit/models/mod.rs b/larp/src/agentic/tool/code_edit/models/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/models/mod.rs rename to larp/src/agentic/tool/code_edit/models/mod.rs diff --git a/sidecar/src/agentic/tool/code_edit/search_and_replace.rs b/larp/src/agentic/tool/code_edit/search_and_replace.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/search_and_replace.rs rename to larp/src/agentic/tool/code_edit/search_and_replace.rs diff --git a/sidecar/src/agentic/tool/code_edit/test_correction.rs b/larp/src/agentic/tool/code_edit/test_correction.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/test_correction.rs rename to larp/src/agentic/tool/code_edit/test_correction.rs diff --git a/sidecar/src/agentic/tool/code_edit/types.rs b/larp/src/agentic/tool/code_edit/types.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/types.rs rename to larp/src/agentic/tool/code_edit/types.rs diff --git a/sidecar/src/agentic/tool/code_edit/xml_processor.rs b/larp/src/agentic/tool/code_edit/xml_processor.rs similarity index 100% rename from sidecar/src/agentic/tool/code_edit/xml_processor.rs rename to larp/src/agentic/tool/code_edit/xml_processor.rs diff --git a/sidecar/src/agentic/tool/code_symbol/apply_outline_edit_to_range.rs b/larp/src/agentic/tool/code_symbol/apply_outline_edit_to_range.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/apply_outline_edit_to_range.rs rename to larp/src/agentic/tool/code_symbol/apply_outline_edit_to_range.rs diff --git a/sidecar/src/agentic/tool/code_symbol/correctness.rs b/larp/src/agentic/tool/code_symbol/correctness.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/correctness.rs rename to larp/src/agentic/tool/code_symbol/correctness.rs diff --git a/sidecar/src/agentic/tool/code_symbol/error_fix.rs b/larp/src/agentic/tool/code_symbol/error_fix.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/error_fix.rs rename to larp/src/agentic/tool/code_symbol/error_fix.rs diff --git a/sidecar/src/agentic/tool/code_symbol/find_file_for_new_symbol.rs b/larp/src/agentic/tool/code_symbol/find_file_for_new_symbol.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/find_file_for_new_symbol.rs rename to larp/src/agentic/tool/code_symbol/find_file_for_new_symbol.rs diff --git a/sidecar/src/agentic/tool/code_symbol/find_symbols_to_edit_in_context.rs b/larp/src/agentic/tool/code_symbol/find_symbols_to_edit_in_context.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/find_symbols_to_edit_in_context.rs rename to larp/src/agentic/tool/code_symbol/find_symbols_to_edit_in_context.rs diff --git a/sidecar/src/agentic/tool/code_symbol/followup.rs b/larp/src/agentic/tool/code_symbol/followup.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/followup.rs rename to larp/src/agentic/tool/code_symbol/followup.rs diff --git a/sidecar/src/agentic/tool/code_symbol/important.rs b/larp/src/agentic/tool/code_symbol/important.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/important.rs rename to larp/src/agentic/tool/code_symbol/important.rs diff --git a/sidecar/src/agentic/tool/code_symbol/initial_request_follow.rs b/larp/src/agentic/tool/code_symbol/initial_request_follow.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/initial_request_follow.rs rename to larp/src/agentic/tool/code_symbol/initial_request_follow.rs diff --git a/sidecar/src/agentic/tool/code_symbol/mod.rs b/larp/src/agentic/tool/code_symbol/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/mod.rs rename to larp/src/agentic/tool/code_symbol/mod.rs diff --git a/sidecar/src/agentic/tool/code_symbol/models/anthropic.rs b/larp/src/agentic/tool/code_symbol/models/anthropic.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/models/anthropic.rs rename to larp/src/agentic/tool/code_symbol/models/anthropic.rs diff --git a/sidecar/src/agentic/tool/code_symbol/models/mod.rs b/larp/src/agentic/tool/code_symbol/models/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/models/mod.rs rename to larp/src/agentic/tool/code_symbol/models/mod.rs diff --git a/sidecar/src/agentic/tool/code_symbol/new_location.rs b/larp/src/agentic/tool/code_symbol/new_location.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/new_location.rs rename to larp/src/agentic/tool/code_symbol/new_location.rs diff --git a/sidecar/src/agentic/tool/code_symbol/new_sub_symbol.rs b/larp/src/agentic/tool/code_symbol/new_sub_symbol.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/new_sub_symbol.rs rename to larp/src/agentic/tool/code_symbol/new_sub_symbol.rs diff --git a/sidecar/src/agentic/tool/code_symbol/planning_before_code_edit.rs b/larp/src/agentic/tool/code_symbol/planning_before_code_edit.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/planning_before_code_edit.rs rename to larp/src/agentic/tool/code_symbol/planning_before_code_edit.rs diff --git a/sidecar/src/agentic/tool/code_symbol/probe.rs b/larp/src/agentic/tool/code_symbol/probe.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/probe.rs rename to larp/src/agentic/tool/code_symbol/probe.rs diff --git a/sidecar/src/agentic/tool/code_symbol/probe_question_for_symbol.rs b/larp/src/agentic/tool/code_symbol/probe_question_for_symbol.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/probe_question_for_symbol.rs rename to larp/src/agentic/tool/code_symbol/probe_question_for_symbol.rs diff --git a/sidecar/src/agentic/tool/code_symbol/probe_try_hard_answer.rs b/larp/src/agentic/tool/code_symbol/probe_try_hard_answer.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/probe_try_hard_answer.rs rename to larp/src/agentic/tool/code_symbol/probe_try_hard_answer.rs diff --git a/sidecar/src/agentic/tool/code_symbol/repo_map_search.rs b/larp/src/agentic/tool/code_symbol/repo_map_search.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/repo_map_search.rs rename to larp/src/agentic/tool/code_symbol/repo_map_search.rs diff --git a/sidecar/src/agentic/tool/code_symbol/reranking_symbols_for_editing_context.rs b/larp/src/agentic/tool/code_symbol/reranking_symbols_for_editing_context.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/reranking_symbols_for_editing_context.rs rename to larp/src/agentic/tool/code_symbol/reranking_symbols_for_editing_context.rs diff --git a/sidecar/src/agentic/tool/code_symbol/scratch_pad.rs b/larp/src/agentic/tool/code_symbol/scratch_pad.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/scratch_pad.rs rename to larp/src/agentic/tool/code_symbol/scratch_pad.rs diff --git a/sidecar/src/agentic/tool/code_symbol/should_edit.rs b/larp/src/agentic/tool/code_symbol/should_edit.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/should_edit.rs rename to larp/src/agentic/tool/code_symbol/should_edit.rs diff --git a/sidecar/src/agentic/tool/code_symbol/types.rs b/larp/src/agentic/tool/code_symbol/types.rs similarity index 100% rename from sidecar/src/agentic/tool/code_symbol/types.rs rename to larp/src/agentic/tool/code_symbol/types.rs diff --git a/sidecar/src/agentic/tool/devtools/mod.rs b/larp/src/agentic/tool/devtools/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/devtools/mod.rs rename to larp/src/agentic/tool/devtools/mod.rs diff --git a/sidecar/src/agentic/tool/devtools/screenshot.rs b/larp/src/agentic/tool/devtools/screenshot.rs similarity index 100% rename from sidecar/src/agentic/tool/devtools/screenshot.rs rename to larp/src/agentic/tool/devtools/screenshot.rs diff --git a/sidecar/src/agentic/tool/editor/apply.rs b/larp/src/agentic/tool/editor/apply.rs similarity index 100% rename from sidecar/src/agentic/tool/editor/apply.rs rename to larp/src/agentic/tool/editor/apply.rs diff --git a/sidecar/src/agentic/tool/editor/mod.rs b/larp/src/agentic/tool/editor/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/editor/mod.rs rename to larp/src/agentic/tool/editor/mod.rs diff --git a/sidecar/src/agentic/tool/errors.rs b/larp/src/agentic/tool/errors.rs similarity index 100% rename from sidecar/src/agentic/tool/errors.rs rename to larp/src/agentic/tool/errors.rs diff --git a/sidecar/src/agentic/tool/feedback/feedback.rs b/larp/src/agentic/tool/feedback/feedback.rs similarity index 100% rename from sidecar/src/agentic/tool/feedback/feedback.rs rename to larp/src/agentic/tool/feedback/feedback.rs diff --git a/sidecar/src/agentic/tool/feedback/mod.rs b/larp/src/agentic/tool/feedback/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/feedback/mod.rs rename to larp/src/agentic/tool/feedback/mod.rs diff --git a/sidecar/src/agentic/tool/file/file_finder.rs b/larp/src/agentic/tool/file/file_finder.rs similarity index 100% rename from sidecar/src/agentic/tool/file/file_finder.rs rename to larp/src/agentic/tool/file/file_finder.rs diff --git a/sidecar/src/agentic/tool/file/important.rs b/larp/src/agentic/tool/file/important.rs similarity index 100% rename from sidecar/src/agentic/tool/file/important.rs rename to larp/src/agentic/tool/file/important.rs diff --git a/sidecar/src/agentic/tool/file/mod.rs b/larp/src/agentic/tool/file/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/file/mod.rs rename to larp/src/agentic/tool/file/mod.rs diff --git a/sidecar/src/agentic/tool/file/models/anthropic.rs b/larp/src/agentic/tool/file/models/anthropic.rs similarity index 100% rename from sidecar/src/agentic/tool/file/models/anthropic.rs rename to larp/src/agentic/tool/file/models/anthropic.rs diff --git a/sidecar/src/agentic/tool/file/models/mod.rs b/larp/src/agentic/tool/file/models/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/file/models/mod.rs rename to larp/src/agentic/tool/file/models/mod.rs diff --git a/sidecar/src/agentic/tool/file/semantic_search.rs b/larp/src/agentic/tool/file/semantic_search.rs similarity index 100% rename from sidecar/src/agentic/tool/file/semantic_search.rs rename to larp/src/agentic/tool/file/semantic_search.rs diff --git a/sidecar/src/agentic/tool/file/types.rs b/larp/src/agentic/tool/file/types.rs similarity index 100% rename from sidecar/src/agentic/tool/file/types.rs rename to larp/src/agentic/tool/file/types.rs diff --git a/sidecar/src/agentic/tool/filtering/broker.rs b/larp/src/agentic/tool/filtering/broker.rs similarity index 100% rename from sidecar/src/agentic/tool/filtering/broker.rs rename to larp/src/agentic/tool/filtering/broker.rs diff --git a/sidecar/src/agentic/tool/filtering/errors.rs b/larp/src/agentic/tool/filtering/errors.rs similarity index 100% rename from sidecar/src/agentic/tool/filtering/errors.rs rename to larp/src/agentic/tool/filtering/errors.rs diff --git a/sidecar/src/agentic/tool/filtering/mod.rs b/larp/src/agentic/tool/filtering/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/filtering/mod.rs rename to larp/src/agentic/tool/filtering/mod.rs diff --git a/sidecar/src/agentic/tool/filtering/models/anthropic.rs b/larp/src/agentic/tool/filtering/models/anthropic.rs similarity index 100% rename from sidecar/src/agentic/tool/filtering/models/anthropic.rs rename to larp/src/agentic/tool/filtering/models/anthropic.rs diff --git a/sidecar/src/agentic/tool/filtering/models/mod.rs b/larp/src/agentic/tool/filtering/models/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/filtering/models/mod.rs rename to larp/src/agentic/tool/filtering/models/mod.rs diff --git a/sidecar/src/agentic/tool/git/diff_client.rs b/larp/src/agentic/tool/git/diff_client.rs similarity index 100% rename from sidecar/src/agentic/tool/git/diff_client.rs rename to larp/src/agentic/tool/git/diff_client.rs diff --git a/sidecar/src/agentic/tool/git/edited_files.rs b/larp/src/agentic/tool/git/edited_files.rs similarity index 100% rename from sidecar/src/agentic/tool/git/edited_files.rs rename to larp/src/agentic/tool/git/edited_files.rs diff --git a/sidecar/src/agentic/tool/git/mod.rs b/larp/src/agentic/tool/git/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/git/mod.rs rename to larp/src/agentic/tool/git/mod.rs diff --git a/sidecar/src/agentic/tool/git/operation_id.rs b/larp/src/agentic/tool/git/operation_id.rs similarity index 100% rename from sidecar/src/agentic/tool/git/operation_id.rs rename to larp/src/agentic/tool/git/operation_id.rs diff --git a/sidecar/src/agentic/tool/grep/file.rs b/larp/src/agentic/tool/grep/file.rs similarity index 100% rename from sidecar/src/agentic/tool/grep/file.rs rename to larp/src/agentic/tool/grep/file.rs diff --git a/sidecar/src/agentic/tool/grep/mod.rs b/larp/src/agentic/tool/grep/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/grep/mod.rs rename to larp/src/agentic/tool/grep/mod.rs diff --git a/sidecar/src/agentic/tool/helpers/cancellation_future.rs b/larp/src/agentic/tool/helpers/cancellation_future.rs similarity index 100% rename from sidecar/src/agentic/tool/helpers/cancellation_future.rs rename to larp/src/agentic/tool/helpers/cancellation_future.rs diff --git a/sidecar/src/agentic/tool/helpers/diff_recent_changes.rs b/larp/src/agentic/tool/helpers/diff_recent_changes.rs similarity index 100% rename from sidecar/src/agentic/tool/helpers/diff_recent_changes.rs rename to larp/src/agentic/tool/helpers/diff_recent_changes.rs diff --git a/sidecar/src/agentic/tool/helpers/mod.rs b/larp/src/agentic/tool/helpers/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/helpers/mod.rs rename to larp/src/agentic/tool/helpers/mod.rs diff --git a/sidecar/src/agentic/tool/human/cli.rs b/larp/src/agentic/tool/human/cli.rs similarity index 100% rename from sidecar/src/agentic/tool/human/cli.rs rename to larp/src/agentic/tool/human/cli.rs diff --git a/sidecar/src/agentic/tool/human/error.rs b/larp/src/agentic/tool/human/error.rs similarity index 100% rename from sidecar/src/agentic/tool/human/error.rs rename to larp/src/agentic/tool/human/error.rs diff --git a/sidecar/src/agentic/tool/human/human.rs b/larp/src/agentic/tool/human/human.rs similarity index 100% rename from sidecar/src/agentic/tool/human/human.rs rename to larp/src/agentic/tool/human/human.rs diff --git a/sidecar/src/agentic/tool/human/mod.rs b/larp/src/agentic/tool/human/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/human/mod.rs rename to larp/src/agentic/tool/human/mod.rs diff --git a/sidecar/src/agentic/tool/human/qa.rs b/larp/src/agentic/tool/human/qa.rs similarity index 100% rename from sidecar/src/agentic/tool/human/qa.rs rename to larp/src/agentic/tool/human/qa.rs diff --git a/sidecar/src/agentic/tool/input.rs b/larp/src/agentic/tool/input.rs similarity index 100% rename from sidecar/src/agentic/tool/input.rs rename to larp/src/agentic/tool/input.rs diff --git a/sidecar/src/agentic/tool/jitter.rs b/larp/src/agentic/tool/jitter.rs similarity index 100% rename from sidecar/src/agentic/tool/jitter.rs rename to larp/src/agentic/tool/jitter.rs diff --git a/sidecar/src/agentic/tool/kw_search/google_studio.rs b/larp/src/agentic/tool/kw_search/google_studio.rs similarity index 100% rename from sidecar/src/agentic/tool/kw_search/google_studio.rs rename to larp/src/agentic/tool/kw_search/google_studio.rs diff --git a/sidecar/src/agentic/tool/kw_search/mod.rs b/larp/src/agentic/tool/kw_search/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/kw_search/mod.rs rename to larp/src/agentic/tool/kw_search/mod.rs diff --git a/sidecar/src/agentic/tool/kw_search/tag_search.rs b/larp/src/agentic/tool/kw_search/tag_search.rs similarity index 100% rename from sidecar/src/agentic/tool/kw_search/tag_search.rs rename to larp/src/agentic/tool/kw_search/tag_search.rs diff --git a/sidecar/src/agentic/tool/kw_search/tool.rs b/larp/src/agentic/tool/kw_search/tool.rs similarity index 100% rename from sidecar/src/agentic/tool/kw_search/tool.rs rename to larp/src/agentic/tool/kw_search/tool.rs diff --git a/sidecar/src/agentic/tool/kw_search/types.rs b/larp/src/agentic/tool/kw_search/types.rs similarity index 100% rename from sidecar/src/agentic/tool/kw_search/types.rs rename to larp/src/agentic/tool/kw_search/types.rs diff --git a/sidecar/src/agentic/tool/lsp/create_file.rs b/larp/src/agentic/tool/lsp/create_file.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/create_file.rs rename to larp/src/agentic/tool/lsp/create_file.rs diff --git a/sidecar/src/agentic/tool/lsp/diagnostics.rs b/larp/src/agentic/tool/lsp/diagnostics.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/diagnostics.rs rename to larp/src/agentic/tool/lsp/diagnostics.rs diff --git a/sidecar/src/agentic/tool/lsp/file_diagnostics.rs b/larp/src/agentic/tool/lsp/file_diagnostics.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/file_diagnostics.rs rename to larp/src/agentic/tool/lsp/file_diagnostics.rs diff --git a/sidecar/src/agentic/tool/lsp/find_files.rs b/larp/src/agentic/tool/lsp/find_files.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/find_files.rs rename to larp/src/agentic/tool/lsp/find_files.rs diff --git a/sidecar/src/agentic/tool/lsp/get_outline_nodes.rs b/larp/src/agentic/tool/lsp/get_outline_nodes.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/get_outline_nodes.rs rename to larp/src/agentic/tool/lsp/get_outline_nodes.rs diff --git a/sidecar/src/agentic/tool/lsp/go_to_previous_word.rs b/larp/src/agentic/tool/lsp/go_to_previous_word.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/go_to_previous_word.rs rename to larp/src/agentic/tool/lsp/go_to_previous_word.rs diff --git a/sidecar/src/agentic/tool/lsp/gotodefintion.rs b/larp/src/agentic/tool/lsp/gotodefintion.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/gotodefintion.rs rename to larp/src/agentic/tool/lsp/gotodefintion.rs diff --git a/sidecar/src/agentic/tool/lsp/gotoimplementations.rs b/larp/src/agentic/tool/lsp/gotoimplementations.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/gotoimplementations.rs rename to larp/src/agentic/tool/lsp/gotoimplementations.rs diff --git a/sidecar/src/agentic/tool/lsp/gotoreferences.rs b/larp/src/agentic/tool/lsp/gotoreferences.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/gotoreferences.rs rename to larp/src/agentic/tool/lsp/gotoreferences.rs diff --git a/sidecar/src/agentic/tool/lsp/gototypedefinition.rs b/larp/src/agentic/tool/lsp/gototypedefinition.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/gototypedefinition.rs rename to larp/src/agentic/tool/lsp/gototypedefinition.rs diff --git a/sidecar/src/agentic/tool/lsp/grep_symbol.rs b/larp/src/agentic/tool/lsp/grep_symbol.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/grep_symbol.rs rename to larp/src/agentic/tool/lsp/grep_symbol.rs diff --git a/sidecar/src/agentic/tool/lsp/inlay_hints.rs b/larp/src/agentic/tool/lsp/inlay_hints.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/inlay_hints.rs rename to larp/src/agentic/tool/lsp/inlay_hints.rs diff --git a/sidecar/src/agentic/tool/lsp/list_files.rs b/larp/src/agentic/tool/lsp/list_files.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/list_files.rs rename to larp/src/agentic/tool/lsp/list_files.rs diff --git a/sidecar/src/agentic/tool/lsp/mod.rs b/larp/src/agentic/tool/lsp/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/mod.rs rename to larp/src/agentic/tool/lsp/mod.rs diff --git a/sidecar/src/agentic/tool/lsp/open_file.rs b/larp/src/agentic/tool/lsp/open_file.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/open_file.rs rename to larp/src/agentic/tool/lsp/open_file.rs diff --git a/sidecar/src/agentic/tool/lsp/quick_fix.rs b/larp/src/agentic/tool/lsp/quick_fix.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/quick_fix.rs rename to larp/src/agentic/tool/lsp/quick_fix.rs diff --git a/sidecar/src/agentic/tool/lsp/search_file.rs b/larp/src/agentic/tool/lsp/search_file.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/search_file.rs rename to larp/src/agentic/tool/lsp/search_file.rs diff --git a/sidecar/src/agentic/tool/lsp/subprocess_spawned_output.rs b/larp/src/agentic/tool/lsp/subprocess_spawned_output.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/subprocess_spawned_output.rs rename to larp/src/agentic/tool/lsp/subprocess_spawned_output.rs diff --git a/sidecar/src/agentic/tool/lsp/undo_changes.rs b/larp/src/agentic/tool/lsp/undo_changes.rs similarity index 100% rename from sidecar/src/agentic/tool/lsp/undo_changes.rs rename to larp/src/agentic/tool/lsp/undo_changes.rs diff --git a/sidecar/src/agentic/tool/mcp/config.json.example b/larp/src/agentic/tool/mcp/config.json.example similarity index 100% rename from sidecar/src/agentic/tool/mcp/config.json.example rename to larp/src/agentic/tool/mcp/config.json.example diff --git a/sidecar/src/agentic/tool/mcp/init.rs b/larp/src/agentic/tool/mcp/init.rs similarity index 100% rename from sidecar/src/agentic/tool/mcp/init.rs rename to larp/src/agentic/tool/mcp/init.rs diff --git a/sidecar/src/agentic/tool/mcp/input.rs b/larp/src/agentic/tool/mcp/input.rs similarity index 100% rename from sidecar/src/agentic/tool/mcp/input.rs rename to larp/src/agentic/tool/mcp/input.rs diff --git a/sidecar/src/agentic/tool/mcp/integration_tool.rs b/larp/src/agentic/tool/mcp/integration_tool.rs similarity index 100% rename from sidecar/src/agentic/tool/mcp/integration_tool.rs rename to larp/src/agentic/tool/mcp/integration_tool.rs diff --git a/sidecar/src/agentic/tool/mcp/mod.rs b/larp/src/agentic/tool/mcp/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/mcp/mod.rs rename to larp/src/agentic/tool/mcp/mod.rs diff --git a/sidecar/src/agentic/tool/mod.rs b/larp/src/agentic/tool/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/mod.rs rename to larp/src/agentic/tool/mod.rs diff --git a/sidecar/src/agentic/tool/output.rs b/larp/src/agentic/tool/output.rs similarity index 100% rename from sidecar/src/agentic/tool/output.rs rename to larp/src/agentic/tool/output.rs diff --git a/sidecar/src/agentic/tool/plan/add_steps.rs b/larp/src/agentic/tool/plan/add_steps.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/add_steps.rs rename to larp/src/agentic/tool/plan/add_steps.rs diff --git a/sidecar/src/agentic/tool/plan/generator.rs b/larp/src/agentic/tool/plan/generator.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/generator.rs rename to larp/src/agentic/tool/plan/generator.rs diff --git a/sidecar/src/agentic/tool/plan/mod.rs b/larp/src/agentic/tool/plan/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/mod.rs rename to larp/src/agentic/tool/plan/mod.rs diff --git a/sidecar/src/agentic/tool/plan/plan.rs b/larp/src/agentic/tool/plan/plan.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/plan.rs rename to larp/src/agentic/tool/plan/plan.rs diff --git a/sidecar/src/agentic/tool/plan/plan_step.rs b/larp/src/agentic/tool/plan/plan_step.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/plan_step.rs rename to larp/src/agentic/tool/plan/plan_step.rs diff --git a/sidecar/src/agentic/tool/plan/reasoning.rs b/larp/src/agentic/tool/plan/reasoning.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/reasoning.rs rename to larp/src/agentic/tool/plan/reasoning.rs diff --git a/sidecar/src/agentic/tool/plan/service.rs b/larp/src/agentic/tool/plan/service.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/service.rs rename to larp/src/agentic/tool/plan/service.rs diff --git a/sidecar/src/agentic/tool/plan/updater.rs b/larp/src/agentic/tool/plan/updater.rs similarity index 100% rename from sidecar/src/agentic/tool/plan/updater.rs rename to larp/src/agentic/tool/plan/updater.rs diff --git a/sidecar/src/agentic/tool/ref_filter/mod.rs b/larp/src/agentic/tool/ref_filter/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/ref_filter/mod.rs rename to larp/src/agentic/tool/ref_filter/mod.rs diff --git a/sidecar/src/agentic/tool/ref_filter/ref_filter.rs b/larp/src/agentic/tool/ref_filter/ref_filter.rs similarity index 100% rename from sidecar/src/agentic/tool/ref_filter/ref_filter.rs rename to larp/src/agentic/tool/ref_filter/ref_filter.rs diff --git a/sidecar/src/agentic/tool/repo_map/generator.rs b/larp/src/agentic/tool/repo_map/generator.rs similarity index 100% rename from sidecar/src/agentic/tool/repo_map/generator.rs rename to larp/src/agentic/tool/repo_map/generator.rs diff --git a/sidecar/src/agentic/tool/repo_map/mod.rs b/larp/src/agentic/tool/repo_map/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/repo_map/mod.rs rename to larp/src/agentic/tool/repo_map/mod.rs diff --git a/sidecar/src/agentic/tool/rerank/base.rs b/larp/src/agentic/tool/rerank/base.rs similarity index 100% rename from sidecar/src/agentic/tool/rerank/base.rs rename to larp/src/agentic/tool/rerank/base.rs diff --git a/sidecar/src/agentic/tool/rerank/listwise/anthropic.rs b/larp/src/agentic/tool/rerank/listwise/anthropic.rs similarity index 100% rename from sidecar/src/agentic/tool/rerank/listwise/anthropic.rs rename to larp/src/agentic/tool/rerank/listwise/anthropic.rs diff --git a/sidecar/src/agentic/tool/rerank/listwise/mod.rs b/larp/src/agentic/tool/rerank/listwise/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/rerank/listwise/mod.rs rename to larp/src/agentic/tool/rerank/listwise/mod.rs diff --git a/sidecar/src/agentic/tool/rerank/mod.rs b/larp/src/agentic/tool/rerank/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/rerank/mod.rs rename to larp/src/agentic/tool/rerank/mod.rs diff --git a/sidecar/src/agentic/tool/reward/client.rs b/larp/src/agentic/tool/reward/client.rs similarity index 100% rename from sidecar/src/agentic/tool/reward/client.rs rename to larp/src/agentic/tool/reward/client.rs diff --git a/sidecar/src/agentic/tool/reward/mod.rs b/larp/src/agentic/tool/reward/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/reward/mod.rs rename to larp/src/agentic/tool/reward/mod.rs diff --git a/sidecar/src/agentic/tool/search/big_search.rs b/larp/src/agentic/tool/search/big_search.rs similarity index 100% rename from sidecar/src/agentic/tool/search/big_search.rs rename to larp/src/agentic/tool/search/big_search.rs diff --git a/sidecar/src/agentic/tool/search/decide.rs b/larp/src/agentic/tool/search/decide.rs similarity index 100% rename from sidecar/src/agentic/tool/search/decide.rs rename to larp/src/agentic/tool/search/decide.rs diff --git a/sidecar/src/agentic/tool/search/google_studio.rs b/larp/src/agentic/tool/search/google_studio.rs similarity index 100% rename from sidecar/src/agentic/tool/search/google_studio.rs rename to larp/src/agentic/tool/search/google_studio.rs diff --git a/sidecar/src/agentic/tool/search/identify.rs b/larp/src/agentic/tool/search/identify.rs similarity index 100% rename from sidecar/src/agentic/tool/search/identify.rs rename to larp/src/agentic/tool/search/identify.rs diff --git a/sidecar/src/agentic/tool/search/iterative.rs b/larp/src/agentic/tool/search/iterative.rs similarity index 100% rename from sidecar/src/agentic/tool/search/iterative.rs rename to larp/src/agentic/tool/search/iterative.rs diff --git a/sidecar/src/agentic/tool/search/mod.rs b/larp/src/agentic/tool/search/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/search/mod.rs rename to larp/src/agentic/tool/search/mod.rs diff --git a/sidecar/src/agentic/tool/search/relevant_files.rs b/larp/src/agentic/tool/search/relevant_files.rs similarity index 100% rename from sidecar/src/agentic/tool/search/relevant_files.rs rename to larp/src/agentic/tool/search/relevant_files.rs diff --git a/sidecar/src/agentic/tool/search/repository.rs b/larp/src/agentic/tool/search/repository.rs similarity index 100% rename from sidecar/src/agentic/tool/search/repository.rs rename to larp/src/agentic/tool/search/repository.rs diff --git a/sidecar/src/agentic/tool/session/ask_followup_question.rs b/larp/src/agentic/tool/session/ask_followup_question.rs similarity index 100% rename from sidecar/src/agentic/tool/session/ask_followup_question.rs rename to larp/src/agentic/tool/session/ask_followup_question.rs diff --git a/sidecar/src/agentic/tool/session/attempt_completion.rs b/larp/src/agentic/tool/session/attempt_completion.rs similarity index 100% rename from sidecar/src/agentic/tool/session/attempt_completion.rs rename to larp/src/agentic/tool/session/attempt_completion.rs diff --git a/sidecar/src/agentic/tool/session/chat.rs b/larp/src/agentic/tool/session/chat.rs similarity index 100% rename from sidecar/src/agentic/tool/session/chat.rs rename to larp/src/agentic/tool/session/chat.rs diff --git a/sidecar/src/agentic/tool/session/exchange.rs b/larp/src/agentic/tool/session/exchange.rs similarity index 100% rename from sidecar/src/agentic/tool/session/exchange.rs rename to larp/src/agentic/tool/session/exchange.rs diff --git a/sidecar/src/agentic/tool/session/hot_streak.rs b/larp/src/agentic/tool/session/hot_streak.rs similarity index 100% rename from sidecar/src/agentic/tool/session/hot_streak.rs rename to larp/src/agentic/tool/session/hot_streak.rs diff --git a/sidecar/src/agentic/tool/session/mod.rs b/larp/src/agentic/tool/session/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/session/mod.rs rename to larp/src/agentic/tool/session/mod.rs diff --git a/sidecar/src/agentic/tool/session/service.rs b/larp/src/agentic/tool/session/service.rs similarity index 100% rename from sidecar/src/agentic/tool/session/service.rs rename to larp/src/agentic/tool/session/service.rs diff --git a/sidecar/src/agentic/tool/session/session.rs b/larp/src/agentic/tool/session/session.rs similarity index 100% rename from sidecar/src/agentic/tool/session/session.rs rename to larp/src/agentic/tool/session/session.rs diff --git a/sidecar/src/agentic/tool/session/tool_use_agent.rs b/larp/src/agentic/tool/session/tool_use_agent.rs similarity index 100% rename from sidecar/src/agentic/tool/session/tool_use_agent.rs rename to larp/src/agentic/tool/session/tool_use_agent.rs diff --git a/sidecar/src/agentic/tool/swe_bench/mod.rs b/larp/src/agentic/tool/swe_bench/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/swe_bench/mod.rs rename to larp/src/agentic/tool/swe_bench/mod.rs diff --git a/sidecar/src/agentic/tool/swe_bench/test_tool.rs b/larp/src/agentic/tool/swe_bench/test_tool.rs similarity index 100% rename from sidecar/src/agentic/tool/swe_bench/test_tool.rs rename to larp/src/agentic/tool/swe_bench/test_tool.rs diff --git a/sidecar/src/agentic/tool/terminal/mod.rs b/larp/src/agentic/tool/terminal/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/terminal/mod.rs rename to larp/src/agentic/tool/terminal/mod.rs diff --git a/sidecar/src/agentic/tool/terminal/terminal.rs b/larp/src/agentic/tool/terminal/terminal.rs similarity index 100% rename from sidecar/src/agentic/tool/terminal/terminal.rs rename to larp/src/agentic/tool/terminal/terminal.rs diff --git a/sidecar/src/agentic/tool/test_runner/mod.rs b/larp/src/agentic/tool/test_runner/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/test_runner/mod.rs rename to larp/src/agentic/tool/test_runner/mod.rs diff --git a/sidecar/src/agentic/tool/test_runner/runner.rs b/larp/src/agentic/tool/test_runner/runner.rs similarity index 100% rename from sidecar/src/agentic/tool/test_runner/runner.rs rename to larp/src/agentic/tool/test_runner/runner.rs diff --git a/sidecar/src/agentic/tool/thinking/mod.rs b/larp/src/agentic/tool/thinking/mod.rs similarity index 100% rename from sidecar/src/agentic/tool/thinking/mod.rs rename to larp/src/agentic/tool/thinking/mod.rs diff --git a/sidecar/src/agentic/tool/thinking/thinking.rs b/larp/src/agentic/tool/thinking/thinking.rs similarity index 100% rename from sidecar/src/agentic/tool/thinking/thinking.rs rename to larp/src/agentic/tool/thinking/thinking.rs diff --git a/sidecar/src/agentic/tool/type.rs b/larp/src/agentic/tool/type.rs similarity index 100% rename from sidecar/src/agentic/tool/type.rs rename to larp/src/agentic/tool/type.rs diff --git a/sidecar/src/application/application.rs b/larp/src/application/application.rs similarity index 100% rename from sidecar/src/application/application.rs rename to larp/src/application/application.rs diff --git a/sidecar/src/application/config/configuration.rs b/larp/src/application/config/configuration.rs similarity index 100% rename from sidecar/src/application/config/configuration.rs rename to larp/src/application/config/configuration.rs diff --git a/sidecar/src/application/config/mod.rs b/larp/src/application/config/mod.rs similarity index 100% rename from sidecar/src/application/config/mod.rs rename to larp/src/application/config/mod.rs diff --git a/sidecar/src/application/logging/cleanup.rs b/larp/src/application/logging/cleanup.rs similarity index 100% rename from sidecar/src/application/logging/cleanup.rs rename to larp/src/application/logging/cleanup.rs diff --git a/sidecar/src/application/logging/mod.rs b/larp/src/application/logging/mod.rs similarity index 100% rename from sidecar/src/application/logging/mod.rs rename to larp/src/application/logging/mod.rs diff --git a/sidecar/src/application/logging/tracing.rs b/larp/src/application/logging/tracing.rs similarity index 100% rename from sidecar/src/application/logging/tracing.rs rename to larp/src/application/logging/tracing.rs diff --git a/sidecar/src/application/mod.rs b/larp/src/application/mod.rs similarity index 100% rename from sidecar/src/application/mod.rs rename to larp/src/application/mod.rs diff --git a/sidecar/src/bin/agent_bin.rs b/larp/src/bin/agent_bin.rs similarity index 100% rename from sidecar/src/bin/agent_bin.rs rename to larp/src/bin/agent_bin.rs diff --git a/sidecar/src/bin/agent_bin_reasoning.rs b/larp/src/bin/agent_bin_reasoning.rs similarity index 100% rename from sidecar/src/bin/agent_bin_reasoning.rs rename to larp/src/bin/agent_bin_reasoning.rs diff --git a/sidecar/src/bin/axflow_ingest.rs b/larp/src/bin/axflow_ingest.rs similarity index 100% rename from sidecar/src/bin/axflow_ingest.rs rename to larp/src/bin/axflow_ingest.rs diff --git a/sidecar/src/bin/code_editing_flow.rs b/larp/src/bin/code_editing_flow.rs similarity index 100% rename from sidecar/src/bin/code_editing_flow.rs rename to larp/src/bin/code_editing_flow.rs diff --git a/sidecar/src/bin/code_selection_editing.rs b/larp/src/bin/code_selection_editing.rs similarity index 100% rename from sidecar/src/bin/code_selection_editing.rs rename to larp/src/bin/code_selection_editing.rs diff --git a/sidecar/src/bin/cohere_rerank.rs b/larp/src/bin/cohere_rerank.rs similarity index 100% rename from sidecar/src/bin/cohere_rerank.rs rename to larp/src/bin/cohere_rerank.rs diff --git a/sidecar/src/bin/db_loading.rs b/larp/src/bin/db_loading.rs similarity index 100% rename from sidecar/src/bin/db_loading.rs rename to larp/src/bin/db_loading.rs diff --git a/sidecar/src/bin/diff_rendering.rs b/larp/src/bin/diff_rendering.rs similarity index 100% rename from sidecar/src/bin/diff_rendering.rs rename to larp/src/bin/diff_rendering.rs diff --git a/sidecar/src/bin/find_code_section.rs b/larp/src/bin/find_code_section.rs similarity index 100% rename from sidecar/src/bin/find_code_section.rs rename to larp/src/bin/find_code_section.rs diff --git a/sidecar/src/bin/find_files_bin.rs b/larp/src/bin/find_files_bin.rs similarity index 100% rename from sidecar/src/bin/find_files_bin.rs rename to larp/src/bin/find_files_bin.rs diff --git a/sidecar/src/bin/fireworks.rs b/larp/src/bin/fireworks.rs similarity index 100% rename from sidecar/src/bin/fireworks.rs rename to larp/src/bin/fireworks.rs diff --git a/sidecar/src/bin/get_diagnostics.rs b/larp/src/bin/get_diagnostics.rs similarity index 100% rename from sidecar/src/bin/get_diagnostics.rs rename to larp/src/bin/get_diagnostics.rs diff --git a/sidecar/src/bin/git_diff_generator.rs b/larp/src/bin/git_diff_generator.rs similarity index 100% rename from sidecar/src/bin/git_diff_generator.rs rename to larp/src/bin/git_diff_generator.rs diff --git a/sidecar/src/bin/git_diff_trace.rs b/larp/src/bin/git_diff_trace.rs similarity index 100% rename from sidecar/src/bin/git_diff_trace.rs rename to larp/src/bin/git_diff_trace.rs diff --git a/sidecar/src/bin/git_ignore_walk.rs b/larp/src/bin/git_ignore_walk.rs similarity index 100% rename from sidecar/src/bin/git_ignore_walk.rs rename to larp/src/bin/git_ignore_walk.rs diff --git a/sidecar/src/bin/git_log.rs b/larp/src/bin/git_log.rs similarity index 100% rename from sidecar/src/bin/git_log.rs rename to larp/src/bin/git_log.rs diff --git a/sidecar/src/bin/git_walking.rs b/larp/src/bin/git_walking.rs similarity index 100% rename from sidecar/src/bin/git_walking.rs rename to larp/src/bin/git_walking.rs diff --git a/sidecar/src/bin/list_files.rs b/larp/src/bin/list_files.rs similarity index 100% rename from sidecar/src/bin/list_files.rs rename to larp/src/bin/list_files.rs diff --git a/sidecar/src/bin/midwit_tool_use.rs b/larp/src/bin/midwit_tool_use.rs similarity index 100% rename from sidecar/src/bin/midwit_tool_use.rs rename to larp/src/bin/midwit_tool_use.rs diff --git a/sidecar/src/bin/parea.rs b/larp/src/bin/parea.rs similarity index 100% rename from sidecar/src/bin/parea.rs rename to larp/src/bin/parea.rs diff --git a/sidecar/src/bin/print_mcts_tree.rs b/larp/src/bin/print_mcts_tree.rs similarity index 100% rename from sidecar/src/bin/print_mcts_tree.rs rename to larp/src/bin/print_mcts_tree.rs diff --git a/sidecar/src/bin/read_folder.rs b/larp/src/bin/read_folder.rs similarity index 100% rename from sidecar/src/bin/read_folder.rs rename to larp/src/bin/read_folder.rs diff --git a/sidecar/src/bin/rg_search_file.rs b/larp/src/bin/rg_search_file.rs similarity index 100% rename from sidecar/src/bin/rg_search_file.rs rename to larp/src/bin/rg_search_file.rs diff --git a/sidecar/src/bin/serde_xml.rs b/larp/src/bin/serde_xml.rs similarity index 100% rename from sidecar/src/bin/serde_xml.rs rename to larp/src/bin/serde_xml.rs diff --git a/sidecar/src/bin/shared_future.rs b/larp/src/bin/shared_future.rs similarity index 100% rename from sidecar/src/bin/shared_future.rs rename to larp/src/bin/shared_future.rs diff --git a/sidecar/src/bin/simd_page_rank.rs b/larp/src/bin/simd_page_rank.rs similarity index 100% rename from sidecar/src/bin/simd_page_rank.rs rename to larp/src/bin/simd_page_rank.rs diff --git a/sidecar/src/bin/state.rs b/larp/src/bin/state.rs similarity index 100% rename from sidecar/src/bin/state.rs rename to larp/src/bin/state.rs diff --git a/sidecar/src/bin/stream_thinking.rs b/larp/src/bin/stream_thinking.rs similarity index 100% rename from sidecar/src/bin/stream_thinking.rs rename to larp/src/bin/stream_thinking.rs diff --git a/sidecar/src/bin/swe_bench_agent_bin.rs b/larp/src/bin/swe_bench_agent_bin.rs similarity index 100% rename from sidecar/src/bin/swe_bench_agent_bin.rs rename to larp/src/bin/swe_bench_agent_bin.rs diff --git a/sidecar/src/bin/swe_bench_agent_bin_test_run_based.rs b/larp/src/bin/swe_bench_agent_bin_test_run_based.rs similarity index 100% rename from sidecar/src/bin/swe_bench_agent_bin_test_run_based.rs rename to larp/src/bin/swe_bench_agent_bin_test_run_based.rs diff --git a/sidecar/src/bin/swe_bench_agent_bin_tool_based.rs b/larp/src/bin/swe_bench_agent_bin_tool_based.rs similarity index 100% rename from sidecar/src/bin/swe_bench_agent_bin_tool_based.rs rename to larp/src/bin/swe_bench_agent_bin_tool_based.rs diff --git a/sidecar/src/bin/swe_bench_mcts.rs b/larp/src/bin/swe_bench_mcts.rs similarity index 100% rename from sidecar/src/bin/swe_bench_mcts.rs rename to larp/src/bin/swe_bench_mcts.rs diff --git a/sidecar/src/bin/swe_bench_submission.rs b/larp/src/bin/swe_bench_submission.rs similarity index 100% rename from sidecar/src/bin/swe_bench_submission.rs rename to larp/src/bin/swe_bench_submission.rs diff --git a/sidecar/src/bin/sys_info.rs b/larp/src/bin/sys_info.rs similarity index 100% rename from sidecar/src/bin/sys_info.rs rename to larp/src/bin/sys_info.rs diff --git a/sidecar/src/bin/terminal.rs b/larp/src/bin/terminal.rs similarity index 100% rename from sidecar/src/bin/terminal.rs rename to larp/src/bin/terminal.rs diff --git a/sidecar/src/bin/tool_box_git_diff.rs b/larp/src/bin/tool_box_git_diff.rs similarity index 100% rename from sidecar/src/bin/tool_box_git_diff.rs rename to larp/src/bin/tool_box_git_diff.rs diff --git a/sidecar/src/bin/try_repomap.rs b/larp/src/bin/try_repomap.rs similarity index 100% rename from sidecar/src/bin/try_repomap.rs rename to larp/src/bin/try_repomap.rs diff --git a/sidecar/src/bin/tui.rs b/larp/src/bin/tui.rs similarity index 100% rename from sidecar/src/bin/tui.rs rename to larp/src/bin/tui.rs diff --git a/sidecar/src/bin/webserver.rs b/larp/src/bin/webserver.rs similarity index 100% rename from sidecar/src/bin/webserver.rs rename to larp/src/bin/webserver.rs diff --git a/sidecar/src/chunking/editor_parsing.rs b/larp/src/chunking/editor_parsing.rs similarity index 100% rename from sidecar/src/chunking/editor_parsing.rs rename to larp/src/chunking/editor_parsing.rs diff --git a/sidecar/src/chunking/file_content.rs b/larp/src/chunking/file_content.rs similarity index 100% rename from sidecar/src/chunking/file_content.rs rename to larp/src/chunking/file_content.rs diff --git a/sidecar/src/chunking/go.rs b/larp/src/chunking/go.rs similarity index 100% rename from sidecar/src/chunking/go.rs rename to larp/src/chunking/go.rs diff --git a/sidecar/src/chunking/helpers.rs b/larp/src/chunking/helpers.rs similarity index 100% rename from sidecar/src/chunking/helpers.rs rename to larp/src/chunking/helpers.rs diff --git a/sidecar/src/chunking/javascript.rs b/larp/src/chunking/javascript.rs similarity index 100% rename from sidecar/src/chunking/javascript.rs rename to larp/src/chunking/javascript.rs diff --git a/sidecar/src/chunking/languages.rs b/larp/src/chunking/languages.rs similarity index 100% rename from sidecar/src/chunking/languages.rs rename to larp/src/chunking/languages.rs diff --git a/sidecar/src/chunking/mod.rs b/larp/src/chunking/mod.rs similarity index 100% rename from sidecar/src/chunking/mod.rs rename to larp/src/chunking/mod.rs diff --git a/sidecar/src/chunking/python.rs b/larp/src/chunking/python.rs similarity index 100% rename from sidecar/src/chunking/python.rs rename to larp/src/chunking/python.rs diff --git a/sidecar/src/chunking/rust.rs b/larp/src/chunking/rust.rs similarity index 100% rename from sidecar/src/chunking/rust.rs rename to larp/src/chunking/rust.rs diff --git a/sidecar/src/chunking/scope_graph.rs b/larp/src/chunking/scope_graph.rs similarity index 100% rename from sidecar/src/chunking/scope_graph.rs rename to larp/src/chunking/scope_graph.rs diff --git a/sidecar/src/chunking/something.php b/larp/src/chunking/something.php similarity index 100% rename from sidecar/src/chunking/something.php rename to larp/src/chunking/something.php diff --git a/sidecar/src/chunking/text_document.rs b/larp/src/chunking/text_document.rs similarity index 100% rename from sidecar/src/chunking/text_document.rs rename to larp/src/chunking/text_document.rs diff --git a/sidecar/src/chunking/types.rs b/larp/src/chunking/types.rs similarity index 100% rename from sidecar/src/chunking/types.rs rename to larp/src/chunking/types.rs diff --git a/sidecar/src/chunking/typescript.rs b/larp/src/chunking/typescript.rs similarity index 100% rename from sidecar/src/chunking/typescript.rs rename to larp/src/chunking/typescript.rs diff --git a/sidecar/src/db/mod.rs b/larp/src/db/mod.rs similarity index 100% rename from sidecar/src/db/mod.rs rename to larp/src/db/mod.rs diff --git a/sidecar/src/db/sqlite.rs b/larp/src/db/sqlite.rs similarity index 100% rename from sidecar/src/db/sqlite.rs rename to larp/src/db/sqlite.rs diff --git a/sidecar/src/file_analyser/mod.rs b/larp/src/file_analyser/mod.rs similarity index 100% rename from sidecar/src/file_analyser/mod.rs rename to larp/src/file_analyser/mod.rs diff --git a/sidecar/src/file_analyser/types.rs b/larp/src/file_analyser/types.rs similarity index 100% rename from sidecar/src/file_analyser/types.rs rename to larp/src/file_analyser/types.rs diff --git a/sidecar/src/git/commit_statistics.rs b/larp/src/git/commit_statistics.rs similarity index 100% rename from sidecar/src/git/commit_statistics.rs rename to larp/src/git/commit_statistics.rs diff --git a/sidecar/src/git/mod.rs b/larp/src/git/mod.rs similarity index 100% rename from sidecar/src/git/mod.rs rename to larp/src/git/mod.rs diff --git a/sidecar/src/in_line_agent/context_parsing.rs b/larp/src/in_line_agent/context_parsing.rs similarity index 100% rename from sidecar/src/in_line_agent/context_parsing.rs rename to larp/src/in_line_agent/context_parsing.rs diff --git a/sidecar/src/in_line_agent/mod.rs b/larp/src/in_line_agent/mod.rs similarity index 100% rename from sidecar/src/in_line_agent/mod.rs rename to larp/src/in_line_agent/mod.rs diff --git a/sidecar/src/in_line_agent/prompts.rs b/larp/src/in_line_agent/prompts.rs similarity index 100% rename from sidecar/src/in_line_agent/prompts.rs rename to larp/src/in_line_agent/prompts.rs diff --git a/sidecar/src/in_line_agent/types.rs b/larp/src/in_line_agent/types.rs similarity index 100% rename from sidecar/src/in_line_agent/types.rs rename to larp/src/in_line_agent/types.rs diff --git a/sidecar/src/inline_completion/context/clipboard_context.rs b/larp/src/inline_completion/context/clipboard_context.rs similarity index 100% rename from sidecar/src/inline_completion/context/clipboard_context.rs rename to larp/src/inline_completion/context/clipboard_context.rs diff --git a/sidecar/src/inline_completion/context/codebase_context.rs b/larp/src/inline_completion/context/codebase_context.rs similarity index 100% rename from sidecar/src/inline_completion/context/codebase_context.rs rename to larp/src/inline_completion/context/codebase_context.rs diff --git a/sidecar/src/inline_completion/context/current_file.rs b/larp/src/inline_completion/context/current_file.rs similarity index 100% rename from sidecar/src/inline_completion/context/current_file.rs rename to larp/src/inline_completion/context/current_file.rs diff --git a/sidecar/src/inline_completion/context/mod.rs b/larp/src/inline_completion/context/mod.rs similarity index 100% rename from sidecar/src/inline_completion/context/mod.rs rename to larp/src/inline_completion/context/mod.rs diff --git a/sidecar/src/inline_completion/context/tree_sitter_cache.rs b/larp/src/inline_completion/context/tree_sitter_cache.rs similarity index 100% rename from sidecar/src/inline_completion/context/tree_sitter_cache.rs rename to larp/src/inline_completion/context/tree_sitter_cache.rs diff --git a/sidecar/src/inline_completion/context/types.rs b/larp/src/inline_completion/context/types.rs similarity index 100% rename from sidecar/src/inline_completion/context/types.rs rename to larp/src/inline_completion/context/types.rs diff --git a/sidecar/src/inline_completion/document/content.rs b/larp/src/inline_completion/document/content.rs similarity index 100% rename from sidecar/src/inline_completion/document/content.rs rename to larp/src/inline_completion/document/content.rs diff --git a/sidecar/src/inline_completion/document/mod.rs b/larp/src/inline_completion/document/mod.rs similarity index 100% rename from sidecar/src/inline_completion/document/mod.rs rename to larp/src/inline_completion/document/mod.rs diff --git a/sidecar/src/inline_completion/helpers.rs b/larp/src/inline_completion/helpers.rs similarity index 100% rename from sidecar/src/inline_completion/helpers.rs rename to larp/src/inline_completion/helpers.rs diff --git a/sidecar/src/inline_completion/mod.rs b/larp/src/inline_completion/mod.rs similarity index 100% rename from sidecar/src/inline_completion/mod.rs rename to larp/src/inline_completion/mod.rs diff --git a/sidecar/src/inline_completion/multiline/detect_multiline.rs b/larp/src/inline_completion/multiline/detect_multiline.rs similarity index 100% rename from sidecar/src/inline_completion/multiline/detect_multiline.rs rename to larp/src/inline_completion/multiline/detect_multiline.rs diff --git a/sidecar/src/inline_completion/multiline/mod.rs b/larp/src/inline_completion/multiline/mod.rs similarity index 100% rename from sidecar/src/inline_completion/multiline/mod.rs rename to larp/src/inline_completion/multiline/mod.rs diff --git a/sidecar/src/inline_completion/state.rs b/larp/src/inline_completion/state.rs similarity index 100% rename from sidecar/src/inline_completion/state.rs rename to larp/src/inline_completion/state.rs diff --git a/sidecar/src/inline_completion/symbols_tracker.rs b/larp/src/inline_completion/symbols_tracker.rs similarity index 100% rename from sidecar/src/inline_completion/symbols_tracker.rs rename to larp/src/inline_completion/symbols_tracker.rs diff --git a/sidecar/src/inline_completion/types.rs b/larp/src/inline_completion/types.rs similarity index 100% rename from sidecar/src/inline_completion/types.rs rename to larp/src/inline_completion/types.rs diff --git a/sidecar/src/lib.rs b/larp/src/lib.rs similarity index 100% rename from sidecar/src/lib.rs rename to larp/src/lib.rs diff --git a/sidecar/src/llm/clients/openai.rs b/larp/src/llm/clients/openai.rs similarity index 100% rename from sidecar/src/llm/clients/openai.rs rename to larp/src/llm/clients/openai.rs diff --git a/sidecar/src/mcts/action_node.rs b/larp/src/mcts/action_node.rs similarity index 100% rename from sidecar/src/mcts/action_node.rs rename to larp/src/mcts/action_node.rs diff --git a/sidecar/src/mcts/agent_settings/mod.rs b/larp/src/mcts/agent_settings/mod.rs similarity index 100% rename from sidecar/src/mcts/agent_settings/mod.rs rename to larp/src/mcts/agent_settings/mod.rs diff --git a/sidecar/src/mcts/agent_settings/settings.rs b/larp/src/mcts/agent_settings/settings.rs similarity index 100% rename from sidecar/src/mcts/agent_settings/settings.rs rename to larp/src/mcts/agent_settings/settings.rs diff --git a/sidecar/src/mcts/decider/decider.rs b/larp/src/mcts/decider/decider.rs similarity index 100% rename from sidecar/src/mcts/decider/decider.rs rename to larp/src/mcts/decider/decider.rs diff --git a/sidecar/src/mcts/decider/error.rs b/larp/src/mcts/decider/error.rs similarity index 100% rename from sidecar/src/mcts/decider/error.rs rename to larp/src/mcts/decider/error.rs diff --git a/sidecar/src/mcts/decider/mod.rs b/larp/src/mcts/decider/mod.rs similarity index 100% rename from sidecar/src/mcts/decider/mod.rs rename to larp/src/mcts/decider/mod.rs diff --git a/sidecar/src/mcts/editor/anthropic_computer.rs b/larp/src/mcts/editor/anthropic_computer.rs similarity index 100% rename from sidecar/src/mcts/editor/anthropic_computer.rs rename to larp/src/mcts/editor/anthropic_computer.rs diff --git a/sidecar/src/mcts/editor/error.rs b/larp/src/mcts/editor/error.rs similarity index 100% rename from sidecar/src/mcts/editor/error.rs rename to larp/src/mcts/editor/error.rs diff --git a/sidecar/src/mcts/editor/mod.rs b/larp/src/mcts/editor/mod.rs similarity index 100% rename from sidecar/src/mcts/editor/mod.rs rename to larp/src/mcts/editor/mod.rs diff --git a/sidecar/src/mcts/execution/error.rs b/larp/src/mcts/execution/error.rs similarity index 100% rename from sidecar/src/mcts/execution/error.rs rename to larp/src/mcts/execution/error.rs diff --git a/sidecar/src/mcts/execution/inference.rs b/larp/src/mcts/execution/inference.rs similarity index 100% rename from sidecar/src/mcts/execution/inference.rs rename to larp/src/mcts/execution/inference.rs diff --git a/sidecar/src/mcts/execution/mod.rs b/larp/src/mcts/execution/mod.rs similarity index 100% rename from sidecar/src/mcts/execution/mod.rs rename to larp/src/mcts/execution/mod.rs diff --git a/sidecar/src/mcts/feedback/error.rs b/larp/src/mcts/feedback/error.rs similarity index 100% rename from sidecar/src/mcts/feedback/error.rs rename to larp/src/mcts/feedback/error.rs diff --git a/sidecar/src/mcts/feedback/feedback.rs b/larp/src/mcts/feedback/feedback.rs similarity index 100% rename from sidecar/src/mcts/feedback/feedback.rs rename to larp/src/mcts/feedback/feedback.rs diff --git a/sidecar/src/mcts/feedback/mod.rs b/larp/src/mcts/feedback/mod.rs similarity index 100% rename from sidecar/src/mcts/feedback/mod.rs rename to larp/src/mcts/feedback/mod.rs diff --git a/sidecar/src/mcts/mod.rs b/larp/src/mcts/mod.rs similarity index 100% rename from sidecar/src/mcts/mod.rs rename to larp/src/mcts/mod.rs diff --git a/sidecar/src/mcts/selector/mod.rs b/larp/src/mcts/selector/mod.rs similarity index 100% rename from sidecar/src/mcts/selector/mod.rs rename to larp/src/mcts/selector/mod.rs diff --git a/sidecar/src/mcts/selector/selector.rs b/larp/src/mcts/selector/selector.rs similarity index 100% rename from sidecar/src/mcts/selector/selector.rs rename to larp/src/mcts/selector/selector.rs diff --git a/sidecar/src/mcts/selector/uct_score.rs b/larp/src/mcts/selector/uct_score.rs similarity index 100% rename from sidecar/src/mcts/selector/uct_score.rs rename to larp/src/mcts/selector/uct_score.rs diff --git a/sidecar/src/mcts/value_function/error.rs b/larp/src/mcts/value_function/error.rs similarity index 100% rename from sidecar/src/mcts/value_function/error.rs rename to larp/src/mcts/value_function/error.rs diff --git a/sidecar/src/mcts/value_function/mod.rs b/larp/src/mcts/value_function/mod.rs similarity index 100% rename from sidecar/src/mcts/value_function/mod.rs rename to larp/src/mcts/value_function/mod.rs diff --git a/sidecar/src/mcts/value_function/reward.rs b/larp/src/mcts/value_function/reward.rs similarity index 100% rename from sidecar/src/mcts/value_function/reward.rs rename to larp/src/mcts/value_function/reward.rs diff --git a/sidecar/src/repo/filesystem.rs b/larp/src/repo/filesystem.rs similarity index 100% rename from sidecar/src/repo/filesystem.rs rename to larp/src/repo/filesystem.rs diff --git a/sidecar/src/repo/iterator.rs b/larp/src/repo/iterator.rs similarity index 100% rename from sidecar/src/repo/iterator.rs rename to larp/src/repo/iterator.rs diff --git a/sidecar/src/repo/mod.rs b/larp/src/repo/mod.rs similarity index 100% rename from sidecar/src/repo/mod.rs rename to larp/src/repo/mod.rs diff --git a/sidecar/src/repo/state.rs b/larp/src/repo/state.rs similarity index 100% rename from sidecar/src/repo/state.rs rename to larp/src/repo/state.rs diff --git a/sidecar/src/repo/types.rs b/larp/src/repo/types.rs similarity index 100% rename from sidecar/src/repo/types.rs rename to larp/src/repo/types.rs diff --git a/sidecar/src/repomap/analyser.rs b/larp/src/repomap/analyser.rs similarity index 100% rename from sidecar/src/repomap/analyser.rs rename to larp/src/repomap/analyser.rs diff --git a/sidecar/src/repomap/error.rs b/larp/src/repomap/error.rs similarity index 100% rename from sidecar/src/repomap/error.rs rename to larp/src/repomap/error.rs diff --git a/sidecar/src/repomap/file/errors.rs b/larp/src/repomap/file/errors.rs similarity index 100% rename from sidecar/src/repomap/file/errors.rs rename to larp/src/repomap/file/errors.rs diff --git a/sidecar/src/repomap/file/git.rs b/larp/src/repomap/file/git.rs similarity index 100% rename from sidecar/src/repomap/file/git.rs rename to larp/src/repomap/file/git.rs diff --git a/sidecar/src/repomap/file/mod.rs b/larp/src/repomap/file/mod.rs similarity index 100% rename from sidecar/src/repomap/file/mod.rs rename to larp/src/repomap/file/mod.rs diff --git a/sidecar/src/repomap/files.rs b/larp/src/repomap/files.rs similarity index 100% rename from sidecar/src/repomap/files.rs rename to larp/src/repomap/files.rs diff --git a/sidecar/src/repomap/graph.rs b/larp/src/repomap/graph.rs similarity index 100% rename from sidecar/src/repomap/graph.rs rename to larp/src/repomap/graph.rs diff --git a/sidecar/src/repomap/helpers.rs b/larp/src/repomap/helpers.rs similarity index 100% rename from sidecar/src/repomap/helpers.rs rename to larp/src/repomap/helpers.rs diff --git a/sidecar/src/repomap/mod.rs b/larp/src/repomap/mod.rs similarity index 100% rename from sidecar/src/repomap/mod.rs rename to larp/src/repomap/mod.rs diff --git a/sidecar/src/repomap/tag.rs b/larp/src/repomap/tag.rs similarity index 100% rename from sidecar/src/repomap/tag.rs rename to larp/src/repomap/tag.rs diff --git a/sidecar/src/repomap/tree_context.rs b/larp/src/repomap/tree_context.rs similarity index 100% rename from sidecar/src/repomap/tree_context.rs rename to larp/src/repomap/tree_context.rs diff --git a/sidecar/src/repomap/tree_walker.rs b/larp/src/repomap/tree_walker.rs similarity index 100% rename from sidecar/src/repomap/tree_walker.rs rename to larp/src/repomap/tree_walker.rs diff --git a/sidecar/src/repomap/types.rs b/larp/src/repomap/types.rs similarity index 100% rename from sidecar/src/repomap/types.rs rename to larp/src/repomap/types.rs diff --git a/sidecar/src/reporting/axflow/client.rs b/larp/src/reporting/axflow/client.rs similarity index 100% rename from sidecar/src/reporting/axflow/client.rs rename to larp/src/reporting/axflow/client.rs diff --git a/sidecar/src/reporting/axflow/mod.rs b/larp/src/reporting/axflow/mod.rs similarity index 100% rename from sidecar/src/reporting/axflow/mod.rs rename to larp/src/reporting/axflow/mod.rs diff --git a/sidecar/src/reporting/mod.rs b/larp/src/reporting/mod.rs similarity index 100% rename from sidecar/src/reporting/mod.rs rename to larp/src/reporting/mod.rs diff --git a/sidecar/src/reporting/posthog/client.rs b/larp/src/reporting/posthog/client.rs similarity index 100% rename from sidecar/src/reporting/posthog/client.rs rename to larp/src/reporting/posthog/client.rs diff --git a/sidecar/src/reporting/posthog/mod.rs b/larp/src/reporting/posthog/mod.rs similarity index 100% rename from sidecar/src/reporting/posthog/mod.rs rename to larp/src/reporting/posthog/mod.rs diff --git a/sidecar/src/reranking/mod.rs b/larp/src/reranking/mod.rs similarity index 100% rename from sidecar/src/reranking/mod.rs rename to larp/src/reranking/mod.rs diff --git a/sidecar/src/reranking/snippet_reranking.rs b/larp/src/reranking/snippet_reranking.rs similarity index 100% rename from sidecar/src/reranking/snippet_reranking.rs rename to larp/src/reranking/snippet_reranking.rs diff --git a/sidecar/src/state/mod.rs b/larp/src/state/mod.rs similarity index 100% rename from sidecar/src/state/mod.rs rename to larp/src/state/mod.rs diff --git a/sidecar/src/state/schema_version.rs b/larp/src/state/schema_version.rs similarity index 100% rename from sidecar/src/state/schema_version.rs rename to larp/src/state/schema_version.rs diff --git a/sidecar/src/tree_printer/mod.rs b/larp/src/tree_printer/mod.rs similarity index 100% rename from sidecar/src/tree_printer/mod.rs rename to larp/src/tree_printer/mod.rs diff --git a/sidecar/src/tree_printer/tree.rs b/larp/src/tree_printer/tree.rs similarity index 100% rename from sidecar/src/tree_printer/tree.rs rename to larp/src/tree_printer/tree.rs diff --git a/sidecar/src/user_context/helpers.rs b/larp/src/user_context/helpers.rs similarity index 100% rename from sidecar/src/user_context/helpers.rs rename to larp/src/user_context/helpers.rs diff --git a/sidecar/src/user_context/mod.rs b/larp/src/user_context/mod.rs similarity index 100% rename from sidecar/src/user_context/mod.rs rename to larp/src/user_context/mod.rs diff --git a/sidecar/src/user_context/types.rs b/larp/src/user_context/types.rs similarity index 100% rename from sidecar/src/user_context/types.rs rename to larp/src/user_context/types.rs diff --git a/sidecar/src/webserver/agent.rs b/larp/src/webserver/agent.rs similarity index 100% rename from sidecar/src/webserver/agent.rs rename to larp/src/webserver/agent.rs diff --git a/sidecar/src/webserver/agent_stream.rs b/larp/src/webserver/agent_stream.rs similarity index 100% rename from sidecar/src/webserver/agent_stream.rs rename to larp/src/webserver/agent_stream.rs diff --git a/sidecar/src/webserver/agentic.rs b/larp/src/webserver/agentic.rs similarity index 100% rename from sidecar/src/webserver/agentic.rs rename to larp/src/webserver/agentic.rs diff --git a/sidecar/src/webserver/config.rs b/larp/src/webserver/config.rs similarity index 100% rename from sidecar/src/webserver/config.rs rename to larp/src/webserver/config.rs diff --git a/sidecar/src/webserver/context_trimming.rs b/larp/src/webserver/context_trimming.rs similarity index 100% rename from sidecar/src/webserver/context_trimming.rs rename to larp/src/webserver/context_trimming.rs diff --git a/sidecar/src/webserver/file_edit.rs b/larp/src/webserver/file_edit.rs similarity index 100% rename from sidecar/src/webserver/file_edit.rs rename to larp/src/webserver/file_edit.rs diff --git a/sidecar/src/webserver/health.rs b/larp/src/webserver/health.rs similarity index 100% rename from sidecar/src/webserver/health.rs rename to larp/src/webserver/health.rs diff --git a/sidecar/src/webserver/in_line_agent.rs b/larp/src/webserver/in_line_agent.rs similarity index 100% rename from sidecar/src/webserver/in_line_agent.rs rename to larp/src/webserver/in_line_agent.rs diff --git a/sidecar/src/webserver/in_line_agent_stream.rs b/larp/src/webserver/in_line_agent_stream.rs similarity index 100% rename from sidecar/src/webserver/in_line_agent_stream.rs rename to larp/src/webserver/in_line_agent_stream.rs diff --git a/sidecar/src/webserver/inline_completion.rs b/larp/src/webserver/inline_completion.rs similarity index 100% rename from sidecar/src/webserver/inline_completion.rs rename to larp/src/webserver/inline_completion.rs diff --git a/sidecar/src/webserver/mod.rs b/larp/src/webserver/mod.rs similarity index 100% rename from sidecar/src/webserver/mod.rs rename to larp/src/webserver/mod.rs diff --git a/sidecar/src/webserver/model_selection.rs b/larp/src/webserver/model_selection.rs similarity index 100% rename from sidecar/src/webserver/model_selection.rs rename to larp/src/webserver/model_selection.rs diff --git a/sidecar/src/webserver/plan.rs b/larp/src/webserver/plan.rs similarity index 100% rename from sidecar/src/webserver/plan.rs rename to larp/src/webserver/plan.rs diff --git a/sidecar/src/webserver/tree_sitter.rs b/larp/src/webserver/tree_sitter.rs similarity index 100% rename from sidecar/src/webserver/tree_sitter.rs rename to larp/src/webserver/tree_sitter.rs diff --git a/sidecar/src/webserver/types.rs b/larp/src/webserver/types.rs similarity index 100% rename from sidecar/src/webserver/types.rs rename to larp/src/webserver/types.rs diff --git a/package_windows_bin.sh b/package_windows_bin.sh index 15a972809..b6d89d2b2 100644 --- a/package_windows_bin.sh +++ b/package_windows_bin.sh @@ -5,7 +5,7 @@ pathsToZip="target/release/webserver.exe" # ❓ how does zip and non-zip compare for windows? # Destination of the zip file -zipFileDestination="sidecar.zip" +zipFileDestination="larp.zip" # Use 7z command to create the archive -7z a -tzip $zipFileDestination $pathsToZip \ No newline at end of file +7z a -tzip $zipFileDestination $pathsToZip diff --git a/package_windows_zip.sh b/package_windows_zip.sh index 9581f9936..cd1be3bac 100755 --- a/package_windows_zip.sh +++ b/package_windows_zip.sh @@ -4,4 +4,4 @@ # https://medium.com/@mr.pankajbahekar/cross-comiple-rust-binaries-on-mac-m1-a252e3a8925e cargo build --target=x86_64-pc-windows-gnu --verbose --release -zip -r sidecar target/x86_64-pc-windows-gnu/release/webserver.exe \ No newline at end of file +zip -r larp target/x86_64-pc-windows-gnu/release/webserver.exe diff --git a/reproduce_error.py b/reproduce_error.py index 246fbe59b..810240bd6 100644 --- a/reproduce_error.py +++ b/reproduce_error.py @@ -4,8 +4,8 @@ def main(): # Try to list available tools in zed try: - result = subprocess.run(['cargo', 'run', '--bin', 'sidecar', '--', 'tools', 'list'], - cwd='sidecar', + result = subprocess.run(['cargo', 'run', '--bin', 'larp', '--', 'tools', 'list'], + cwd='larp', capture_output=True, text=True) print("Current tools available:") @@ -13,7 +13,7 @@ def main(): print("\nError output:") print(result.stderr) except Exception as e: - print(f"Error running sidecar: {e}") + print(f"Error running larp: {e}") if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/update_version.sh b/update_version.sh index a7eaef16a..dce0defc9 100755 --- a/update_version.sh +++ b/update_version.sh @@ -4,7 +4,7 @@ set -e cargo build --bin state export BINARY_VERSION_HASH=$(./target/debug/state) -export CARGO_PKG_VERSION=$(grep -m1 '^version = ' sidecar/Cargo.toml | cut -d '"' -f2) +export CARGO_PKG_VERSION=$(grep -m1 '^version = ' larp/Cargo.toml | cut -d '"' -f2) if [[ -z "${GH_TOKEN}" ]] && [[ -z "${GITHUB_TOKEN}" ]] && [[ -z "${GH_ENTERPRISE_TOKEN}" ]] && [[ -z "${GITHUB_ENTERPRISE_TOKEN}" ]]; then echo "Will not update version JSON because no GITHUB_TOKEN defined" @@ -74,7 +74,7 @@ git remote rm origin git remote add origin "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@${GH_HOST}/${VERSIONS_REPOSITORY}.git" &> /dev/null # update latest.json -VERSION_PATH="sidecar/${OS_NAME}/${ARCH}" +VERSION_PATH="larp/${OS_NAME}/${ARCH}" updateLatestVersion git pull origin main # in case another build just pushed @@ -104,4 +104,4 @@ if [[ "${GITHUB_ENV}" ]]; then echo "CARGO_PKG_VERSION=${CARGO_PKG_VERSION}" >> "${GITHUB_ENV}" fi -cd .. \ No newline at end of file +cd .. From 36474488f369c9542586befb788bbd7a5399f0cf Mon Sep 17 00:00:00 2001 From: 0xrinegade <101195284+0xrinegade@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:34:20 +0000 Subject: [PATCH 6/6] larp --- README.md | 142 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 103 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 6d6e4da91..fc66db557 100644 --- a/README.md +++ b/README.md @@ -27,19 +27,32 @@ ``` -