pub struct SessionRpcCommands<'a> { /* private fields */ }Expand description
session.commands.* RPCs.
Implementations§
Source§impl<'a> SessionRpcCommands<'a>
impl<'a> SessionRpcCommands<'a>
Sourcepub async fn list(&self) -> Result<CommandList, Error>
pub async fn list(&self) -> Result<CommandList, Error>
Lists slash commands available in the session.
Wire method: session.commands.list.
§Returns
Slash commands available in the session, after applying any include/exclude filters.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn list_with_params(
&self,
params: CommandsListRequest,
) -> Result<CommandList, Error>
pub async fn list_with_params( &self, params: CommandsListRequest, ) -> Result<CommandList, Error>
Lists slash commands available in the session.
Wire method: session.commands.list.
§Parameters
params- Optional filters controlling which command sources to include in the listing.
§Returns
Slash commands available in the session, after applying any include/exclude filters.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn invoke(
&self,
params: CommandsInvokeRequest,
) -> Result<SlashCommandInvocationResult, Error>
pub async fn invoke( &self, params: CommandsInvokeRequest, ) -> Result<SlashCommandInvocationResult, Error>
Invokes a slash command in the session.
Wire method: session.commands.invoke.
§Parameters
params- Slash command name and optional raw input string to invoke.
§Returns
Result of invoking the slash command (text output, prompt to send to the agent, or completion).
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn handle_pending_command(
&self,
params: CommandsHandlePendingCommandRequest,
) -> Result<CommandsHandlePendingCommandResult, Error>
pub async fn handle_pending_command( &self, params: CommandsHandlePendingCommandRequest, ) -> Result<CommandsHandlePendingCommandResult, Error>
Reports completion of a pending client-handled slash command.
Wire method: session.commands.handlePendingCommand.
§Parameters
params- Pending command request ID and an optional error if the client handler failed.
§Returns
Indicates whether the pending client-handled command was completed successfully.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn execute(
&self,
params: ExecuteCommandParams,
) -> Result<ExecuteCommandResult, Error>
pub async fn execute( &self, params: ExecuteCommandParams, ) -> Result<ExecuteCommandResult, Error>
Executes a slash command synchronously and returns any error.
Wire method: session.commands.execute.
§Parameters
params- Slash command name and argument string to execute synchronously.
§Returns
Error message produced while executing the command, if any.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn enqueue(
&self,
params: EnqueueCommandParams,
) -> Result<EnqueueCommandResult, Error>
pub async fn enqueue( &self, params: EnqueueCommandParams, ) -> Result<EnqueueCommandResult, Error>
Enqueues a slash command for FIFO processing on the local session.
Wire method: session.commands.enqueue.
§Parameters
params- Slash-prefixed command string to enqueue for FIFO processing.
§Returns
Indicates whether the command was accepted into the local execution queue.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn respond_to_queued_command(
&self,
params: CommandsRespondToQueuedCommandRequest,
) -> Result<CommandsRespondToQueuedCommandResult, Error>
pub async fn respond_to_queued_command( &self, params: CommandsRespondToQueuedCommandRequest, ) -> Result<CommandsRespondToQueuedCommandResult, Error>
Reports whether the host actually executed a queued command and whether to continue processing.
Wire method: session.commands.respondToQueuedCommand.
§Parameters
params- Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands).
§Returns
Indicates whether the queued-command response was matched to a pending request.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Trait Implementations§
Source§impl<'a> Clone for SessionRpcCommands<'a>
impl<'a> Clone for SessionRpcCommands<'a>
Source§fn clone(&self) -> SessionRpcCommands<'a>
fn clone(&self) -> SessionRpcCommands<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more