#[non_exhaustive]pub struct LoadSessionRequest {
pub mcp_servers: Vec<McpServer>,
pub cwd: PathBuf,
pub additional_directories: Vec<PathBuf>,
pub session_id: SessionId,
pub system_prompt: Option<SystemPrompt>,
pub config_options: Vec<InitialSessionConfigOption>,
pub meta: Option<Map<String, Value>>,
}Expand description
Request parameters for loading an existing session.
Only available if the Agent supports the loadSession capability.
See protocol docs: Loading Sessions
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.mcp_servers: Vec<McpServer>List of MCP servers to connect to for this session.
cwd: PathBufThe working directory for this session. Must be an absolute path.
additional_directories: Vec<PathBuf>Additional workspace roots to activate for this session. Each path MUST be absolute.
When omitted or empty, no additional roots are activated. When non-empty,
this is the complete resulting additional-root list for the loaded
session. It MAY differ from any previously used or reported list as long as
the request cwd matches the session’s cwd.
session_id: SessionIdThe ID of the session to load.
system_prompt: Option<SystemPrompt>System-level instructions for the loaded session.
Optional. Omitted and null are equivalent. The Agent MAY then keep a
system prompt it stored with the session or use its default instructions.
Clients MUST only send this when the Agent advertises
sessionCapabilities.systemPrompt, and SHOULD send the same value they used
when the session was created.
config_options: Vec<InitialSessionConfigOption>unstable_session_options only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Initial values for the session’s config options.
Optional. Omitted and null are equivalent to an empty list. Clients MUST only send
this when the Agent advertises sessionCapabilities.options.
The Agent applies the entries in list order, as if the Client had called
session/set_config_option for each entry after the session was set up. Malformed
entries and duplicate configId values fail the request with -32602. The Agent MUST
ignore an entry whose configId is unknown, whose type does not match the option,
or whose value is not allowed when it is applied. The configOptions in the response contain the values the session actually
has. The Agent SHOULD NOT send config_option_update notifications for these entries.
meta: Option<Map<String, Value>>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl LoadSessionRequest
impl LoadSessionRequest
Sourcepub fn new(
session_id: impl Into<SessionId>,
cwd: impl Into<PathBuf>,
) -> LoadSessionRequest
pub fn new( session_id: impl Into<SessionId>, cwd: impl Into<PathBuf>, ) -> LoadSessionRequest
Builds LoadSessionRequest with the required request fields set. Optional fields start unset or empty.
Sourcepub fn additional_directories(
self,
additional_directories: Vec<PathBuf>,
) -> LoadSessionRequest
pub fn additional_directories( self, additional_directories: Vec<PathBuf>, ) -> LoadSessionRequest
Additional workspace roots to activate for this session. Each path MUST be absolute.
Sourcepub fn mcp_servers(self, mcp_servers: Vec<McpServer>) -> LoadSessionRequest
pub fn mcp_servers(self, mcp_servers: Vec<McpServer>) -> LoadSessionRequest
List of MCP servers to connect to for this session.
Sourcepub fn system_prompt(
self,
system_prompt: impl IntoOption<SystemPrompt>,
) -> LoadSessionRequest
pub fn system_prompt( self, system_prompt: impl IntoOption<SystemPrompt>, ) -> LoadSessionRequest
System-level instructions for the loaded session.
Sourcepub fn config_options(
self,
config_options: Vec<InitialSessionConfigOption>,
) -> LoadSessionRequest
Available on crate feature unstable_session_options only.
pub fn config_options( self, config_options: Vec<InitialSessionConfigOption>, ) -> LoadSessionRequest
unstable_session_options only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Initial values for the session’s config options.
Optional. Omitted and null are equivalent to an empty list. Clients MUST only send
this when the Agent advertises sessionCapabilities.options.
The Agent applies the entries in list order, as if the Client had called
session/set_config_option for each entry after the session was set up. Malformed
entries and duplicate configId values fail the request with -32602. The Agent MUST
ignore an entry whose configId is unknown, whose type does not match the option,
or whose value is not allowed when it is applied. The configOptions in the response contain the values the session actually
has. The Agent SHOULD NOT send config_option_update notifications for these entries.
Sourcepub fn meta(
self,
meta: impl IntoOption<Map<String, Value>>,
) -> LoadSessionRequest
pub fn meta( self, meta: impl IntoOption<Map<String, Value>>, ) -> LoadSessionRequest
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for LoadSessionRequest
impl Clone for LoadSessionRequest
Source§fn clone(&self) -> LoadSessionRequest
fn clone(&self) -> LoadSessionRequest
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 LoadSessionRequest
impl Debug for LoadSessionRequest
Source§impl<'de> Deserialize<'de> for LoadSessionRequest
impl<'de> Deserialize<'de> for LoadSessionRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoadSessionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoadSessionRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for LoadSessionRequest
Source§impl JsonRpcMessage for LoadSessionRequest
impl JsonRpcMessage for LoadSessionRequest
Source§fn matches_method(method: &str) -> bool
fn matches_method(method: &str) -> bool
Source§fn to_untyped_message(&self) -> Result<UntypedMessage, Error>
fn to_untyped_message(&self) -> Result<UntypedMessage, Error>
Source§impl JsonRpcRequest for LoadSessionRequest
impl JsonRpcRequest for LoadSessionRequest
Source§type Response = LoadSessionResponse
type Response = LoadSessionResponse
Source§impl JsonSchema for LoadSessionRequest
impl JsonSchema for LoadSessionRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for LoadSessionRequest
impl PartialEq for LoadSessionRequest
Source§impl Serialize for LoadSessionRequest
impl Serialize for LoadSessionRequest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for LoadSessionRequest
Auto Trait Implementations§
impl Forget for LoadSessionRequest
impl Freeze for LoadSessionRequest
impl Move for LoadSessionRequest
impl RefUnwindSafe for LoadSessionRequest
impl Send for LoadSessionRequest
impl Sync for LoadSessionRequest
impl Unpin for LoadSessionRequest
impl UnsafeUnpin for LoadSessionRequest
impl UnwindSafe for LoadSessionRequest
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§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.