Allow /workflow and step resolution prompts to be overridden (#15892)

This will help us as we hit issues with the /workflow and step
resolution. We can override the baked-in prompts and make tweaks, then
import our refinements back into the source tree when we're ready.

Release Notes:

- N/A
This commit is contained in:
Nathan Sobo 2024-08-06 21:47:42 -06:00 committed by GitHub
parent c8f1358629
commit 990774247e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 196 additions and 104 deletions

View file

@ -2,7 +2,6 @@ use crate::{
slash_command::SlashCommandCompletionProvider, AssistantPanel, InlineAssist, InlineAssistant,
};
use anyhow::{anyhow, Result};
use assets::Assets;
use chrono::{DateTime, Utc};
use collections::{HashMap, HashSet};
use editor::{actions::Tab, CurrentLineHighlight, Editor, EditorElement, EditorEvent, EditorStyle};
@ -12,8 +11,8 @@ use futures::{
};
use fuzzy::StringMatchCandidate;
use gpui::{
actions, point, size, transparent_black, AppContext, AssetSource, BackgroundExecutor, Bounds,
EventEmitter, Global, HighlightStyle, PromptLevel, ReadGlobal, Subscription, Task, TextStyle,
actions, point, size, transparent_black, AppContext, BackgroundExecutor, Bounds, EventEmitter,
Global, HighlightStyle, PromptLevel, ReadGlobal, Subscription, Task, TextStyle,
TitlebarOptions, UpdateGlobal, View, WindowBounds, WindowHandle, WindowOptions,
};
use heed::{
@ -1466,17 +1465,6 @@ impl PromptStore {
fn first(&self) -> Option<PromptMetadata> {
self.metadata_cache.read().metadata.first().cloned()
}
pub fn step_resolution_prompt(&self) -> Result<String> {
let path = "prompts/step_resolution.md";
Ok(String::from_utf8(
Assets
.load(path)?
.ok_or_else(|| anyhow!("{path} not found"))?
.to_vec(),
)?)
}
}
/// Wraps a shared future to a prompt store so it can be assigned as a context global.