This PR includes design tweaks to elements involved on the "edit files"
flow: the bar that appears above the message editor, buttons on the
multibuffer hunks, adding keybindings to the "Review Changes" button,
etc.
<img
src="https://github.com/user-attachments/assets/4bff883a-c5c4-443e-8bf5-d98f535c83ce"
width="750" />
Release Notes:
- N/A
We decided to take this out for now. It doesn't seem necessary, and it
complicates the code a lot. We can always put it back later if desired.
Release Notes:
- N/A
This PR updates the ordering of the agent profiles in the tool selector
to respect the order they are defined in in the settings instead of
sorting them alphabetically.
This gives the user more control, and allows them to order the profiles
as they desire.
Release Notes:
- N/A
This PR decouples the scripting tool from the `Tool` trait while still
allowing it to be used as a tool from the model's perspective.
This will allow us to evolve the scripting tool as more of a first-class
citizen while still retaining the ability to have the model call it as a
regular tool.
Release Notes:
- N/A
We decided to expose scripting as tools again. We are aware of the UX
downsides of doing so, but we want to focus on getting it working well
first, and the model seems to make better use of it as an actual tool.
In the future, the tools API might support streaming. If it doesn't and
we need to ship, we can consider reverting this.
Release Notes:
- N/A
This PR makes refactors the scripting functionality to be a first-class
concept of the assistant instead of a generic tool, which will allow us
to build a more customized experience.
- The tool prompt has been slightly tweaked and is now included as a
system message in all conversations. I'm getting decent results, but now
that it isn't in the tools framework, it will probably require more
refining.
- The model will now include an `<eval ...>` tag at the end of the
message with the script. We parse this tag incrementally as it streams
in so that we can indicate that we are generating a script before we see
the closing `</eval>` tag. Later, this will help us interpret the script
as it arrives also.
- Threads now hold a `ScriptSession` entity which manages the state of
all scripts (from parsing to exited) in a centralized way, and will
later collect all script operations so they can be displayed in the UI.
- `script_tool` has been renamed to `assistant_scripting`
- Script source now opens in a regular read-only buffer
Note: We still need to handle persistence properly
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This PR removes the dependents of the `language_models` crate.
The following types have been moved from `language_models` to
`language_model` to facilitate this:
- `LlmApiToken`
- `RefreshLlmTokenListener`
- `MaxMonthlySpendReachedError`
- `PaymentRequiredError`
With this change only `zed` now depends on `language_models`.
Release Notes:
- N/A
Closes https://github.com/zed-industries/zed/issues/10122
Closes https://github.com/zed-industries/zed/issues/25034
When formatting buffers or reloading them after they change on disk, we
performed a diff between the buffer's current contents and the new
content. We need this diff in order preserve the positions of cursors
and other decorations when updating the buffer's text.
In order to handle changes within lines, we would previously compute a
*character-wise* diff. This was extremely expensive for large files.
This PR gets rid of the character-wise diff, and instead performs a
normal line-wise diff. Then, for certain replace hunks, we compute a
secondary word-based diff. Also, I've switched to the
[`imara-diff`](https://github.com/pascalkuthe/imara-diff) crate, instead
of `similar`.
Release Notes:
- Fixed a hang that could occur when large files were changed on disk or
formatted.
This PR extracts the streaming diff implementation to its own
`streaming_diff` crate.
It was duplicated between `assistant` and `assistant2`, but their
implementations were exactly the same (and I don't see a reason why they
would need to diverge).
Release Notes:
- N/A
This PR adds a new `prompt_library` crate and extracts the `PromptStore`
and `PromptBuilder` to it.
Eventually we'll want to house the `PromptLibrary` itself in this crate,
but right now that involves untangling a few dependencies.
Release Notes:
- N/A
This PR dedupes the `AssistantSettings` so we can use the same settings
for both Assistant1 and Assistant2.
We originally forked them so we could change the Assistant2 settings
freely, but given our rollout strategy for the new Assistant, I don't
think that makes sense.
This also fixes the issue where the JSON language server would show a
"Matches multiple schemas when only one must validate" warning in
`settings.json`.
Closes#23171.
Release Notes:
- Fixed the "Matches multiple schemas when only one must validate"
warning for the `assistant` setting.
This is behind the Assistant v2 feature flag. As @maxdeviant and I
discussed, the state is currently decoupled from the Assistant Panel's
state, although in the future we plan to introduce a way to refer to
conversations from the panel. Also, we're intentionally duplicating some
code with the v2 panel right now; the plan is to do a future PR to make
them share code more.
https://github.com/user-attachments/assets/bb163bd3-a02d-4a91-8f8f-2a8e60acbc34
It doesn't include the terminal inline assistant, which will be in a
separate PR.
Release Notes:
- N/A
This PR adds the ability to open past threads in Assistant 2.
There are also some mocked threads in the history for testing purposes.
Release Notes:
- N/A
This PR adds support to Assistant 2 for using tools provided by context
servers.
As part of this I introduced a new `ThreadStore`.
Release Notes:
- N/A
---------
Co-authored-by: Cole <cole@zed.dev>
This PR restructures the storage of the tool uses and results in
`assistant2` so that they don't live on the individual messages.
It also introduces a `LanguageModelToolUseId` newtype for better type
safety.
Release Notes:
- N/A
This PR adds rudimentary support for using tools to `assistant2`. There
are currently no visual affordances for tool use.
This is gated behind the `assistant-tool-use` feature flag.
<img width="1079" alt="Screenshot 2024-11-25 at 7 21 31 PM"
src="https://github.com/user-attachments/assets/64d6ca29-c592-4474-8e9d-c344f855bc63">
Release Notes:
- N/A