pub struct SessionRpcUi<'a> { /* private fields */ }Expand description
session.ui.* RPCs.
Implementations§
Source§impl<'a> SessionRpcUi<'a>
impl<'a> SessionRpcUi<'a>
Sourcepub async fn elicitation(
&self,
params: UIElicitationRequest,
) -> Result<UIElicitationResponse, Error>
pub async fn elicitation( &self, params: UIElicitationRequest, ) -> Result<UIElicitationResponse, Error>
Requests structured input from a UI-capable client.
Wire method: session.ui.elicitation.
§Parameters
params- Prompt message and JSON schema describing the form fields to elicit from the user.
§Returns
The elicitation response (accept with form values, decline, or cancel)
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_elicitation(
&self,
params: UIHandlePendingElicitationRequest,
) -> Result<UIElicitationResult, Error>
pub async fn handle_pending_elicitation( &self, params: UIHandlePendingElicitationRequest, ) -> Result<UIElicitationResult, Error>
Provides the user response for a pending elicitation request.
Wire method: session.ui.handlePendingElicitation.
§Parameters
params- Pending elicitation request ID and the user’s response (accept/decline/cancel + form values).
§Returns
Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
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_user_input(
&self,
params: UIHandlePendingUserInputRequest,
) -> Result<UIHandlePendingResult, Error>
pub async fn handle_pending_user_input( &self, params: UIHandlePendingUserInputRequest, ) -> Result<UIHandlePendingResult, Error>
Resolves a pending user_input.requested event with the user’s response.
Wire method: session.ui.handlePendingUserInput.
§Parameters
params- Request ID of a pendinguser_input.requestedevent and the user’s response.
§Returns
Indicates whether the pending UI request was resolved by this call.
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_sampling(
&self,
params: UIHandlePendingSamplingRequest,
) -> Result<UIHandlePendingResult, Error>
pub async fn handle_pending_sampling( &self, params: UIHandlePendingSamplingRequest, ) -> Result<UIHandlePendingResult, Error>
Resolves a pending sampling.requested event with a sampling result, or rejects it.
Wire method: session.ui.handlePendingSampling.
§Parameters
params- Request ID of a pendingsampling.requestedevent and an optional sampling result payload (omit to reject).
§Returns
Indicates whether the pending UI request was resolved by this call.
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_auto_mode_switch(
&self,
params: UIHandlePendingAutoModeSwitchRequest,
) -> Result<UIHandlePendingResult, Error>
pub async fn handle_pending_auto_mode_switch( &self, params: UIHandlePendingAutoModeSwitchRequest, ) -> Result<UIHandlePendingResult, Error>
Resolves a pending auto_mode_switch.requested event with the user’s accept/decline decision.
Wire method: session.ui.handlePendingAutoModeSwitch.
§Parameters
params- Request ID of a pendingauto_mode_switch.requestedevent and the user’s response.
§Returns
Indicates whether the pending UI request was resolved by this call.
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_exit_plan_mode(
&self,
params: UIHandlePendingExitPlanModeRequest,
) -> Result<UIHandlePendingResult, Error>
pub async fn handle_pending_exit_plan_mode( &self, params: UIHandlePendingExitPlanModeRequest, ) -> Result<UIHandlePendingResult, Error>
Resolves a pending exit_plan_mode.requested event with the user’s response.
Wire method: session.ui.handlePendingExitPlanMode.
§Parameters
params- Request ID of a pendingexit_plan_mode.requestedevent and the user’s response.
§Returns
Indicates whether the pending UI request was resolved by this call.
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 register_direct_auto_mode_switch_handler(
&self,
) -> Result<UIRegisterDirectAutoModeSwitchHandlerResult, Error>
pub async fn register_direct_auto_mode_switch_handler( &self, ) -> Result<UIRegisterDirectAutoModeSwitchHandlerResult, Error>
Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.
Wire method: session.ui.registerDirectAutoModeSwitchHandler.
§Returns
Register an in-process handler for auto_mode_switch.requested events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn’t race the in-process handler for the same requestId).
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 unregister_direct_auto_mode_switch_handler(
&self,
params: UIUnregisterDirectAutoModeSwitchHandlerRequest,
) -> Result<UIUnregisterDirectAutoModeSwitchHandlerResult, Error>
pub async fn unregister_direct_auto_mode_switch_handler( &self, params: UIUnregisterDirectAutoModeSwitchHandlerRequest, ) -> Result<UIUnregisterDirectAutoModeSwitchHandlerResult, Error>
Unregisters a previously-registered in-process auto-mode-switch handler by its opaque handle.
Wire method: session.ui.unregisterDirectAutoModeSwitchHandler.
§Parameters
params- Opaque handle previously returned byregisterDirectAutoModeSwitchHandlerto release.
§Returns
Indicates whether the handle was active and the registration count was decremented.
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 SessionRpcUi<'a>
impl<'a> Clone for SessionRpcUi<'a>
Source§fn clone(&self) -> SessionRpcUi<'a>
fn clone(&self) -> SessionRpcUi<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more