├── .gitignore
├── crates
├── code_assistant
│ ├── src
│ │ ├── utils
│ │ │ ├── mod.rs
│ │ │ └── content.rs
│ │ ├── mcp
│ │ │ ├── mod.rs
│ │ │ ├── server.rs
│ │ │ └── resources.rs
│ │ ├── tests
│ │ │ ├── mod.rs
│ │ │ ├── utils.rs
│ │ │ └── sandbox_tests.rs
│ │ ├── ui
│ │ │ ├── terminal
│ │ │ │ ├── mod.rs
│ │ │ │ └── state.rs
│ │ │ ├── gpui
│ │ │ │ ├── assets.rs
│ │ │ │ ├── content_renderer.rs
│ │ │ │ └── simple_renderers.rs
│ │ │ ├── mod.rs
│ │ │ └── streaming
│ │ │ │ └── mod.rs
│ │ ├── agent
│ │ │ └── mod.rs
│ │ ├── app
│ │ │ ├── terminal.rs
│ │ │ ├── server.rs
│ │ │ └── mod.rs
│ │ ├── tools
│ │ │ ├── core
│ │ │ │ ├── result.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── spec.rs
│ │ │ │ ├── render.rs
│ │ │ │ ├── tool.rs
│ │ │ │ └── dyn_tool.rs
│ │ │ ├── mod.rs
│ │ │ ├── impls
│ │ │ │ └── mod.rs
│ │ │ └── types.rs
│ │ ├── acp
│ │ │ └── mod.rs
│ │ ├── permissions
│ │ │ └── mod.rs
│ │ ├── session
│ │ │ └── mod.rs
│ │ ├── main.rs
│ │ └── logging.rs
│ ├── assets
│ │ └── icons
│ │ │ ├── generic_minimize.svg
│ │ │ ├── generic_maximize.svg
│ │ │ ├── plus.svg
│ │ │ ├── close.svg
│ │ │ ├── generic_restore.svg
│ │ │ ├── pencil.svg
│ │ │ ├── check.svg
│ │ │ ├── ellipsis.svg
│ │ │ ├── arrow_right.svg
│ │ │ ├── chevron_left.svg
│ │ │ ├── chevron_up.svg
│ │ │ ├── arrow_left.svg
│ │ │ ├── chevron_down.svg
│ │ │ ├── chevron_right.svg
│ │ │ ├── chevron_down_small.svg
│ │ │ ├── arrow_down.svg
│ │ │ ├── theme_dark.svg
│ │ │ ├── chevron_up_down.svg
│ │ │ ├── code.svg
│ │ │ ├── arrow_up.svg
│ │ │ ├── library.svg
│ │ │ ├── return.svg
│ │ │ ├── check_circle.svg
│ │ │ ├── rotate_ccw.svg
│ │ │ ├── rotate_cw.svg
│ │ │ ├── generic_close.svg
│ │ │ ├── code-xml.svg
│ │ │ ├── file_icons
│ │ │ ├── elixir.svg
│ │ │ ├── font.svg
│ │ │ ├── file.svg
│ │ │ ├── kotlin.svg
│ │ │ ├── magnifying_glass.svg
│ │ │ ├── css.svg
│ │ │ ├── html.svg
│ │ │ ├── project.svg
│ │ │ ├── video.svg
│ │ │ ├── toml.svg
│ │ │ ├── hash.svg
│ │ │ ├── folder.svg
│ │ │ ├── vue.svg
│ │ │ ├── graphql.svg
│ │ │ ├── git.svg
│ │ │ ├── code.svg
│ │ │ ├── package.svg
│ │ │ ├── archive.svg
│ │ │ ├── prisma.svg
│ │ │ ├── lock.svg
│ │ │ ├── camera.svg
│ │ │ ├── dart.svg
│ │ │ ├── phoenix.svg
│ │ │ ├── tcl.svg
│ │ │ ├── database.svg
│ │ │ ├── coffeescript.svg
│ │ │ ├── erlang.svg
│ │ │ ├── folder_open.svg
│ │ │ ├── java.svg
│ │ │ ├── image.svg
│ │ │ ├── docker.svg
│ │ │ ├── notebook.svg
│ │ │ ├── ruby.svg
│ │ │ ├── audio.svg
│ │ │ ├── eslint.svg
│ │ │ ├── info.svg
│ │ │ ├── book.svg
│ │ │ ├── prettier.svg
│ │ │ ├── conversations.svg
│ │ │ ├── fsharp.svg
│ │ │ ├── bun.svg
│ │ │ ├── c.svg
│ │ │ ├── cpp.svg
│ │ │ ├── heroku.svg
│ │ │ ├── haskell.svg
│ │ │ ├── terraform.svg
│ │ │ ├── python.svg
│ │ │ ├── r.svg
│ │ │ ├── astro.svg
│ │ │ ├── scala.svg
│ │ │ ├── swift.svg
│ │ │ ├── elm.svg
│ │ │ ├── nim.svg
│ │ │ ├── go.svg
│ │ │ ├── typescript.svg
│ │ │ ├── ocaml.svg
│ │ │ ├── rust.svg
│ │ │ ├── javascript.svg
│ │ │ └── lua.svg
│ │ │ ├── menu.svg
│ │ │ ├── circle_stop.svg
│ │ │ ├── ellipsis_vertical.svg
│ │ │ ├── list_tree.svg
│ │ │ ├── search_code.svg
│ │ │ ├── delete.svg
│ │ │ ├── file_generic.svg
│ │ │ ├── panel_left_open.svg
│ │ │ ├── panel_left_close.svg
│ │ │ ├── panel_right_close.svg
│ │ │ ├── panel_right_open.svg
│ │ │ ├── maximize.svg
│ │ │ ├── minimize.svg
│ │ │ ├── file_code.svg
│ │ │ ├── braces.svg
│ │ │ ├── magnifying_glass.svg
│ │ │ ├── reveal.svg
│ │ │ ├── expand_vertical.svg
│ │ │ ├── trash.svg
│ │ │ ├── send.svg
│ │ │ ├── square-pen.svg
│ │ │ ├── settings_alt.svg
│ │ │ ├── file_tree.svg
│ │ │ ├── theme_light.svg
│ │ │ ├── stop.svg
│ │ │ ├── ai_google.svg
│ │ │ ├── ai_anthropic.svg
│ │ │ ├── caret_up.svg
│ │ │ ├── caret_down.svg
│ │ │ ├── text_snippet.svg
│ │ │ ├── arrow_circle.svg
│ │ │ ├── exit.svg
│ │ │ ├── history_rerun.svg
│ │ │ ├── brain.svg
│ │ │ ├── terminal.svg
│ │ │ ├── LICENSES
│ │ │ ├── ai_mistral.svg
│ │ │ ├── rerun.svg
│ │ │ ├── person.svg
│ │ │ ├── ai_open_router.svg
│ │ │ ├── message_bubbles.svg
│ │ │ ├── replace_next.svg
│ │ │ ├── ai_sap.svg
│ │ │ ├── replace_all.svg
│ │ │ ├── settings.svg
│ │ │ ├── link.svg
│ │ │ ├── ai_open_ai.svg
│ │ │ ├── ai_cerebras.svg
│ │ │ ├── replace.svg
│ │ │ └── ai_groq.svg
│ ├── resources
│ │ ├── system_prompts
│ │ │ ├── mapping.json
│ │ │ └── claude.md
│ │ ├── tool_use_intro.md
│ │ └── compaction_prompt.md
│ └── Cargo.toml
├── sandbox
│ ├── src
│ │ ├── seatbelt_network_policy.sbpl
│ │ ├── context.rs
│ │ ├── seatbelt_base_policy.sbpl
│ │ └── seatbelt.rs
│ └── Cargo.toml
├── fs_explorer
│ ├── src
│ │ └── lib.rs
│ └── Cargo.toml
├── web
│ ├── src
│ │ ├── lib.rs
│ │ └── tests.rs
│ └── Cargo.toml
├── command_executor
│ ├── Cargo.toml
│ └── src
│ │ └── lib.rs
└── llm
│ ├── Cargo.toml
│ └── src
│ ├── openrouter.rs
│ ├── aicore
│ ├── types.rs
│ └── mod.rs
│ ├── groq.rs
│ ├── auth.rs
│ ├── lib.rs
│ └── streaming.rs
├── Cargo.toml
├── .github
└── workflows
│ └── build.yml
├── LICENSE
├── models.example.json
└── docs
└── agent-client-protocol
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /sessions
3 | mcp-config.json
4 | .code-assistant.state.json
5 | /.code-assistant-chats
6 | tarpaulin-report.html
7 | .DS_Store
8 | code-assistant
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/utils/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod content;
2 | mod writer;
3 |
4 | #[cfg(test)]
5 | pub use writer::MockWriter;
6 | pub use writer::{MessageWriter, StdoutWriter};
7 |
--------------------------------------------------------------------------------
/Cargo.toml:
--------------------------------------------------------------------------------
1 | [workspace]
2 | members = ["crates/code_assistant", "crates/command_executor", "crates/fs_explorer", "crates/llm", "crates/sandbox", "crates/web"]
3 |
4 | resolver = "2"
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/mcp/mod.rs:
--------------------------------------------------------------------------------
1 | mod handler;
2 | mod resources;
3 | mod server;
4 | mod types;
5 |
6 | #[cfg(test)]
7 | mod tests;
8 |
9 | pub use server::MCPServer;
10 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/tests/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod format_on_save_tests;
2 | pub mod gitignore_tests;
3 | pub mod integration_tests;
4 | pub mod mocks;
5 | pub mod sandbox_tests;
6 | pub mod utils;
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/generic_minimize.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/sandbox/src/seatbelt_network_policy.sbpl:
--------------------------------------------------------------------------------
1 | (allow network-outbound
2 | (remote tcp "*:0-65535")
3 | (remote udp "*:0-65535")
4 | (remote tcp6 "*:0-65535")
5 | (remote udp6 "*:0-65535"))
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/generic_maximize.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/fs_explorer/src/lib.rs:
--------------------------------------------------------------------------------
1 | pub mod encoding;
2 | mod explorer;
3 | pub mod file_updater;
4 | pub mod types;
5 |
6 | pub use explorer::{Explorer, is_path_gitignored};
7 | pub use file_updater::*;
8 | pub use types::*;
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/plus.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/sandbox/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "sandbox"
3 | version = "0.1.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | serde = { version = "1.0.215", features = ["derive"] }
8 | thiserror = "1.0.69"
9 | tempfile = "3.13.0"
10 |
--------------------------------------------------------------------------------
/crates/web/src/lib.rs:
--------------------------------------------------------------------------------
1 | mod client;
2 | mod perplexity;
3 | #[cfg(test)]
4 | mod tests;
5 | pub use client::{PageMetadata, WebClient, WebPage, WebSearchResult};
6 | pub use perplexity::{PerplexityCitation, PerplexityClient, PerplexityMessage, PerplexityResponse};
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/ui/terminal/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod app;
2 | pub mod commands;
3 | pub mod input;
4 | pub mod message;
5 | pub mod renderer;
6 | pub mod state;
7 | pub mod tool_widget;
8 | pub mod ui;
9 |
10 | pub use app::TerminalTuiApp as TerminalApp;
11 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/close.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/generic_restore.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/pencil.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/check.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/ellipsis.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/arrow_right.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/chevron_left.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/chevron_up.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/arrow_left.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/chevron_down.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/chevron_right.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/chevron_down_small.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/agent/mod.rs:
--------------------------------------------------------------------------------
1 | #[cfg(test)]
2 | mod tests;
3 |
4 | pub mod persistence;
5 | pub mod runner;
6 | pub mod types;
7 |
8 | pub use crate::types::ToolSyntax;
9 | // pub use persistence::FileStatePersistence;
10 | pub use runner::{Agent, AgentComponents};
11 | pub use types::ToolExecution;
12 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/arrow_down.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/theme_dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/chevron_up_down.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/code.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/arrow_up.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/library.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/return.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/command_executor/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "command_executor"
3 | version = "0.1.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | anyhow = "1.0.95"
8 | async-trait = "0.1.85"
9 | tokio = { version = "1.40.0", features = ["macros", "process", "io-util"] }
10 | sandbox = { path = "../sandbox" }
11 | tracing = "0.1"
12 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/check_circle.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/rotate_ccw.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/rotate_cw.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/app/terminal.rs:
--------------------------------------------------------------------------------
1 | use super::AgentRunConfig;
2 | use crate::ui::terminal::TerminalApp;
3 | use anyhow::Result;
4 |
5 | pub async fn run(config: AgentRunConfig) -> Result<()> {
6 | // Use the new terminal UI implementation
7 | let terminal_app = TerminalApp::new();
8 | terminal_app.run(&config).await
9 | }
10 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/generic_close.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/tools/core/result.rs:
--------------------------------------------------------------------------------
1 | /// Trait for determining whether a tool execution was successful
2 | pub trait ToolResult: Send + Sync + 'static {
3 | /// Returns whether the tool execution was successful
4 | /// This is used for status reporting and can affect how the result is displayed
5 | fn is_success(&self) -> bool;
6 | }
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/code-xml.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/elixir.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/menu.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/circle_stop.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/ellipsis_vertical.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/font.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/resources/system_prompts/mapping.json:
--------------------------------------------------------------------------------
1 | {
2 | "default_prompt": "default.md",
3 | "prompts": [
4 | {
5 | "file": "claude.md",
6 | "model_substrings": [
7 | "claude"
8 | ]
9 | },
10 | {
11 | "file": "codex.md",
12 | "model_substrings": [
13 | "codex"
14 | ]
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/list_tree.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/search_code.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/delete.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_generic.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/file.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/panel_left_open.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/acp/mod.rs:
--------------------------------------------------------------------------------
1 | mod agent;
2 | pub mod error_handling;
3 | mod explorer;
4 | mod terminal_executor;
5 | mod types;
6 | mod ui;
7 |
8 | pub use agent::{set_acp_client_connection, ACPAgentImpl};
9 | pub use explorer::{register_fs_worker, AcpProjectManager};
10 | pub use terminal_executor::{register_terminal_worker, ACPTerminalCommandExecutor};
11 | pub use ui::ACPUserUI;
12 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/panel_left_close.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/panel_right_close.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/panel_right_open.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/maximize.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/minimize.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/app/server.rs:
--------------------------------------------------------------------------------
1 | use crate::logging::setup_logging;
2 | use crate::mcp::MCPServer;
3 | use anyhow::Result;
4 |
5 | pub async fn run(verbose: bool) -> Result<()> {
6 | // Setup logging based on verbose flag
7 | setup_logging(if verbose { 1 } else { 0 }, false);
8 |
9 | // Initialize server
10 | let mut server = MCPServer::new()?;
11 | server.run().await
12 | }
13 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/resources/tool_use_intro.md:
--------------------------------------------------------------------------------
1 | TOOL USE
2 |
3 | You have access to a set of tools. You can use multiple tools per turn, as long as one tool would not depend on the output of a previous tool you generated in the same turn. You will receive the result of the tool use in the user's response. You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use.
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_code.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/braces.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/magnifying_glass.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/reveal.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/expand_vertical.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/trash.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/magnifying_glass.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/send.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/css.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/square-pen.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/tools/core/mod.rs:
--------------------------------------------------------------------------------
1 | // Core tools implementation
2 | pub mod dyn_tool;
3 | pub mod registry;
4 | pub mod render;
5 | pub mod result;
6 | pub mod spec;
7 | pub mod tool;
8 |
9 | // Re-export all core components for easier imports
10 | pub use dyn_tool::AnyOutput;
11 | pub use registry::ToolRegistry;
12 | pub use render::{Render, ResourcesTracker};
13 | pub use result::ToolResult;
14 | pub use spec::{ToolScope, ToolSpec};
15 | pub use tool::{Tool, ToolContext};
16 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/html.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/project.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/video.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/settings_alt.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_tree.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/theme_light.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/resources/compaction_prompt.md:
--------------------------------------------------------------------------------
1 |
2 | The conversation history is nearing the model's context window limit. Provide a thorough summary that allows resuming the task without the earlier messages. Include:
3 | - The current objectives or tasks.
4 | - Key actions taken so far and their outcomes.
5 | - Important files, commands, or decisions that matter for continuing.
6 | - Outstanding questions or follow-up work that still needs attention.
7 | Respond with plain text only.
8 |
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/toml.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/hash.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/stop.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/folder.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/fs_explorer/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "fs_explorer"
3 | version = "0.1.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | anyhow = "1.0.95"
8 | async-trait = "0.1.85"
9 | command_executor = { path = "../command_executor" }
10 | content_inspector = "0.2.4"
11 | encoding_rs = "0.8.35"
12 | glob = "0.3.1"
13 | ignore = "0.4.23"
14 | regex = "1.11.1"
15 | serde = { version = "1.0.215", features = ["derive"] }
16 | tracing = "0.1.40"
17 | path-clean = "1.0.1"
18 |
19 | [dev-dependencies]
20 | tempfile = "3.13.0"
21 | tokio = { version = "1.40.0", features = ["macros", "rt-multi-thread"] }
22 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/ai_google.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/vue.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/ai_anthropic.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/caret_up.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/caret_down.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/crates/web/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "web"
3 | version = "0.1.19"
4 | edition = "2021"
5 |
6 | [dependencies]
7 | anyhow = "1.0"
8 | async-trait = "0.1"
9 | chromiumoxide = { version = "0.5", features = ["tokio-runtime"] }
10 | futures = "0.3"
11 | htmd = "0.1.6"
12 | percent-encoding = "2.3"
13 | regex = "1.12"
14 | reqwest = { version = "0.11", features = ["json", "stream"] }
15 | scraper = "0.18"
16 | serde = { version = "1.0", features = ["derive"] }
17 | serde_json = "1.0"
18 | tempfile = "3.23"
19 | tokio = { version = "1.48", features = ["full"] }
20 | url = "2.5"
21 |
22 | [dev-dependencies]
23 | axum = "0.7"
24 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/graphql.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/git.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/text_snippet.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/code.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/package.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/archive.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/tests/utils.rs:
--------------------------------------------------------------------------------
1 | use crate::tools::{ParserRegistry, ToolRequest};
2 | use crate::types::ToolSyntax;
3 | use anyhow::Result;
4 |
5 | /// Parse tool requests from LLM response and return both requests and truncated response after first tool
6 | /// This is a wrapper that defaults to XML parsing for backward compatibility
7 | pub fn parse_and_truncate_llm_response(
8 | response: &llm::LLMResponse,
9 | request_id: u64,
10 | ) -> Result<(Vec, llm::LLMResponse)> {
11 | // Default to XML parser for backward compatibility with existing tests
12 | let parser = ParserRegistry::get(ToolSyntax::Xml);
13 | parser.extract_requests(response, request_id, 0)
14 | }
15 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/prisma.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/lock.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/app/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod acp;
2 | pub mod gpui;
3 | pub mod server;
4 | pub mod terminal;
5 |
6 | use crate::types::ToolSyntax;
7 | use sandbox::SandboxPolicy;
8 |
9 | use std::path::PathBuf;
10 |
11 | /// Configuration for running the agent in either terminal or GPUI mode
12 | #[derive(Debug, Clone)]
13 | pub struct AgentRunConfig {
14 | pub path: PathBuf,
15 | pub task: Option,
16 | pub continue_task: bool,
17 | pub model: String,
18 | pub tool_syntax: ToolSyntax,
19 | pub use_diff_format: bool,
20 | pub record: Option,
21 | pub playback: Option,
22 | pub fast_playback: bool,
23 | pub sandbox_policy: SandboxPolicy,
24 | }
25 |
--------------------------------------------------------------------------------
/crates/llm/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "llm"
3 | version = "0.1.19"
4 | edition = "2021"
5 |
6 | [dependencies]
7 | anyhow = "1.0"
8 | async-trait = "0.1"
9 | serde = { version = "1.0", features = ["derive"] }
10 | serde_json = "1.0"
11 | reqwest = { version = "0.11", features = ["json", "stream"] }
12 | tokio = { version = "1.48", features = ["full"] }
13 | futures = "0.3"
14 | tracing = "0.1"
15 | oauth2 = "4.4"
16 | base64 = "0.21"
17 | keyring = "2.3"
18 | chrono = { version = "0.4", features = ["serde"] }
19 | tempfile = "3.23"
20 | thiserror = "1.0"
21 | regex = "1.12"
22 | dirs = "5.0"
23 | clap = { version = "4.5", features = ["derive"] }
24 |
25 | [dev-dependencies]
26 | axum = "0.7"
27 | bytes = "1.10"
28 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/camera.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/dart.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/phoenix.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/tcl.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/database.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/tools/mod.rs:
--------------------------------------------------------------------------------
1 | // Original tools implementation
2 | mod parse;
3 | mod types;
4 |
5 | // Parser registry for different tool syntaxes
6 | pub mod parser_registry;
7 |
8 | // System message generation
9 | pub mod system_message;
10 |
11 | // Tool use filtering system
12 | pub mod tool_use_filter;
13 |
14 | // Tool formatter system
15 | pub mod formatter;
16 |
17 | // New trait-based tools implementation
18 | pub mod core;
19 | pub mod impls;
20 |
21 | #[cfg(test)]
22 | mod tests;
23 |
24 | pub use parse::{parse_caret_tool_invocations, parse_xml_tool_invocations};
25 | pub use parser_registry::ParserRegistry;
26 | pub use system_message::generate_system_message;
27 | pub use types::{AnnotatedToolDefinition, ParseError, ToolRequest};
28 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/coffeescript.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/erlang.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/arrow_circle.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/folder_open.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/exit.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/history_rerun.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/brain.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/terminal.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches: ["main"]
6 | pull_request:
7 | branches: ["main"]
8 |
9 | env:
10 | CARGO_TERM_COLOR: always
11 |
12 | jobs:
13 | build:
14 | runs-on: macos-latest
15 |
16 | steps:
17 | - uses: actions/checkout@v4
18 | # - name: Install dependencies
19 | # run: |
20 | # sudo apt-get update
21 | # sudo apt-get install -y libxcb1-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libxkbcommon-x11-dev libx11-dev
22 | - name: Check formatting
23 | run: cargo fmt --all -- --check
24 | - name: Lint
25 | run: cargo clippy --locked --all-targets --all-features -- -D warnings
26 | - name: Build
27 | run: cargo build --locked --verbose
28 | - name: Run tests
29 | run: cargo test --locked --verbose
30 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/java.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/image.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/docker.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/notebook.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/crates/code_assistant/assets/icons/file_icons/ruby.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/crates/code_assistant/src/ui/gpui/assets.rs:
--------------------------------------------------------------------------------
1 | use anyhow::anyhow;
2 | use gpui::{AssetSource, Result, SharedString};
3 | use rust_embed::RustEmbed;
4 |
5 | #[derive(RustEmbed)]
6 | #[folder = "assets"]
7 | #[include = "icons/**/*"]
8 | #[exclude = "*.DS_Store"]
9 | pub struct Assets;
10 |
11 | impl AssetSource for Assets {
12 | fn load(&self, path: &str) -> Result