pub struct Context {
pub instructions: Vec<Layer>,
pub user: Option<Layer>,
pub memory: Option<Layer>,
pub skills: Option<Index>,
pub notes: Vec<String>,
pub skill_notes: Vec<String>,
pub guidance: String,
}Expand description
Everything gathered for one run, already in injection order.
Fields§
§instructions: Vec<Layer>AGENT.md layers: the global one, then project ones from the outermost (repo root)
to the innermost (the workspace), so the nearest file gets the last word.
user: Option<Layer>§memory: Option<Layer>§skills: Option<Index>The skills index, after MEMORY.md. Absent when there are no skills to list, or when
the budget leaves room for none (and then skill_notes says so).
notes: Vec<String>What was truncated or dropped, in plain words, for the user and for context show.
skill_notes: Vec<String>The same for skills: what the index left out, and every skill that is broken. Kept apart
from notes because the CLI warns about these when it starts, and a dropped context
file is not something it has ever warned about.
guidance: StringThe standing instructions that go straight after the configured prompt (#244), resolved
for the model in force. Empty when [agent] prompt_blocks = "off" or no gate matched —
which is exactly “send only the prompt and these files”, the issue’s own wording.
Implementations§
Source§impl Context
impl Context
Sourcepub fn layers(&self) -> impl Iterator<Item = &Layer>
pub fn layers(&self) -> impl Iterator<Item = &Layer>
Every layer that survived the budget, in injection order.
pub fn total_chars(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn with_skills(self, report: &Report, budget: usize) -> Self
pub fn with_skills(self, report: &Report, budget: usize) -> Self
Add the skills index for report, within budget characters (0 = no cap).
Trait Implementations§
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Forget for Context
impl Freeze for Contextwhere
*const u8 is !null: Freeze,
PhantomData<Layer>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
impl Move for Context
impl RefUnwindSafe for Context
impl Send for Contextwhere
RawVecInner: Send,
impl Sync for Contextwhere
RawVecInner: Sync,
impl Unpin for Context
impl UnsafeUnpin for Contextwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Layer>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Contextwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.