#[non_exhaustive]pub struct SceneSpec {Show 18 fields
pub id: String,
pub name: String,
pub description: String,
pub prompt: Arc<dyn ScenePrompt>,
pub tools: ToolSurface,
pub extra_tools: Vec<Arc<dyn Tool>>,
pub modules: ModuleSurface,
pub requires_project: bool,
pub supports_team: bool,
pub interactive: bool,
pub path_style: PathStyle,
pub token_budget: TokenBudget,
pub execution: ExecutionParams,
pub bundled_skills: Vec<String>,
pub attended_skills: Vec<String>,
pub reminders: Vec<Reminder>,
pub session_naming: Option<String>,
pub memory_extraction_intro: Option<String>,
}Expand description
A scene: everything but its prompt is data, so a host that builds on a built-in scene changes the fields it cares about and keeps the rest, instead of wrapping a trait object and forwarding every method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: String§name: String§description: String§prompt: Arc<dyn ScenePrompt>§tools: ToolSurface§extra_tools: Vec<Arc<dyn Tool>>Tools this scene registers into the session’s own registry, before
tools.deferred is applied.
A name already registered is rejected, not substituted:
Builder::build() fails rather than let a scene shadow Bash or
Edit. They are built with no session context, so they suit
self-contained tools.
modules: ModuleSurface§requires_project: boolWhether a session must be bound to a project root. The daemon refuses
a session with no project_root for a scene that says yes.
supports_team: boolfalse means the Team tools are never registered for the session.
interactive: boolWhether someone is there to answer a question, a plan to approve, a
permission prompt — for a session that does not say otherwise
(Builder::attended). When nobody is, a call the permission policy
would ask about is refused instead, the tools in NEEDS_A_USER are
left out, Self::attended_skills are not listed, and the prompt
must not count on a reply.
path_style: PathStyleHow the file tools word paths when Settings::path_style is not set.
token_budget: TokenBudget§execution: ExecutionParams§bundled_skills: Vec<String>The built-in skills a session lists, by name. A built-in is also left out when a tool it needs is not permitted here.
attended_skills: Vec<String>Built-in skills listed besides Self::bundled_skills only when
someone attends the session: ones that hand something back to the
user mid-task.
reminders: Vec<Reminder>§session_naming: Option<String>When set, the session is named after its first turn by a model call
with this prompt, {first_message} replaced by the user’s message.
memory_extraction_intro: Option<String>Replaces the intro sentence of post-turn durable-memory extraction, whose default is code-flavored. The JSON output instructions that follow it are fixed.
Implementations§
Source§impl SceneSpec
impl SceneSpec
pub fn new( id: impl Into<String>, name: impl Into<String>, prompt: Arc<dyn ScenePrompt>, ) -> Self
pub fn system_prompt(&self, ctx: &ScenePromptContext<'_>) -> Vec<PromptBlock>
pub fn session_context(&self, ctx: &ScenePromptContext<'_>) -> String
pub fn permits_tool(&self, name: &str, origin: &ToolOrigin) -> bool
Sourcepub fn reminder(&self, ctx: &ReminderContext<'_>) -> String
pub fn reminder(&self, ctx: &ReminderContext<'_>) -> String
The <system-reminder> blocks injected before each turn, one per
entry in reminders that has something to say.