Add verified Dev Brain skills
This commit is contained in:
@@ -407,6 +407,21 @@ impl App {
|
||||
prompt
|
||||
}
|
||||
|
||||
fn dev_brain_skills_prompt(&self) -> Option<String> {
|
||||
self.config.dev_brain.enabled.then(|| {
|
||||
let projects = self
|
||||
.projects
|
||||
.iter()
|
||||
.map(|project| project.project.clone())
|
||||
.collect::<Vec<_>>();
|
||||
crate::dev_brain::skills_prompt(&self.config.dev_brain, &projects).unwrap_or_else(|error| {
|
||||
format!(
|
||||
"# Available Dev Brain skills\n\nThe verified skill index is unavailable: {error}. Repair the vault with dev_brain_info and dev_brain_validate before relying on a skill."
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
fn session_agents_prompt(&self) -> Option<&str> {
|
||||
self.conversation
|
||||
.iter()
|
||||
@@ -539,6 +554,7 @@ impl App {
|
||||
#[cfg(target_os = "macos")]
|
||||
if opening_turn {
|
||||
injected_system.extend(agents.clone());
|
||||
injected_system.extend(self.dev_brain_skills_prompt());
|
||||
injected_system.push(crate::agent::datetime_context());
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -688,6 +704,9 @@ impl App {
|
||||
model,
|
||||
self.config.dev_brain.enabled,
|
||||
)];
|
||||
if let Some(skills) = self.dev_brain_skills_prompt() {
|
||||
reminders.push(skills);
|
||||
}
|
||||
if self.config.a2ui_enabled {
|
||||
reminders.push(crate::a2ui::SYSTEM_PROMPT.to_owned());
|
||||
}
|
||||
|
||||
@@ -180,6 +180,18 @@ impl App {
|
||||
.align_y(Alignment::Center),
|
||||
text("The folder must already contain .obsidian. DS4Server manages only its declared wiki pages and leaves settings, attachments, hidden files, and unrelated notes untouched.")
|
||||
.size(12),
|
||||
row![
|
||||
text("Restore the current built-in Dev Brain guidance after an upgrade.")
|
||||
.size(12)
|
||||
.width(Length::Fill),
|
||||
hint(
|
||||
action_button("Recreate purpose.md and schema.md")
|
||||
.on_press(Message::RestoreDevBrainDefaultGuides),
|
||||
"Overwrites only purpose.md and schema.md with this version's defaults. Topic pages, generated indexes, and log.md are preserved.",
|
||||
),
|
||||
]
|
||||
.spacing(12)
|
||||
.align_y(Alignment::Center),
|
||||
]
|
||||
.spacing(10),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user