zed/assets/icons
Nate Butler f8672289fc
Add prompt library (#11910)
This PR adds a Prompt Library to Zed, powering custom prompts and any
default prompts we want to package with the assistant.

These are useful for:

- Creating a "default prompt" - a super prompt that includes a
collection of things you want the assistant to know in every
conversation.
- Adding single prompts to your current context to help guide the
assistant's responses.
- (In the future) dynamically adding certain prompts to the assistant
based on the current context, such as the presence of Rust code or a
specific async runtime you want to work with.

These will also be useful for populating the assistant actions typeahead
we plan to build in the near future.

## Prompt Library

The prompt library is a registry of prompts. Initially by default when
opening the assistant, the prompt manager will load any custom prompts
present in your `~/.config/zed/prompts` directory.

Checked prompts are included in your "default prompt", which can be
inserted into the assitant by running `assistant: insert default prompt`
or clicking the `Insert Default Prompt` button in the assistant panel's
more menu.

When the app starts, no prompts are set to default. You can add prompts
to the default by checking them in the Prompt Library.

I plan to improve this UX in the future, allowing your default prompts
to be remembered, and allowing creating, editing and exporting prompts
from the Library.

### Creating a custom prompt

Prompts have a simple format:

```json
{
  // ~/.config/zed/prompts/no-comments.json
  "title": "No comments in code",
  "version": "1.0",
  "author": "Nate Butler <iamnbutler@gmail.com>",
  "languages": ["*"],
  "prompt": "Do not add inline or doc comments to any returned code. Avoid removing existing comments unless they are no longer accurate due to changes in the code."
}
```

Ensure you properly escape your prompt string when creating a new prompt
file.

Example:

```json
{
  // ...
  "prompt": "This project using the gpui crate as it's UI framework for building UI in Rust. When working in Rust files with gpui components, import it's dependencies using `use gpui::{*, prelude::*}`.\n\nWhen a struct has a `#[derive(IntoElement)]` attribute, it is a UI component that must implement `RenderOnce`. Example:\n\n```rust\n#[derive(IntoElement)]\nstruct MyComponent {\n    id: ElementId,\n}\n\nimpl MyComponent {\n    pub fn new(id: impl Into<ElementId>) -> Self {\n        Self { id.into() }\n    }\n}\n\nimpl RenderOnce for MyComponent {\n    fn render(self, cx: &mut WindowContext) -> impl IntoElement {\n        div().id(self.id.clone()).child(text(\"Hello, world!\"))\n    }\n}\n```"
}
```


Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-05-16 16:55:54 -04:00
..
file_icons Add hpp file icon (#11149) 2024-04-29 01:08:59 -04:00
ai.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
arrow_circle.svg Always show checking with icon if checks are still running 2024-01-08 11:55:51 -05:00
arrow_down.svg kb 2023-11-20 10:46:23 -05:00
arrow_left.svg kb 2023-11-20 10:46:23 -05:00
arrow_right.svg kb 2023-11-20 10:46:23 -05:00
arrow_up.svg kb 2023-11-20 10:46:23 -05:00
arrow_up_right.svg
at_sign.svg Standardize icon naming 2024-01-03 11:45:41 -05:00
backspace.svg ui: Add Backspace/Delete icons and use them for keybindings. 2024-01-02 16:41:56 +01:00
bell.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
bell_dot.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
bell_off.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
bell_ring.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
bolt.svg
caret_down.svg
caret_up.svg
case_insensitive.svg
check.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
check_circle.svg
chevron_down.svg
chevron_left.svg
chevron_right.svg
chevron_up.svg
circle_check.svg
code.svg Iterate on Assistant 2 composer UI (#11306) 2024-05-02 13:01:21 -04:00
command.svg kb 2023-11-20 10:46:23 -05:00
control.svg kb 2023-11-20 10:46:23 -05:00
conversations.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
copilot.svg
copilot_disabled.svg
copilot_error.svg
copilot_init.svg
copy.svg Re-add diagnostic headers 2023-12-01 15:30:01 -05:00
countdown_timer.svg Introduce recent files ambient context for assistant (#11791) 2024-05-14 13:48:36 +02:00
dash.svg Add checkboxes and their stories 2023-11-05 01:06:41 -05:00
delete.svg Add return, space, tab, escape keybinding icons 2024-01-03 11:14:33 -05:00
desktop.svg
disconnected.svg
download.svg
ellipsis.svg
error.svg
escape.svg Add return, space, tab, escape keybinding icons 2024-01-03 11:14:33 -05:00
exit.svg
expand_vertical.svg Add a command to expand the context for a multibuffer (#10300) 2024-04-19 14:27:56 -07:00
external_link.svg
feedback.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
file.svg
filter.svg
github.svg Add github icon 2023-12-18 12:56:57 -05:00
hash.svg
history_rerun.svg tasks: Reorganize task modal (#11752) 2024-05-14 11:22:09 +02:00
indicator.svg Add DecoratedIcon (#11512) 2024-05-07 16:36:13 -04:00
indicator_x.svg Add DecoratedIcon (#11512) 2024-05-07 16:36:13 -04:00
inlay_hint.svg
library.svg Add prompt library (#11910) 2024-05-16 16:55:54 -04:00
LICENSES Add a command to expand the context for a multibuffer (#10300) 2024-04-19 14:27:56 -07:00
link.svg
logo_96.svg
magic_wand.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
magnifying_glass.svg
mail_open.svg Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
maximize.svg Style assistant header, update icons 2023-12-19 10:30:46 -05:00
menu.svg Style assistant header, update icons 2023-12-19 10:30:46 -05:00
mic.svg
mic_mute.svg Standardize icon naming 2024-01-03 11:45:41 -05:00
minimize.svg Style assistant header, update icons 2023-12-19 10:30:46 -05:00
option.svg kb 2023-11-20 10:46:23 -05:00
page_down.svg Standardize icon naming 2024-01-03 11:45:41 -05:00
page_up.svg Standardize icon naming 2024-01-03 11:45:41 -05:00
pencil.svg Fix invisible chat icons (#10406) 2024-04-11 18:36:58 +02:00
person.svg git blame: Display GitHub avatars in blame tooltips, if available (#10767) 2024-04-19 15:15:19 +02:00
play.svg Add static Runnables (#8009) 2024-02-19 18:41:43 +02:00
plus.svg
project.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
public.svg update sidebar for public channels 2023-10-17 13:30:09 -06:00
pull_request.svg Add pull requests to git blame tooltip (#10784) 2024-04-19 18:54:20 +02:00
quote.svg Style assistant header, update icons 2023-12-19 10:30:46 -05:00
regex.svg Make BufferSearch less wide (#10459) 2024-04-11 23:07:29 -06:00
replace.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
replace_all.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
replace_next.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
reply_arrow_right.svg Fix invisible chat icons (#10406) 2024-04-11 18:36:58 +02:00
return.svg Add return, space, tab, escape keybinding icons 2024-01-03 11:14:33 -05:00
select_all.svg Make BufferSearch less wide (#10459) 2024-04-11 23:07:29 -06:00
server.svg remote projects per user (#10594) 2024-04-23 15:33:09 -06:00
shift.svg kb 2023-11-20 10:46:23 -05:00
sliders.svg Add Editor Controls Menu to Tool Bar (#10655) 2024-04-16 18:03:54 -04:00
snip.svg Style assistant header, update icons 2023-12-19 10:30:46 -05:00
space.svg Add return, space, tab, escape keybinding icons 2024-01-03 11:14:33 -05:00
speaker_loud.svg Standardize icon naming 2024-01-03 11:45:41 -05:00
speaker_off.svg Standardize icon naming 2024-01-03 11:45:41 -05:00
spinner.svg Iterate on Assistant 2 composer UI (#11306) 2024-05-02 13:01:21 -04:00
split.svg
stop_sharing.svg
strikethrough.svg Add DecoratedIcon (#11512) 2024-05-07 16:36:13 -04:00
supermaven.svg Supermaven (#10788) 2024-05-03 12:50:42 -07:00
supermaven_disabled.svg Supermaven (#10788) 2024-05-03 12:50:42 -07:00
supermaven_error.svg Supermaven (#10788) 2024-05-03 12:50:42 -07:00
supermaven_init.svg Supermaven (#10788) 2024-05-03 12:50:42 -07:00
tab.svg Add return, space, tab, escape keybinding icons 2024-01-03 11:14:33 -05:00
terminal.svg Update to UI and Framework Icons (#9468) 2024-03-18 10:59:19 -04:00
trash.svg Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
update.svg
user_group_16.svg
warning.svg Update diagnostic status bar tool 2023-11-18 00:54:01 -05:00
word_search.svg Clean up whitespace (#10755) 2024-04-23 13:31:21 -04:00
x.svg
zed_assistant.svg Assistant 2 temp icon (#11257) 2024-05-01 12:56:27 -04:00
zed_x_copilot.svg