pub struct PromptMetadata {Show 18 fields
pub model: String,
pub provider: String,
pub search_mode: String,
pub renderer_mode: String,
pub date: String,
pub cwd: String,
pub prompt_fragments: Vec<String>,
pub docs_map: Vec<String>,
pub context_sources: Vec<ContextSourceMeta>,
pub tool_catalog_size: usize,
pub tool_names: Vec<String>,
pub skill_catalog_size: usize,
pub skill_names: Vec<String>,
pub diagnostics: Vec<String>,
pub history_reuse: bool,
pub prev_context_hash: Option<u64>,
pub transcript_tail_size: usize,
pub has_user_turn: bool,
}Expand description
Metadata for a single prompt turn, suitable for append-only JSONL storage.
This is the audit record: enough to reconstruct what was sent without storing the content itself. Full raw provider payloads are deliberately excluded because they can contain prompt text, repo content, and secrets.
Fields§
§model: StringSelected model name.
provider: StringSelected provider label.
search_mode: StringApplication-owned web-search backend label.
renderer_mode: StringRenderer mode label.
date: StringRounded date (YYYY-MM-DD) used for cache stability.
cwd: StringWorkspace root path.
prompt_fragments: Vec<String>Ordered prompt fragment names included in the system prompt.
docs_map: Vec<String>Model-visible documentation entry point paths.
context_sources: Vec<ContextSourceMeta>Metadata for each loaded AGENTS.md source (no content).
tool_catalog_size: usizeNumber of tools in the catalog sent this turn.
tool_names: Vec<String>Tool names in the catalog sent this turn.
skill_catalog_size: usizeNumber of available Agent Skills exposed as metadata this turn.
skill_names: Vec<String>Available skill names exposed as metadata this turn.
diagnostics: Vec<String>Self-knowledge diagnostics visible for this turn.
history_reuse: boolWhether history reuse was active for this turn.
prev_context_hash: Option<u64>Content hash of the root AGENTS.md from the previous turn, if any.
transcript_tail_size: usizeNumber of transcript entries included in the projected tail.
has_user_turn: boolWhether the user turn was non-empty.
Implementations§
Source§impl PromptMetadata
impl PromptMetadata
Sourcepub fn from_bundle(bundle: &PromptBundle) -> Self
pub fn from_bundle(bundle: &PromptBundle) -> Self
Extract prompt metadata from a PromptBundle for session storage.
This captures the structural metadata of the turn — model, search backend, context sources (hashes and truncation, not content), tool count, and transcript tail size. It does not store prompt text, AGENTS.md content, or provider request/response bodies.
Trait Implementations§
Source§impl Clone for PromptMetadata
impl Clone for PromptMetadata
Source§fn clone(&self) -> PromptMetadata
fn clone(&self) -> PromptMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PromptMetadata
impl Debug for PromptMetadata
Source§impl<'de> Deserialize<'de> for PromptMetadata
impl<'de> Deserialize<'de> for PromptMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PromptMetadata
Source§impl PartialEq for PromptMetadata
impl PartialEq for PromptMetadata
Source§impl Serialize for PromptMetadata
impl Serialize for PromptMetadata
impl StructuralPartialEq for PromptMetadata
Auto Trait Implementations§
impl Freeze for PromptMetadata
impl RefUnwindSafe for PromptMetadata
impl Send for PromptMetadata
impl Sync for PromptMetadata
impl Unpin for PromptMetadata
impl UnsafeUnpin for PromptMetadata
impl UnwindSafe for PromptMetadata
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more