pub struct SessionRpcPermissions<'a> { /* private fields */ }Expand description
session.permissions.* RPCs.
Implementations§
Source§impl<'a> SessionRpcPermissions<'a>
impl<'a> SessionRpcPermissions<'a>
Sourcepub fn folder_trust(&self) -> SessionRpcPermissionsFolderTrust<'a>
pub fn folder_trust(&self) -> SessionRpcPermissionsFolderTrust<'a>
session.permissions.folderTrust.* sub-namespace.
Sourcepub fn locations(&self) -> SessionRpcPermissionsLocations<'a>
pub fn locations(&self) -> SessionRpcPermissionsLocations<'a>
session.permissions.locations.* sub-namespace.
Sourcepub fn paths(&self) -> SessionRpcPermissionsPaths<'a>
pub fn paths(&self) -> SessionRpcPermissionsPaths<'a>
session.permissions.paths.* sub-namespace.
Sourcepub fn urls(&self) -> SessionRpcPermissionsUrls<'a>
pub fn urls(&self) -> SessionRpcPermissionsUrls<'a>
session.permissions.urls.* sub-namespace.
Sourcepub async fn configure(
&self,
params: PermissionsConfigureParams,
) -> Result<PermissionsConfigureResult, Error>
pub async fn configure( &self, params: PermissionsConfigureParams, ) -> Result<PermissionsConfigureResult, Error>
Replaces selected permission policy fields (rules, paths, URLs, exclusions, allow-all flags) on the session.
Wire method: session.permissions.configure.
§Parameters
params- Patch of permission policy fields to apply (omit a field to leave it unchanged).
§Returns
Indicates whether the operation succeeded.
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_permission_request(
&self,
params: PermissionDecisionRequest,
) -> Result<PermissionRequestResult, Error>
pub async fn handle_pending_permission_request( &self, params: PermissionDecisionRequest, ) -> Result<PermissionRequestResult, Error>
Provides a decision for a pending tool permission request.
Wire method: session.permissions.handlePendingPermissionRequest.
§Parameters
params- Pending permission request ID and the decision to apply (approve/reject and scope).
§Returns
Indicates whether the permission decision was applied; false when the request was already resolved.
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 pending_requests(
&self,
) -> Result<PendingPermissionRequestList, Error>
pub async fn pending_requests( &self, ) -> Result<PendingPermissionRequestList, Error>
Reconstructs the set of pending tool permission requests from the session’s event history.
Wire method: session.permissions.pendingRequests.
§Returns
List of pending permission requests reconstructed from event history.
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 set_approve_all(
&self,
params: PermissionsSetApproveAllRequest,
) -> Result<PermissionsSetApproveAllResult, Error>
pub async fn set_approve_all( &self, params: PermissionsSetApproveAllRequest, ) -> Result<PermissionsSetApproveAllResult, Error>
Enables or disables automatic approval of tool permission requests for the session.
Wire method: session.permissions.setApproveAll.
§Parameters
params- Allow-all toggle for tool permission requests, with an optional telemetry source.
§Returns
Indicates whether the operation succeeded.
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 modify_rules(
&self,
params: PermissionsModifyRulesParams,
) -> Result<PermissionsModifyRulesResult, Error>
pub async fn modify_rules( &self, params: PermissionsModifyRulesParams, ) -> Result<PermissionsModifyRulesResult, Error>
Adds or removes session-scoped or location-scoped permission rules.
Wire method: session.permissions.modifyRules.
§Parameters
params- Scope and add/remove instructions for modifying session- or location-scoped permission rules.
§Returns
Indicates whether the operation succeeded.
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 set_required(
&self,
params: PermissionsSetRequiredRequest,
) -> Result<PermissionsSetRequiredResult, Error>
pub async fn set_required( &self, params: PermissionsSetRequiredRequest, ) -> Result<PermissionsSetRequiredResult, Error>
Sets whether the client wants permission prompts bridged into session events.
Wire method: session.permissions.setRequired.
§Parameters
params- Toggles whether permission prompts should be bridged into session events for this client.
§Returns
Indicates whether the operation succeeded.
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 reset_session_approvals(
&self,
) -> Result<PermissionsResetSessionApprovalsResult, Error>
pub async fn reset_session_approvals( &self, ) -> Result<PermissionsResetSessionApprovalsResult, Error>
Clears session-scoped tool permission approvals.
Wire method: session.permissions.resetSessionApprovals.
§Returns
Indicates whether the operation succeeded.
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 notify_prompt_shown(
&self,
params: PermissionPromptShownNotification,
) -> Result<PermissionsNotifyPromptShownResult, Error>
pub async fn notify_prompt_shown( &self, params: PermissionPromptShownNotification, ) -> Result<PermissionsNotifyPromptShownResult, Error>
Notifies the runtime that a permission prompt UI has been shown to the user.
Wire method: session.permissions.notifyPromptShown.
§Parameters
params- Notification payload describing the permission prompt that the client just rendered.
§Returns
Indicates whether the operation succeeded.
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 SessionRpcPermissions<'a>
impl<'a> Clone for SessionRpcPermissions<'a>
Source§fn clone(&self) -> SessionRpcPermissions<'a>
fn clone(&self) -> SessionRpcPermissions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more