pub struct ClientRpcSessions<'a> { /* private fields */ }Expand description
sessions.* RPCs.
Implementations§
Source§impl<'a> ClientRpcSessions<'a>
impl<'a> ClientRpcSessions<'a>
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 persisted sessions, optionally filtered by working-directory context.
Wire method: sessions.list.
§Returns
Persisted 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 persisted sessions, optionally filtered by working-directory context.
Wire method: sessions.list.
§Parameters
params- Optional metadata-load limit and context filter applied to the returned sessions.
§Returns
Persisted 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_event_file_path(
&self,
params: SessionsGetEventFilePathRequest,
) -> Result<SessionsGetEventFilePathResult, Error>
pub async fn get_event_file_path( &self, params: SessionsGetEventFilePathRequest, ) -> Result<SessionsGetEventFilePathResult, Error>
Computes the absolute path to a session’s persisted events.jsonl file.
Wire method: sessions.getEventFilePath.
§Parameters
params- Session ID whose event-log file path to compute.
§Returns
Absolute path to the session’s events.jsonl file on disk.
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 get_persisted_remote_steerable(
&self,
params: SessionsGetPersistedRemoteSteerableRequest,
) -> Result<SessionsGetPersistedRemoteSteerableResult, Error>
pub async fn get_persisted_remote_steerable( &self, params: SessionsGetPersistedRemoteSteerableRequest, ) -> Result<SessionsGetPersistedRemoteSteerableResult, Error>
Returns a session’s persisted remote-steerable flag, if any has been recorded.
Wire method: sessions.getPersistedRemoteSteerable.
§Parameters
params- Session ID to look up the persisted remote-steerable flag for.
§Returns
The session’s persisted remote-steerable flag, or omitted when no value has been persisted.
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 same metadata records, with summary and context fields backfilled where available.
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.
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