pub struct SessionCreateRequest {
pub session_id: Option<String>,
pub relation: SessionRelation,
pub start: SessionStartPoint,
pub policy: Option<SessionPolicy>,
pub plugin_mode: SessionPluginMode,
pub initial_nodes: Vec<SessionAppendNode>,
pub first_turn_input: Option<PluginMessage>,
pub tool_access: SessionToolAccess,
pub subagent: Option<SubagentSessionAuthority>,
pub context_surface: SessionContextSurface,
pub mode_extras: ModeExtras,
pub usage_source: Option<String>,
}Fields§
§session_id: Option<String>§relation: SessionRelation§start: SessionStartPoint§policy: Option<SessionPolicy>§plugin_mode: SessionPluginMode§initial_nodes: Vec<SessionAppendNode>§first_turn_input: Option<PluginMessage>Optional seed message dispatched as the new session’s first turn
input. The runtime stashes it during create_session; any host
that drives turns on the new session can claim it via
RuntimeSessionHost::take_first_turn_input.
tool_access: SessionToolAccess§subagent: Option<SubagentSessionAuthority>§context_surface: SessionContextSurface§mode_extras: ModeExtrasPer-execution-mode “extras” that configure mode-specific
behavior at session-creation time. The base request stays
mode-agnostic; each ExecutionMode defines its own struct.
usage_source: Option<String>Label for the token-cost ledger. When this session’s turns
complete, their token usage is accumulated under this label on
the parent session’s token_ledger. Examples: "subagent",
"compaction". Defaults to "child" if unset.
Implementations§
Source§impl SessionCreateRequest
impl SessionCreateRequest
pub fn child( parent_session_id: impl Into<String>, start: SessionStartPoint, policy: SessionPolicy, mode_extras: ModeExtras, usage_source: impl Into<String>, ) -> Self
pub fn child_inheriting_policy( parent_session_id: impl Into<String>, start: SessionStartPoint, mode_extras: ModeExtras, usage_source: impl Into<String>, ) -> Self
pub fn handoff( parent_session_id: impl Into<String>, policy: SessionPolicy, mode_extras: ModeExtras, reason: impl Into<String>, metadata: Map<String, Value>, usage_source: impl Into<String>, ) -> Self
pub fn with_plugin_mode(self, plugin_mode: SessionPluginMode) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_initial_nodes(self, initial_nodes: Vec<SessionAppendNode>) -> Self
pub fn with_first_turn_input(self, first_turn_input: PluginMessage) -> Self
pub fn with_tool_access(self, tool_access: SessionToolAccess) -> Self
pub fn with_context_surface( self, context_surface: SessionContextSurface, ) -> Self
Trait Implementations§
Source§impl Clone for SessionCreateRequest
impl Clone for SessionCreateRequest
Source§fn clone(&self) -> SessionCreateRequest
fn clone(&self) -> SessionCreateRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionCreateRequest
impl Debug for SessionCreateRequest
Source§impl<'de> Deserialize<'de> for SessionCreateRequest
impl<'de> Deserialize<'de> for SessionCreateRequest
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SessionCreateRequest
impl !RefUnwindSafe for SessionCreateRequest
impl Send for SessionCreateRequest
impl Sync for SessionCreateRequest
impl Unpin for SessionCreateRequest
impl UnsafeUnpin for SessionCreateRequest
impl !UnwindSafe for SessionCreateRequest
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
Mutably borrows from an owned value. Read more