Skip to main content

SceneSpec

Struct SceneSpec 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: bool

Whether 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: bool

false means the Team tools are never registered for the session.

§interactive: bool

Whether 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: PathStyle

How 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

Source

pub fn new( id: impl Into<String>, name: impl Into<String>, prompt: Arc<dyn ScenePrompt>, ) -> Self

Source

pub fn system_prompt(&self, ctx: &ScenePromptContext<'_>) -> Vec<PromptBlock>

Source

pub fn session_context(&self, ctx: &ScenePromptContext<'_>) -> String

Source

pub fn permits_tool(&self, name: &str, origin: &ToolOrigin) -> bool

Source

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.

Source

pub fn session_name_prompt(&self, first_message: &str) -> Option<String>

Trait Implementations§

Source§

impl Clone for SceneSpec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SceneSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more