pub struct PromptBlock {
pub role: BlockRole,
pub content: String,
pub cache_strategy: Option<CacheStrategy>,
pub name: Option<String>,
pub origin: BlockOrigin,
}Expand description
Protocol-agnostic prompt block.
Each Model implementation translates these into its API-specific format.
cache_strategy carries Anthropic cache_control semantics (Ephemeral/Global)
but is ignored by non-Anthropic models.
Fields§
§role: BlockRole§content: String§cache_strategy: Option<CacheStrategy>§name: Option<String>What this block is — see the names module.
Annotation only: no adapter reads it, so it never reaches the wire and
two blocks differing only here are byte-identical to the model. It
exists because block boundaries alone do not say which block is the
skills inventory and which is the MCP instructions, and the count
shifts with configuration (rules, MCP and prompt.append are each
optional), so position is not a reliable answer.
This is how an extension addresses a block: “put mine after
skills.catalog”, “replace memory.session”. That only works if the
names are stable, which is why the kernel’s are a published contract
and not a debugging label.
origin: BlockOriginWho put this block here.
Separate from name because they answer different
questions: the name says which block this is, the origin says whose it
is. Rearranging the prompt is a privileged act, and how privileged
depends on where the rearranging came from — a plugin someone
downloaded is not a script that same person wrote. Nothing enforces
that yet; recording it truthfully is the precondition for enforcing it
at all.