Organize context fragments (#18794)

Organize context fragments under `core/context`. Implement same trait on
all of them.
This commit is contained in:
pakrym-oai
2026-04-20 22:39:17 -07:00
committed by GitHub
Unverified
parent ab26554a3a
commit 4c2e730488
36 changed files with 452 additions and 559 deletions
@@ -0,0 +1,17 @@
use super::ContextualUserFragment;
#[derive(Debug, Clone, PartialEq)]
pub(crate) struct UserInstructions {
pub(crate) directory: String,
pub(crate) text: String,
}
impl ContextualUserFragment for UserInstructions {
const ROLE: &'static str = "user";
const START_MARKER: &'static str = "# AGENTS.md instructions for ";
const END_MARKER: &'static str = "</INSTRUCTIONS>";
fn body(&self) -> String {
format!("{}\n\n<INSTRUCTIONS>\n{}", self.directory, self.text)
}
}