Commit graph

137 commits

Author SHA1 Message Date
Marshall Bowers
9143fd2924
language_model_selector: Don't recreate the Picker view each render (#21939)
While working on Assistant2, I noticed that the `LanguageModelSelector`
was recreating its `Picker` view on every single render.

This PR makes it so we create the view once and hold onto it in the
parent view.

Release Notes:

- N/A
2024-12-12 17:08:48 -05:00
Marshall Bowers
52c0d712a6
assistant2: Add initial support for attaching file context (#21934)
This PR adds the initial support for attaching files as context to a
thread in Assistant2.

Release Notes:

- N/A
2024-12-12 15:30:17 -05:00
Richard Feldman
bcf8a2f9fc
Inline terminal assistant v2 (#21888)
Follow-up to https://github.com/zed-industries/zed/pull/21828 to add it
to the terminal as well.


https://github.com/user-attachments/assets/505d1443-4081-4dd8-9725-17d85532f52d

As with the previous PR, there's plenty of code duplication here; the
plan is to do more code sharing in separate PRs!


Release Notes:

- N/A
2024-12-12 11:06:09 -05:00
Richard Feldman
c594ccb0af
Inline assistant v2 (#21828)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
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
2024-12-11 14:32:30 -05:00
Marshall Bowers
b3ffbea376
assistant2: Allow removing individual context (#21868)
This PR adds the ability to remove individual pieces of context from the
message editor:

<img width="1159" alt="Screenshot 2024-12-11 at 12 38 45 PM"
src="https://github.com/user-attachments/assets/77d04272-f667-4ebb-a567-84b382afef3d"
/>

Release Notes:

- N/A
2024-12-11 12:51:05 -05:00
Marshall Bowers
c255e55599
assistant2: Sketch in sending file context to model (#21829)
This PR sketches in support for sending file context attached to a
message to the model.

Right now the context is just mocked.

<img width="1159" alt="Screenshot 2024-12-10 at 4 18 41 PM"
src="https://github.com/user-attachments/assets/3ee4e86a-7893-42dc-98f9-982aa202d310">

<img width="1159" alt="Screenshot 2024-12-10 at 4 18 53 PM"
src="https://github.com/user-attachments/assets/8a3c2dd7-a466-4dbf-83ec-1c7d969c1a4b">

Release Notes:

- N/A
2024-12-10 16:35:53 -05:00
Marshall Bowers
c80ea60860
assistant2: Update to match latest designs (#21818)
This PR updates the Assistant2 panel to match the latest designs.

<img width="1159" alt="Screenshot 2024-12-10 at 11 49 14 AM"
src="https://github.com/user-attachments/assets/53739709-e7b9-4e35-8a5d-97b6560623ed">

Release Notes:

- N/A
2024-12-10 12:05:30 -05:00
Marshall Bowers
c8b3c4c6cd
assistant2: Add ability to delete past threads (#21607)
This PR adds the ability to delete past threads in Assistant2.

Release Notes:

- N/A
2024-12-05 15:57:35 -05:00
Marshall Bowers
787c75cbda
assistant2: Add thread history (#21599)
This PR adds support for thread history to the Assistant 2 panel.

We also now generate summaries for the threads.

<img width="986" alt="Screenshot 2024-12-05 at 12 56 53 PM"
src="https://github.com/user-attachments/assets/46cb1309-38a2-4ab9-9fcc-c1275d4b5f2c">

<img width="986" alt="Screenshot 2024-12-05 at 12 56 58 PM"
src="https://github.com/user-attachments/assets/8c91ba57-a6c5-4b88-be05-b22fb615ece5">

Release Notes:

- N/A

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-12-05 13:22:25 -05:00
Marshall Bowers
31796171de
assistant2: Sketch in context picker (#21560)
This PR sketches in a context picker into the message editor in
Assistant 2. Not functional yet.

<img width="1138" alt="Screenshot 2024-12-04 at 5 45 19 PM"
src="https://github.com/user-attachments/assets/053d6224-de76-4fde-914b-41fe835761eb">

Release Notes:

- N/A
2024-12-04 18:00:28 -05:00
Marshall Bowers
a30ea2fc68
assistant2: Factor out ActiveThread view (#21555)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR factors a new `ActiveThread` view out of the `AssistantPanel` to
group together the state that pertains solely to the active view.

There was a bunch of related state on the `AssistantPanel` pertaining to
the active thread that needed to be initialized/reset together and it
makes for a clearer narrative is this state is encapsulated in its own
view.

Release Notes:

- N/A
2024-12-04 16:39:39 -05:00
Marshall Bowers
0bde0f8e2f
assistant2: Add ability to open past threads (#21548)
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
2024-12-04 14:35:44 -05:00
Marshall Bowers
7cfc972df6
assistant2: Add empty state for new threads (#21542)
This PR adds an empty state for new threads in Assistant2:

<img width="1138" alt="Screenshot 2024-12-04 at 12 17 46 PM"
src="https://github.com/user-attachments/assets/ff7b4533-d3b8-4722-bd4b-43fac6d35a77">

This is mostly just a sketch in its current state.

Release Notes:

- N/A
2024-12-04 12:44:03 -05:00
Marshall Bowers
207eb51df1
assistant2: Style inline code in Markdown (#21536)
This PR adds some styling for inline code within the messages to
differentiate them from the surrounding text:

<img width="1138" alt="Screenshot 2024-12-04 at 10 58 14 AM"
src="https://github.com/user-attachments/assets/3bb92711-e2f7-454a-b4be-449c6a9bf591">


Release Notes:

- N/A
2024-12-04 11:14:35 -05:00
Marshall Bowers
9f459ba573
assistant2: Render messages as Markdown (#21496)
This PR updates Assistant 2 to render the messages in the thread as
Markdown:

<img width="1138" alt="Screenshot 2024-12-03 at 6 09 27 PM"
src="https://github.com/user-attachments/assets/c1c44fde-1efb-43cf-b9c9-768e6974c753">

Release Notes:

- N/A
2024-12-03 18:32:13 -05:00
Marshall Bowers
aca23da971
assistant2: Render messages in the thread using a list (#21491)
This PR updates the rendering of the messages in the current thread to
use a `gpui::list`.

Release Notes:

- N/A
2024-12-03 16:25:09 -05:00
Marshall Bowers
f3140f54d8
assistant2: Wire up error messages (#21426)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR wires up the error messages for Assistant 2 so that they are
shown to the user:

<img width="1138" alt="Screenshot 2024-12-02 at 4 28 02 PM"
src="https://github.com/user-attachments/assets/d8a5b9bd-0cef-4304-b561-b2edadbc70ef">
<img width="1138" alt="Screenshot 2024-12-02 at 4 29 09 PM"
src="https://github.com/user-attachments/assets/0dd70841-0d5a-4de6-bebe-82c563246b65">
<img width="1138" alt="Screenshot 2024-12-02 at 4 32 49 PM"
src="https://github.com/user-attachments/assets/a8838866-fad1-43a9-8935-490dc1936016">

@danilo-leal I kept the existing UX from Assistant 1, as I didn't see
any errors in the design prototype, but we can revisit if another
approach would work better.

Release Notes:

- N/A
2024-12-02 16:54:46 -05:00
Marshall Bowers
b88daae67b
assistant2: Add support for using tools provided by context servers (#21418)
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>
2024-12-02 15:01:18 -05:00
Marshall Bowers
8f1ec3d11b
assistant2: Add a checkbox to control tool use (#21215)
This PR adds a checkbox to the `assistant2` message editor to control
whether tools should be used for a given message.

Release Notes:

- N/A
2024-11-26 10:48:48 -05:00
Marshall Bowers
968ffaa3fd
assistant2: Restructure storage of tool uses and results (#21194)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
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
2024-11-25 21:53:27 -05:00
Marshall Bowers
7e418cc8af
assistant2: Style messages (#21191)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR styles the messages in `assistant2` so they don't look quite as
rough:

<img width="1138" alt="Screenshot 2024-11-25 at 8 36 32 PM"
src="https://github.com/user-attachments/assets/9cc423fa-feff-4c69-9d2b-d28970559547">

Release Notes:

- N/A
2024-11-25 20:49:03 -05:00
Marshall Bowers
f059b6a24b
assistant2: Add support for using tools (#21190)
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
2024-11-25 19:44:34 -05:00
Marshall Bowers
321fd19763
assistant2: Wire up assistant2::NewThread action (#21187)
This PR wires up the `assistant2::NewThread` action so that you can
create new threads.

Release Notes:

- N/A
2024-11-25 17:24:25 -05:00
Marshall Bowers
cc5daa22bd
assistant2: Improve tracking of pending completions (#21186)
This PR improves the tracking of pending completions in `assistant2`
such that we actually remove ones that have been completed.

Release Notes:

- N/A
2024-11-25 17:07:55 -05:00
Marshall Bowers
2b9250843c
assistant2: Include previous messages in the thread in the completion request (#21184)
This PR makes it so previous messages in the thread are included when
constructing the completion request, instead of only sending up the most
recent user message.

Release Notes:

- N/A
2024-11-25 16:51:32 -05:00
Marshall Bowers
e7b0047562
assistant2: Remove unnecessary Pane (#21183)
This PR removes an unnecessary `Pane` that was copied over from
`assistant::AssistantPanel` to `assistant2::AssistantPanel`.

Release Notes:

- N/A
2024-11-25 16:28:38 -05:00
Marshall Bowers
9ee1aba80a
assistant2: Stream in completion text (#21182)
This PR makes it so that the completion text streams into the message
list rather than being buffered until the end.

Release Notes:

- N/A
2024-11-25 16:13:27 -05:00
Marshall Bowers
a02684b2f7
assistant2: Add rudimentary chat functionality (#21178)
This PR adds in rudimentary functionality for sending messages to the
LLM in `assistant2`.

<img width="1079" alt="Screenshot 2024-11-25 at 1 49 11 PM"
src="https://github.com/user-attachments/assets/5accb749-c034-4fb2-bf55-3ae5bc9529ad">

Release Notes:

- N/A
2024-11-25 14:08:40 -05:00
Nathan Sobo
08b214dfb9
Rename 'chat' to 'thread' in assistant2 (#21141)
Release Notes:

- N/A
2024-11-25 07:27:35 -05:00
Marshall Bowers
628b96f297
assistant2: Sketch in chat editor (#21116)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR sketches in the chat editor for `assistant2`.

<img width="1136" alt="Screenshot 2024-11-23 at 1 56 23 PM"
src="https://github.com/user-attachments/assets/6e979995-c0cf-4a46-8694-fc4a8646336f">

Release Notes:

- N/A
2024-11-23 14:09:15 -05:00
Marshall Bowers
2a23db6e05
assistant2: Sketch in toolbar (#21114)
This PR sketches in the toolbar for `assistant2`.

<img width="1136" alt="Screenshot 2024-11-23 at 12 39 49 PM"
src="https://github.com/user-attachments/assets/ed56fc36-54c8-48d4-8446-6c1f182fcef2">

Release Notes:

- N/A
2024-11-23 12:46:11 -05:00
Marshall Bowers
9adc3b4e82
Break ground on assistant2 (#21109)
This PR breaks ground on a new `assistant2` crate.

In order to see this new version of the assistant, both of the following
must be true:
1. The `assistant2` feature flag is enabled for your user
   - It is **not** currently enabled for all staff.
2. You are running a development build of Zed

The intent here is to enable the folks working on `assistant2` to
incrementally land work onto `main` without breaking use of the current
Assistant for anyone.

<img width="1136" alt="Screenshot 2024-11-23 at 10 46 08 AM"
src="https://github.com/user-attachments/assets/5723a13f-5be1-4486-9460-ead7329ba78e">

Release Notes:

- N/A
2024-11-23 11:24:52 -05:00
Antonio Scandurra
b466a8b828
Remove the assistant2 crate (#12380)
Release Notes:

- N/A
2024-05-28 16:26:35 +02:00
Nathan Sobo
e19339bc1d
Allow UI font weight to be assigned in settings (#12333)
Release Notes:

- Added the ability to configure the weight of your UI font in standard
CSS weight units from 0 to 900.
2024-05-26 23:06:58 -06:00
Mikayla Maki
a9e3d4ec4e
Improve context expansion (#10957)
Release Notes:

- Improved expand excerpt indicators to allow unidirectional expansion.
Also added the `editor::ExpandExcerptsUp` and
`editor::ExpandExcerptsDown` actions, which can both take a `lines`
parameter. Also added a `expand_excerpt_lines` setting which controls
the default number of lines that the indicators and actions use.

---------

Co-authored-by: conrad <conrad@zed.dev>
2024-05-26 16:30:09 -07:00
Antonio Scandurra
57d570c281
Introduce custom fold placeholders (#12214)
This pull request replaces the static `⋯` character we used to insert
when folding a range with a custom render function that return an
`AnyElement`. We plan to use this in the assistant, but for now this
should be behavior-preserving.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-05-23 15:22:30 -06:00
Nathan Sobo
ea166f0b27
Add a send button to the assistant (#12171)
![CleanShot 2024-05-22 at 18 20
45@2x](https://github.com/zed-industries/zed/assets/1789/dac9fcde-9fcb-4c40-b5da-ebdc847b3962)

Include the keybinding to help people discover how to submit from the
keyboard.

I'm also shifting from the word "Conversation" to "Context".

Release Notes:

- Added a send button to the assistant panel.
2024-05-22 19:17:28 -06:00
Conrad Irwin
1f611a9c90
Allow copy-pasting dev-server-token (#11992)
Release Notes:

- N/A
2024-05-17 16:41:46 -06:00
Marshall Bowers
13bbaf1e18
Use UpdateGlobal accessors in more places (#11925)
This PR updates a number of instances that were previously using
`cx.update_global` to use `UpdateGlobal::update_global` instead.

Release Notes:

- N/A
2024-05-16 13:30:04 -04:00
Marshall Bowers
c1e291bc96
gpui: Improve Global ergonomics (#11923)
This PR adds some ergonomic improvements when working with GPUI
`Global`s.

Two new traits have been added—`ReadGlobal` and `UpdateGlobal`—that
provide associated functions on any type that implements `Global` for
accessing and updating the global without needing to call the methods on
the `cx` directly (which generally involves qualifying the type).

I looked into adding `ObserveGlobal` as well, but this seems a bit
trickier to implement as the signatures of `cx.observe_global` vary
slightly between the different contexts.

Release Notes:

- N/A
2024-05-16 12:47:43 -04:00
Kyle Kelley
c71cfd5da4
Change ToolOutput to ToolView (#11682)
Additionally, the internal `ToolView` trait used by the registry is now
called `InternalToolView`.

This should make it a bit easier to understand that the `ToolView` is
intended for a `gpui::View` (implementing `Render`). It does still feel
like more could be merged here but I think the built tools are now a bit
clearer.

Release Notes:

- N/A
2024-05-10 15:22:09 -07:00
Conrad Irwin
5515ba6043
Extract http from util (#11680)
This avoids the CLI linking libssl etc...

Release Notes:

- N/A
2024-05-10 15:50:20 -06:00
Kyle Kelley
38f110852f
Improve prompts for tools (#11669)
Improves the descriptions for some of the tools. I wish we had metrics
to back up changes in how the model responds to tool schema changes so
anecdotally I'm just going to say this _seems_ improved.

Release Notes:

- N/A
2024-05-10 13:18:05 -07:00
Antonio Scandurra
358bc2d225
Replace rich_text with markdown in assistant2 (#11650)
We don't implement copy yet but it should be pretty straightforward to
add.


https://github.com/zed-industries/zed/assets/482957/6b4d7c34-de6b-4b07-aed9-608c771bbbdb

/cc: @rgbkrk @maxbrunsfeld @maxdeviant 

Release Notes:

- N/A
2024-05-10 10:22:14 +02:00
Kyle Kelley
9cef0ac869
Cleanup tool registry API surface (#11637)
Fast followups to #11629 

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-05-09 16:43:27 -07:00
Kyle Kelley
50c45c7897
Streaming tools (#11629)
Stream characters in for tool calls to allow rendering partial input.


https://github.com/zed-industries/zed/assets/836375/0f023a4b-9c46-4449-ae69-8b6bcab41673

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-05-09 15:57:14 -07:00
Marshall Bowers
27ed0f4273
assistant2: Render saved conversations inline instead of in a modal (#11630)
This PR reworks how saved conversations are rendered in the new
assistant panel.

Instead of rendering them in a modal we now display them in the panel
itself:

<img width="402" alt="Screenshot 2024-05-09 at 6 18 40 PM"
src="https://github.com/zed-industries/zed/assets/1486634/82decc04-cb31-4d83-a942-7e8426e02679">

Release Notes:

- N/A
2024-05-09 18:29:08 -04:00
Marshall Bowers
c73ef1a5f3
assistant2: List saved conversations from disk (#11627)
This PR updates the saved conversation picker to use a list of
conversations retrieved from disk instead of the static placeholder
values.

Release Notes:

- N/A
2024-05-09 16:17:07 -04:00
Max Brunsfeld
a7aa2578e1
Implement serialization of assistant conversations, including tool calls and attachments (#11577)
Release Notes:

- N/A

---------

Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2024-05-08 17:52:15 -04:00
Nate Butler
d103903229
Style header for assistant2 (#11570)
Release Notes:

- N/A
2024-05-08 14:17:07 -04:00