pub struct ClientRpcSessions<'a> { /* private fields */ }Expand description
sessions.* RPCs.
Implementations§
Source§impl<'a> ClientRpcSessions<'a>
impl<'a> ClientRpcSessions<'a>
Sourcepub async fn open(&self) -> Result<SessionOpenResult, Error>
pub async fn open(&self) -> Result<SessionOpenResult, Error>
Creates or resumes a local session and returns the opened session ID.
Wire method: sessions.open.
§Returns
Result of opening a session.
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 fork(
&self,
params: SessionsForkRequest,
) -> Result<SessionsForkResult, Error>
pub async fn fork( &self, params: SessionsForkRequest, ) -> Result<SessionsForkResult, Error>
Creates a new session by forking persisted history from an existing session.
Wire method: sessions.fork.
§Parameters
params- Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session.
§Returns
Identifier and optional friendly name assigned to the newly forked session.
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 connect(
&self,
params: ConnectRemoteSessionParams,
) -> Result<RemoteSessionConnectionResult, Error>
pub async fn connect( &self, params: ConnectRemoteSessionParams, ) -> Result<RemoteSessionConnectionResult, Error>
Connects to an existing remote session and exposes it as an SDK session.
Wire method: sessions.connect.
§Parameters
params- Remote session connection parameters.
§Returns
Remote session connection result.
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(&self) -> Result<SessionList, Error>
pub async fn list(&self) -> Result<SessionList, Error>
Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by isRemote: local entries carry only the lightweight LocalSessionMetadataValue shape; remote entries carry the full RemoteSessionMetadataValue shape (repository, PR number, taskType, etc.).
Wire method: sessions.list.
§Returns
Sessions matching the filter, ordered most-recently-modified first.
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: SessionsListRequest,
) -> Result<SessionList, Error>
pub async fn list_with_params( &self, params: SessionsListRequest, ) -> Result<SessionList, Error>
Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by isRemote: local entries carry only the lightweight LocalSessionMetadataValue shape; remote entries carry the full RemoteSessionMetadataValue shape (repository, PR number, taskType, etc.).
Wire method: sessions.list.
§Parameters
params- Optional source filter, metadata-load limit, and context filter applied to the returned sessions.
§Returns
Sessions matching the filter, ordered most-recently-modified first.
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 find_by_task_id(
&self,
params: SessionsFindByTaskIDRequest,
) -> Result<SessionsFindByTaskIDResult, Error>
pub async fn find_by_task_id( &self, params: SessionsFindByTaskIDRequest, ) -> Result<SessionsFindByTaskIDResult, Error>
Finds the local session bound to a GitHub task ID, if any.
Wire method: sessions.findByTaskId.
§Parameters
params- GitHub task ID to look up.
§Returns
ID of the local session bound to the given GitHub task, or omitted when none.
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 find_by_prefix(
&self,
params: SessionsFindByPrefixRequest,
) -> Result<SessionsFindByPrefixResult, Error>
pub async fn find_by_prefix( &self, params: SessionsFindByPrefixRequest, ) -> Result<SessionsFindByPrefixResult, Error>
Resolves a UUID prefix to a unique session ID, if exactly one session matches.
Wire method: sessions.findByPrefix.
§Parameters
params- UUID prefix to resolve to a unique session ID.
§Returns
Session ID matching the prefix, omitted when no unique match exists.
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 get_last_for_context(
&self,
params: SessionsGetLastForContextRequest,
) -> Result<SessionsGetLastForContextResult, Error>
pub async fn get_last_for_context( &self, params: SessionsGetLastForContextRequest, ) -> Result<SessionsGetLastForContextResult, Error>
Returns the most-relevant prior session for a given working-directory context.
Wire method: sessions.getLastForContext.
§Parameters
params- Optional working-directory context used to score session relevance.
§Returns
Most-relevant session ID for the supplied context, or omitted when no sessions exist.
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 get_sizes(&self) -> Result<SessionSizes, Error>
pub async fn get_sizes(&self) -> Result<SessionSizes, Error>
Returns the on-disk byte size of each session’s workspace directory.
Wire method: sessions.getSizes.
§Returns
Map of sessionId -> on-disk size in bytes for each session’s workspace directory.
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 check_in_use(
&self,
params: SessionsCheckInUseRequest,
) -> Result<SessionsCheckInUseResult, Error>
pub async fn check_in_use( &self, params: SessionsCheckInUseRequest, ) -> Result<SessionsCheckInUseResult, Error>
Returns the subset of the supplied session IDs that are currently held by another running process.
Wire method: sessions.checkInUse.
§Parameters
params- Session IDs to test for live in-use locks.
§Returns
Session IDs from the input set that are currently in use by another process.
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 close(
&self,
params: SessionsCloseRequest,
) -> Result<SessionsCloseResult, Error>
pub async fn close( &self, params: SessionsCloseRequest, ) -> Result<SessionsCloseResult, Error>
Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session.
Wire method: sessions.close.
§Parameters
params- Session ID to close.
§Returns
Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active.
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 bulk_delete(
&self,
params: SessionsBulkDeleteRequest,
) -> Result<SessionBulkDeleteResult, Error>
pub async fn bulk_delete( &self, params: SessionsBulkDeleteRequest, ) -> Result<SessionBulkDeleteResult, Error>
Closes, deactivates, and deletes a set of sessions, returning the bytes freed per session.
Wire method: sessions.bulkDelete.
§Parameters
params- Session IDs to close, deactivate, and delete from disk.
§Returns
Map of sessionId -> bytes freed by removing the session’s workspace directory.
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 prune_old(
&self,
params: SessionsPruneOldRequest,
) -> Result<SessionPruneResult, Error>
pub async fn prune_old( &self, params: SessionsPruneOldRequest, ) -> Result<SessionPruneResult, Error>
Deletes sessions older than the given threshold, with optional dry-run and exclusion list.
Wire method: sessions.pruneOld.
§Parameters
params- Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true).
§Returns
Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag.
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 save(
&self,
params: SessionsSaveRequest,
) -> Result<SessionsSaveResult, Error>
pub async fn save( &self, params: SessionsSaveRequest, ) -> Result<SessionsSaveResult, Error>
Flushes a session’s pending events to disk.
Wire method: sessions.save.
§Parameters
params- Session ID whose pending events should be flushed to disk.
§Returns
Flush a session’s pending events to disk. No-op when no writer exists for the session (e.g., already closed).
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 release_lock(
&self,
params: SessionsReleaseLockRequest,
) -> Result<SessionsReleaseLockResult, Error>
pub async fn release_lock( &self, params: SessionsReleaseLockRequest, ) -> Result<SessionsReleaseLockResult, Error>
Releases the in-use lock held by this process for a session.
Wire method: sessions.releaseLock.
§Parameters
params- Session ID whose in-use lock should be released.
§Returns
Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session.
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 enrich_metadata(
&self,
params: SessionsEnrichMetadataRequest,
) -> Result<SessionEnrichMetadataResult, Error>
pub async fn enrich_metadata( &self, params: SessionsEnrichMetadataRequest, ) -> Result<SessionEnrichMetadataResult, Error>
Backfills missing summary and context fields on the supplied session metadata records.
Wire method: sessions.enrichMetadata.
§Parameters
params- Session metadata records to enrich with summary and context information.
§Returns
The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted.
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 reload_plugin_hooks(
&self,
params: SessionsReloadPluginHooksRequest,
) -> Result<SessionsReloadPluginHooksResult, Error>
pub async fn reload_plugin_hooks( &self, params: SessionsReloadPluginHooksRequest, ) -> Result<SessionsReloadPluginHooksResult, Error>
Reloads user, plugin, and (optionally) repo hooks on the active session.
Wire method: sessions.reloadPluginHooks.
§Parameters
params- Active session ID and an optional flag for deferring repo-level hooks until folder trust.
§Returns
Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId.
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 load_deferred_repo_hooks(
&self,
params: SessionsLoadDeferredRepoHooksRequest,
) -> Result<SessionLoadDeferredRepoHooksResult, Error>
pub async fn load_deferred_repo_hooks( &self, params: SessionsLoadDeferredRepoHooksRequest, ) -> Result<SessionLoadDeferredRepoHooksResult, Error>
Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts.
Wire method: sessions.loadDeferredRepoHooks.
§Parameters
params- Active session ID whose deferred repo-level hooks should be loaded.
§Returns
Queued repo-level startup prompts and the total hook command count after loading.
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_additional_plugins(
&self,
params: SessionsSetAdditionalPluginsRequest,
) -> Result<SessionsSetAdditionalPluginsResult, Error>
pub async fn set_additional_plugins( &self, params: SessionsSetAdditionalPluginsRequest, ) -> Result<SessionsSetAdditionalPluginsResult, Error>
Replaces the manager-wide additional plugins registered with the session manager.
Wire method: sessions.setAdditionalPlugins.
§Parameters
params- Manager-wide additional plugins to register; replaces any previously-configured set.
§Returns
Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload.
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 start_remote_control(
&self,
params: SessionsStartRemoteControlRequest,
) -> Result<RemoteControlStatusResult, Error>
pub async fn start_remote_control( &self, params: SessionsStartRemoteControlRequest, ) -> Result<RemoteControlStatusResult, Error>
Attaches the runtime-managed remote-control singleton to a session, awaiting initial setup. If remote control is already attached to a different session, the singleton is transferred (preserving the underlying Mission Control connection). Returns the final status.
Wire method: sessions.startRemoteControl.
§Parameters
params- Parameters for attaching the remote-control singleton to a session.
§Returns
Wrapper for the singleton’s current status.
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 transfer_remote_control(
&self,
params: SessionsTransferRemoteControlRequest,
) -> Result<RemoteControlTransferResult, Error>
pub async fn transfer_remote_control( &self, params: SessionsTransferRemoteControlRequest, ) -> Result<RemoteControlTransferResult, Error>
Atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection. When expectedFromSessionId is provided and does not match the singleton’s current attachedSessionId, the transfer is rejected with transferred: false and the current status is returned unchanged.
Wire method: sessions.transferRemoteControl.
§Parameters
params- Parameters for atomically rebinding the remote-control singleton.
§Returns
Outcome of a transferRemoteControl 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 set_remote_control_steering(
&self,
params: SessionsSetRemoteControlSteeringRequest,
) -> Result<RemoteControlStatusResult, Error>
pub async fn set_remote_control_steering( &self, params: SessionsSetRemoteControlSteeringRequest, ) -> Result<RemoteControlStatusResult, Error>
Patches the steering state of the active remote-control singleton. When remote control is off, this is a no-op and the off status is returned. Today only enabled: true is actionable on the underlying exporter; passing false is reserved for future use.
Wire method: sessions.setRemoteControlSteering.
§Parameters
params- Patch for the singleton’s steering state.
§Returns
Wrapper for the singleton’s current status.
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 stop_remote_control(
&self,
) -> Result<RemoteControlStopResult, Error>
pub async fn stop_remote_control( &self, ) -> Result<RemoteControlStopResult, Error>
Stops the remote-control singleton. When expectedSessionId is provided and does not match the singleton’s current attachedSessionId, the stop is rejected with stopped: false and the current status is returned unchanged (unless force is set, in which case the singleton is unconditionally torn down).
Wire method: sessions.stopRemoteControl.
§Returns
Outcome of a stopRemoteControl 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 stop_remote_control_with_params(
&self,
params: SessionsStopRemoteControlRequest,
) -> Result<RemoteControlStopResult, Error>
pub async fn stop_remote_control_with_params( &self, params: SessionsStopRemoteControlRequest, ) -> Result<RemoteControlStopResult, Error>
Stops the remote-control singleton. When expectedSessionId is provided and does not match the singleton’s current attachedSessionId, the stop is rejected with stopped: false and the current status is returned unchanged (unless force is set, in which case the singleton is unconditionally torn down).
Wire method: sessions.stopRemoteControl.
§Parameters
params- Parameters for stopping the remote-control singleton.
§Returns
Outcome of a stopRemoteControl 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 get_remote_control_status(
&self,
) -> Result<RemoteControlStatusResult, Error>
pub async fn get_remote_control_status( &self, ) -> Result<RemoteControlStatusResult, Error>
Returns the current state of the remote-control singleton, including the attached session id and frontend URL when active.
Wire method: sessions.getRemoteControlStatus.
§Returns
Wrapper for the singleton’s current status.
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 ClientRpcSessions<'a>
impl<'a> Clone for ClientRpcSessions<'a>
Source§fn clone(&self) -> ClientRpcSessions<'a>
fn clone(&self) -> ClientRpcSessions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more