Allow edit tool to access files outside project (with confirmation) (#35221)

Now the edit tool can access files outside the current project (just
like the terminal tool can), but it's behind a prompt (unlike other edit
tool actions).

Release Notes:

- The edit tool can now access files outside the current project, but
only if the user grants it permission to.
This commit is contained in:
Richard Feldman 2025-07-28 14:01:34 -04:00 committed by GitHub
parent a57e4dc8a8
commit a55bd49c8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 618 additions and 26 deletions

View file

@ -216,7 +216,12 @@ pub trait Tool: 'static + Send + Sync {
/// Returns true if the tool needs the users's confirmation
/// before having permission to run.
fn needs_confirmation(&self, input: &serde_json::Value, cx: &App) -> bool;
fn needs_confirmation(
&self,
input: &serde_json::Value,
project: &Entity<Project>,
cx: &App,
) -> bool;
/// Returns true if the tool may perform edits.
fn may_perform_edits(&self) -> bool;

View file

@ -375,7 +375,12 @@ mod tests {
false
}
fn needs_confirmation(&self, _input: &serde_json::Value, _cx: &App) -> bool {
fn needs_confirmation(
&self,
_input: &serde_json::Value,
_project: &Entity<Project>,
_cx: &App,
) -> bool {
true
}